Beispiel #1
0
        public override bool terminalTest(GameState state)
        {
            OctapawnBoard board = (OctapawnBoard)state.get("board");

            //			bool line = board.lineThroughBoard();
            //			bool filled = board.getNumberOfMarkedPositions() == 9;
            //			return (line || filled);
            return(board.gameLost("B") || board.gameLost("W"));
        }
Beispiel #2
0
 private int computeUtility(OctapawnBoard aBoard, string playerToMove)
 {
     //int retVal = 0;
     if (aBoard.gameLost("W"))
     {
         if (playerToMove.Equals("W"))
         {
             return(-1);
         }
     }
     else if (aBoard.gameLost("B"))
     {
         if (playerToMove.Equals("B"))
         {
             return(1);
         }
     }
     return(0);
 }
Beispiel #3
0
		private int computeUtility(OctapawnBoard aBoard, string playerToMove) 
		{
			//int retVal = 0;
			if (aBoard.gameLost("W")) 
			{
				if (playerToMove.Equals("W"))
					return -1;
			}
			else if (aBoard.gameLost("B"))
			{
				if (playerToMove.Equals("B"))
					return 1;
			}
			return 0;
		}