Question: write a battleship program in javascript rules are listed below: 1. board should be 8x8 for a total of 64 squares. 2. there are only
write a battleship program in javascript rules are listed below:
1. board should be 8x8 for a total of 64 squares.
2. there are only 5 ships
3. the user enters the first ship and the direction the other ships will be placed.
4.the computer should try and guess where the user put the ships. (i.e. the computer plays the game and makes all the guesses.)
5. The computer should be smart enough to not check the same square twice.
6. Give the hit ratio after the game is over.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
