Yo Java Help
Im trying to make a program that when I click the screen it tell me if I am farther or closer to the desired point from my last click. Unfortunately I don't have the code on hand, but this is the important part.
Remember I am rather new at this, don't throw anything huge at me.
mice is the click cordinates and secret is the hidden point
then I have an if statement to make the nows positive
This was the key part that I need help with, what I currently have
It works OVERALL, but it has some bugs dealing with if you get closer move so on one axis, but move away tiny bit on the other, then it shows it as colder.
Im this close to using the Pythagorean theorem.
... Rather messy, okay...
Replace message with System.out.println and put the quoted text in ()
You are also missing a ton of brackets. I would make a rewritten version but I'm on my iPad and screw typing code with my iPad...
This is just a short overview, in reality there is mad code all around these.
I have no idea what you mean with the message. Probably because we aren't that far, I found out how to use the mouse just last week.
I guessing you are using a modified java grinder.
System.out.println is the call for java to output. In this case, text.
I think I have a String message = "Find the Snail"; initialized
What's your problem, exactly? Like, "(0,0) is your destination. Your first click is at (12,0). Your second one is at (9,0). Hotter. your third one is at (9,1). Colder."
No that works (I think).
If the third one was like (1,3) (or something like that) it would be colder.
I might just copy the whole thing tommorow.
yeah I can't seem to correlate the X and Y, again Pythagorean theorem is in the back og my mind, but that seems messy
Seems like you got some sort of PRIORITY problems going on
One pixel away from the wanted "Y" value has priority over many pixels towards the wanted "X" value. You'd have to show more code if we are to solve it, really. I'm trying to think of a way where you could have just one formula for determining the messages so that they don't conflict, like, for example, if you had one to calculate the net gain of distance towards the point to determine if you are hot or cold
I'm thinking "nowX+nowY<=lastX+lastY" or some BS
I don't know how one would code 2 values like that.
Originally Posted by Celery
last time I did something that it was syntax error fool
Um, put each one under an alias and then put those aliases in the equation? http://opendap.org/api/javaDocs/dods/dap/Alias.html
If not that, than I am lost as to what your problem is. Do you mean putting two values going IN or two values going OUT?