Check out the live example.
As with human players, CPU is unaware of where the player's ships are set. It will take random shots until it hits a ship. At this point, it will log where that square is, then attack the squares in various directions until it learns the direction the ship is sitting. Once again, just like a human player, the CPU is notified when the ship under attack sinks and reverts to random attacks.
There is a mock backend created using MirageJS. You can view highscores at any time. At the end of the game you can submit your score.
Concise game instructions for those who are new to the game.
Helpful data on ships remaining and attack count.
- React
- Redux
- TypeScript
- Tailwind
- Jest & React Testing Library
- MirageJS