chessai

college code for ai playing chess in java

git clone https://9o.is/git/chessai.git

commit 6a93c2399388dd3ad9a93c29f98134ff9ddee68f
parent a56ed8044b9e4b7116373c5685125471e6610165
Author: Jul <jul@9o.is>
Date:   Sat,  1 Dec 2012 18:16:11 -0500

Player does not accept NA color.

Diffstat:
Msrc/chess/Player.java | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/chess/Player.java b/src/chess/Player.java @@ -6,10 +6,17 @@ import chess.piece.ChessColor; * Check */ public class Player { + + private static final String ERROR_MSG = + Player.class+": Invalid color."; + private int points; private ChessColor color; public Player(ChessColor color) { + if(color == ChessColor.NA) + throw new IllegalArgumentException(ERROR_MSG); + this.color = color; points = 0; }