Your Board
Computer's Board
General Instruction
The main objective of the game is to sink all of the other player’s ships.
Before starting the game, first the user needs to place all of his/her ships on the board. The user can do this by dragging the ship and dropping it in any square coordinates in the board. The ship should be placed such that the coordinates of two ships cannot overlap with each other and the whole body of the ship must remain within the boundary of the board.
The user can change the direction of the ship to be vertical or horizontal by clicking on the ship itself. The direction of the ship cannot be changed once it has been placed on the board.
The game begins after the user is done placing all of his/her ships on the board. The computer’s ships are not rendered on the screen. The user must attack the computer’s ship by clicking on one of the square of the computer's board. If the square that was clicked contains a ship, then it’s counted as a hit. If a ship is not present at the square, then it’s a miss.
The user and the computer will alternate turns. A player can only attack the opponent’s ship once on each turn unless the player successfully attacks the opponent’s ship in which case the attacking player will get another chance to attack the opponent’s ship.
The player who first manages to sink all of the opponent's ships is the winner.