#Really new to Java programming and I'm trying to make a sorting algorithm.

1 messages · Page 1 of 1 (latest)

dreamy haloBOT
#

<@&987246746478460948> please have a look, thanks.

wide vortex
#

what are the errors ?

tardy cliff
#
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:40: error: illegal start of expression
            private int minn = array.max();
            ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:42: error: illegal start of type
            for (int k = i; k < length - 1; k++) {
            ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:42: error: > expected
            for (int k = i; k < length - 1; k++) {
                                       ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:42: error: <identifier> expected
            for (int k = i; k < length - 1; k++) {
                                             ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:51: error: illegal start of type
            for (int l = i; l < (pos + i)/2; l++) {
            ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:51: error: illegal start of type
            for (int l = i; l < (pos + i)/2; l++) {
                                ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:51: error: <identifier> expected
            for (int l = i; l < (pos + i)/2; l++) {
                                    ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:51: error: <identifier> expected
            for (int l = i; l < (pos + i)/2; l++) {
                                              ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:56: error: <identifier> expected
            Delays.sleep(0.025);
                        ^
#
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:56: error: illegal start of type
            Delays.sleep(0.025);
                         ^
/home/natedouglasmusic/Documents/ArrayV-main/src/main/java/io/github/arrayv/sorts/select/MagnetSort.java:58: error: class, interface, enum, or record expected
    }
    ^
11 errors
wide vortex
tardy cliff
#

There should be a 3kb text file attached

wide vortex
#

ah you can't put private for a local variable

tardy cliff
#

ohh okay

#

What about the for loops?

wide vortex
tardy cliff
#

There are also errors given for the for loops

#

here's the most recent error log

frozen halo
#

You are missing a semicolon, end bracket, or something like that. Are you not using an IDE?

tardy cliff
#

no i'm using a text editor lol

#

and them importing the file into a software and these are the errors that it gives

frozen halo
#

You mean compiling it using javac?

tardy cliff
#

idk

#

i'm hitting the import button and it's saying 'no'

frozen halo
#

That's the full message eh?

tardy cliff
#

no lol it gives me a bunch of cryptic errors and creates these error log text files

frozen halo
#

Usually the reason is at the very start of the error message.

tardy cliff
#

uh hold on

frozen halo
#

But like I said, long errors like that usually mean some little thing like missing brace,bracket,semicolon

#

Wrong number of parameters.

tardy cliff
#

(2nd one first)

tardy cliff
frozen halo
#

Surely you could just post the code here. Someone would see the error. But curious what this nebulous "import code" thing is.

tardy cliff
#

Here's the code

#

And here's the whole process

#

uh one sec

#

@frozen halo

frozen halo
#

So you didn't write this? Just running it? Does it work for anything else?

tardy cliff
#

I wrote magnetsort
Not the program

#

haven't tried anything else yet but still

wide vortex
tardy cliff
#

i don't want to bc i don't know how well that would work
esp. considering that arrayv is designed to handle specifically cases like this

#

mostly concerned about the imports

#

-# also i've been asking about the for loops and i've gotten no explanation on the for loops other than guesses that are unrelated

frozen halo
#

You seem to be using a array visualizer program which accepts and compiles your code and runs it. You've tried no other program yet to see if it's your program or the array visualizer. Also, maybe there is other logs as you've alluded to, but they are as un-investigated or whatever.

tardy cliff
#

I'm desinging this for arrayv

frozen halo
#

Is this the state of things?

tardy cliff
#

the other logs are just old logs

frozen halo
#

Have you contacted the person, people or github issues page of this software?

tardy cliff
#

I don't think they're the problem

#

They know what they're doing

#

I don't

#

I think I'm the thing wrong with this situation

frozen halo
#

Could be, there's probably instructions somewhere.

#

Maybe delete that .cache/compile folder

#

Maybe try to get some other sort program to run.

tardy cliff
#

Not the problem

tardy cliff
#

I have no way to put this lightly but neither of you have helped so far

frozen halo
#

Yea, sorry, we didn't write the thing. You can down load intellij for free. Put your code in there. check it out.

#

sorry, what is this array.max() shit?

#

arrays don't have methods

#

You don't put public on local variables either.

#

int minn = Integer.MAX_VALUE;

tardy cliff
#

-# the people in vc were more helpful

tardy cliff
#

Got it working