How can I be sure I tested my battleship project properly?
There are a couple test cases you should run through and if you’re met with any errors, you’ll know where to look in your code based on what you’re trying to test.
- Guess a row and/or column value that is 5 or greater, your code should print that it’s not in the ocean and loop again.
- Guess an incorrect coordinate that you haven’t guessed before, your code should tell you that you missed.
- Guess another incorrect one that you have guessed already, and your code should tell you that.
- Guess incorrectly on your 4th turn and you should see game over.
- Guess correctly at any time and you should see a congratulations and your code should exit!