Skip to content

GreyTearsDev/battleship-game

Repository files navigation

BATTLESHIP

Where to play it

Check it out here

Game Rules

The rules of Battleship are simple:

  1. Each player has their ships randomly placed on their respective boards at the begining of each game.
  2. Players take turns firing shots by selecting coordinates on the opponent's grid.
  3. The game ends when all ships of one player are sunk.
  4. The player who sinks all of the opponent's ships first wins the game.

Things I like about it

  • The algorithm used for the AI player's attack draws from principles of Breath First Search (BFS) and Depth-First Search (DFS) algorithms.
  • The UI design

Things I don't like about it

  • Naming of some files and folders could be made more descriptive to reflect the content within them (might refactor it in the future); the same can be said about some of the functions;
  • Some of the functions could have been split into more concise implementations.