Battleship Guessing and Placement Algorithms - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Battleship Guessing and Placement Algorithms

Description:

Battleship. Guessing and Placement Algorithms. Gemma Francisco. Department of ICS ... Must search in different areas to find a ship part ... – PowerPoint PPT presentation

Number of Views:351
Avg rating:3.0/5.0
Slides: 9
Provided by: ethann
Category:

less

Transcript and Presenter's Notes

Title: Battleship Guessing and Placement Algorithms


1
BattleshipGuessing and Placement Algorithms
  • Gemma Francisco
  • Department of ICS
  • University of California, Irvine

2
Guessing Search and Sink Modes
  • Search Mode
  • Must search in different areas to find a ship
    part
  • Enters this mode at the beginning of the game and
    after a ship has been sunk
  • Sink Mode
  • Enters this mode after a ship part has been found
  • Knows generally where a ship is located
  • Initially does not know orientation
  • Stays in sink mode until receives notification
    that the ship has been sunk

3
Non-Learning Algorithm
  • Chooses guessing spaces randomly
  • Accepts any guess as long as it is valid
  • Chooses ship location randomly
  • Accepts location as long as the ship fits

4
2 by 2 Average Square Algorithm
  • Uses historical data from past games
  • Evaluates the average amount of times a ship has
    been placed in each square
  • Further averages 2 by 2 squares
  • Guess on two out of the four squares in each area
    diagonally
  • Has a counterpart ship placement algorithm
  • Evaluates average for areas from opponents
    guessing in past games
  • Attempts to place the ships in not commonly
    guessed areas

5
2 by 2 Average Square Algorithm
6
Smallest Average Placement
  • Examines all possible placements
  • Takes the average of the number of times the
    opponent has guessed in each square of the
    prospective placement
  • Begins with the smallest ship

7
Example
  • Below is the example data
  • The tables on the right show the possible moves
    that the algorithm considers

8
N-Square Size Placement
  • For each ship of size n, take the average number
    of times the opponent has guessed in each n by n
    square
  • Place the ship randomly within the square with
    the smallest average.
Write a Comment
User Comments (0)
About PowerShow.com