Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created January 20, 2014 03:51
Show Gist options
  • Save tarynsauer/8514606 to your computer and use it in GitHub Desktop.
Save tarynsauer/8514606 to your computer and use it in GitHub Desktop.
package tictactoe;
abstract class AlphaBetaPlayer implements AbstractPlayer {
private String marker;
private Player opponent;
public AbstractAlphaBeta(Player player) {
this.marker = player.getMarker();
this.opponent = player.getOpponent();
}
public String getMarker() {
return marker;
}
public Player getOpponent() { return opponent; }
public void setOpponent(Player player) {
this.opponent = player;
}
public void addMarker(Board board, int cellIndex) {
board.getCells()[cellIndex] = this.marker;
}
public double getAlpha(double alpha, double score) {
return alpha;
}
public double getBeta(double beta, double score) {
return beta;
}
public double returnBestScore(double alpha, double beta) {
return alpha;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment