]Hello, so i have this game iam working on for homework, which is basically the Battleship game written in java, still in the beginning and stuck at this step :
what i want is after i enter a Wrong value which is <0 or >10 the program would go back to the System.out.println("Enter the row of the ship"); step so i can retype a correct value !
sorry if my question is hard to understand iam still a newbie in java (first semester in uni)
Thanks for the help
i still cant get how to put the code so there would be line numbers next to each line, sorry
Thank you for finding the code button, but you didn't quite use it correctly. Look here for how it works. I have corrected it for you and doesn't it look better
You can put the call to enter the number inside a loopBut that sort of code doesn't belong there. It belongs in a different method. Probably in a different class. When you try to enter the column or the orientation, you will see you are writing the same sort of code again.
eat bricks! HA! And here's another one! And a tiny ad!