That does not make sense for the value of a String.
Include the value of direction with the error message so you can see what the computer sees when the if statements are executed.
Then execute the...
Type: Posts; User: Norm
That does not make sense for the value of a String.
Include the value of direction with the error message so you can see what the computer sees when the if statements are executed.
Then execute the...
Please copy and paste the programs print outs here instead of using images. The images don't show all that was printed.
What was the value of direction? It looks like 2 dots: ..
Is that what...
What was the value of the variable: direction that was not recognized?
The error message should print out the invalid value.
What are the values of x and y while the loop is executing? Because...
Same advice as before.
Also you need to post the new code.
Add some println statements to show where the code is executing to find out the last place it executes before it terminates.