net.bluebones.tictactoe
Class AI
java.lang.Object
net.bluebones.tictactoe.AI
- All Implemented Interfaces:
- Player
public class AI
- extends Object
- implements Player
Implementation of Minimax with alpha-beta pruning AI. Taken in part from
http://mainline.brynmawr.edu/Courses/cs372/fall2000/AB.html.
- Version:
- 1.1
- Author:
- Thomas David Baker, bakert+tictactoe@gmail.com
Method Summary |
Move |
getMove(byte[][] board,
Move prev,
byte color)
Gets the next move of this player. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AI
public AI()
getMove
public Move getMove(byte[][] board,
Move prev,
byte color)
- Gets the next move of this player.
- Specified by:
getMove
in interface Player
- Parameters:
board
- Board
representation of the current game
state.prev
- Move
representing the previous move in the
the game.color
- int
representing the pieces this
Player
is playing with. One of
TicTacToe.NOUGHTS
or
TicTacToe.CROSSES
- Returns:
Move
Next move of this player.