lineThroughBoard() 공개 메소드

public lineThroughBoard ( ) : bool
리턴 bool
예제 #1
0
        public override bool terminalTest(GameState state)
        {
            TicTacToeBoard board  = (TicTacToeBoard)state.get("board");
            bool           line   = board.lineThroughBoard();
            bool           filled = board.getNumberOfMarkedPositions() == 9;

            return(line || filled);
        }
예제 #2
0
        //
        // PRIVATE METHODS
        //
        private int computeUtility(TicTacToeBoard aBoard, String playerToMove)
        {
            int retVal = 0;

            if (aBoard.lineThroughBoard())
            {
                if (playerToMove.Equals("X"))
                {
                    retVal = -1;
                }
                else
                {
                    retVal = 1;
                }
            }
            return(retVal);
        }
예제 #3
0
	//
	// PRIVATE METHODS
	//
	private int computeUtility(TicTacToeBoard aBoard, String playerToMove) {
		int retVal = 0;
		if (aBoard.lineThroughBoard()) {
			if (playerToMove.Equals("X")) {
				retVal = -1;
			} else {
				retVal = 1;
			}

		}
		return retVal;
	}