Classic "Sea Battle" game on Windows Forms with Enemy bot.
Go to Releases, choose the latest release and click the "sea-battle.exe" or just click here.
Place ships panel => choose ship size => mouse cursor on the field
mouse left button to place a ship
After you've placed all the ships, choose the enemy settings and press "Start Game".
- Press on the enemy field button. You and the enemy go one by one.
- The text of the button displays the turn outcome.
dot
is a hit,cross
is a miss.
Status
also helps you monitoring current move action.
- When you hit an enemy ship you will be able to continue your moves until you miss.
- When the enemy ship becomes dead - all the cells around it get covered in dots.
Meanwhile, enemy-bot is attacking our field!
- Game stops the moment someone destroys all of the opponent ships.
- When it happens you will be able to see where the enemy ships were located.
->
- After finding the first piece next move is going to be random around the current piece (1 to 4 in this case) until it hits next time.
↓
- When it gets to the edge it checks if the edge's Y-axis coordinate is the same the original "hit" piece to determine whether the ship is horizontal.
- Now it goes back to the original ship piece shot and moves the opposite direction (up/down or left/right depending on the condition if the ship is horizontal, which it determined last step).
* Enemy algorithm works the same with any ship size and it also understands if the cell was already shot and attacks the opposite way.
* This algorithm is the most effective way to play "Sea Battle" and usually people use the same strategy.