Ship placement
1. Random generation
2. Your placement (only for Desktop)

Game Rules

Sea Battle is a two-player game, where players take turns guessing the location of their opponent's ships on a map. In this game, you will play against the computer.
Each player places their ships on a 10x10 grid prior to the start of the game. The goal is to be the first player to successfully hit and sink all of your opponent's ships. The player who goes first is selected at random.
When it's your turn, you will choose a coordinate on the enemy's map. If there is a ship located at the coordinate you choose, it will be marked as "HIT". If you sink the ship, the word "SANK" will appear and you will have the opportunity to take another shot. If the shot misses, the word "MISS" will appear and the turn will pass to your opponent.
Each player can have a maximum of 10 ships on the map, with the following distribution: one 4-square ship, two 3-square ships, three 2-square ships, and four 1-square ships. The ships can only be placed vertically or horizontally, and there must be at least one empty square between each ship.
It's important to note that the computer does not use information about player ships to gain an advantage in the game.

What's so special about this computer AI?

My sea battle AI utilizes a more strategic approach compared to most other AI's that simply choose coordinates randomly. Instead, the AI calculates the point with the highest probability of having a ship by randomly placing unfound ships on free cells. The point with the most generated ships on it is then targeted by the computer's shot. This approach ensures both effectiveness and randomness, making it impossible for the user to exploit any predictable patterns. Based on my statistics, this AI has a 60% win rate against other random-based sea battle AI's, which is a remarkable result considering the inherent chaos of the battleship game.

Contacts

This game is made by Alex Kap.
My GitHub