I'm in the process of writing a small battleship program.
The battleships are randomly mapped out along an index of 20.
I'm required to create a cheat sheet that displays a map of the battleship coordinates if the user enters 42 but I get an index out of bounds error.
I'm not allowed to use a try catch method to deal with this issue.
Can anyone help me figure out how to enter a number larger than the array size to display the cheat sheet?