Example #1
0
 public void SuperSimpleWinMinimax()
 {
     Minimax m = new Minimax();
     m.Depth = 1;
     var initial = new TicTacToe(false, new[] { -1, 0, -1, -1, 1, 1, 1, 0, 1 });
     m.Find(initial);
 }
Example #2
0
 public void Test_Expansion()
 {
     TicTacToe t = new TicTacToe(false, new[] { -1, 0, -1, 1, 0, 0, 0, 1, 0 });
     Console.WriteLine(t);
     foreach (var successor in t.GetSuccessors())
     {
         PrintSuccessor(successor);
     }
 }
Example #3
0
        public void SuperSimpleWinMinimax()
        {
            Minimax m = new Minimax();

            m.Depth = 1;
            var initial = new TicTacToe(false, new[] { -1, 0, -1, -1, 1, 1, 1, 0, 1 });

            m.Find(initial);
        }
Example #4
0
        public void Test_Expansion()
        {
            TicTacToe t = new TicTacToe(false, new[] { -1, 0, -1, 1, 0, 0, 0, 1, 0 });

            Console.WriteLine(t);
            foreach (var successor in t.GetSuccessors())
            {
                PrintSuccessor(successor);
            }
        }
Example #5
0
        public bool IsEqualTo(IState state)
        {
            if (state == null)
            {
                return(false);
            }
            if (!(state is TicTacToe))
            {
                return(false);
            }

            TicTacToe tictactoe = (TicTacToe)state;

            for (int i = 0; i < _board.Length; i++)
            {
                if (_board[i] != tictactoe._board[i])
                {
                    return(false);
                }
            }

            return(true);
        }