battleship

Play battleship online with friends!

MIT License

Stars
2
Committers
1

BATTLESHIP

Dominate the seas, one battle at a time Sink your enemies before they sink you!

  • 2 Player online game: Create your own game rooms and invite your friends
  • Choose your strategy: randomize your ship placement or carefully position your fleet manually!
  • Compete for glory: track your performance and rise through the ranks on the leaderboard!

Tech stack


  • Next.js
  • Socket.io
  • Node.js
  • Express.js
  • Firebase

Bot's Coordinate Guesser Logic


An intelligent coordinate guesser algorithm has been designed for the robot to predict coordinates that leverages on the previous HIT coordinates along with predicted direction of ship alignment (vertical or horizontal) where the ship was HIT but not WRECKED. Data Structure of the HIT Stack:

{
 row: number;
 col: number;
 shipId: string;
 direction: "vertical" | "horizontal" | null;
}[]