Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2K views

Battleship Algorithm

The document describes the process of playing a game of battleship, where a player guesses the location and orientation of hidden ships on a grid. It involves calculating probability fields to determine the most likely guesses, pursuing in directions, switching directions 180 degrees if a hit isn't found, and checking if the current ship has been sunk or if any partially sunk ships remain on the board.

Uploaded by

api-292892066
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Battleship Algorithm

The document describes the process of playing a game of battleship, where a player guesses the location and orientation of hidden ships on a grid. It involves calculating probability fields to determine the most likely guesses, pursuing in directions, switching directions 180 degrees if a hit isn't found, and checking if the current ship has been sunk or if any partially sunk ships remain on the board.

Uploaded by

api-292892066
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Are there any partially sunk ships?

Hunting
Guess the most probable location of users
ship based on the calculated probability field
Game Over
Was that the
last ship?

Game Over

Hit?

Ship
Sunk?

Was that the


last ship?
Destroying
Guess the most probable direction for
the orientation of the ship

Hit?

Ship
Sunk?

Guess in the pursuing direction again

Hit?

Ship
Sunk?

Switch the pursuing direction 180

Have you switched directions on this


ship previously?

You might also like