예제 #1
0
            public Tuple <int, Move> Simulate(int depth)
            {
                var  bestScore = int.MinValue;
                Move bestMove  = null;

                foreach (var action in game.GetCurrentPlayer().GetPossibleActions(initialPlayer))
                {
                    var score = Simulate(action, depth);
                    if (score > bestScore)
                    {
                        bestScore = score;
                        bestMove  = action;
                    }
                }

                return(new Tuple <int, Move>(bestScore, bestMove));
            }
예제 #2
0
 public Simulation(Game game)
 {
     this.game = game;//.Copy();
     initialScore = game.GetScore();
     initialPlayer = game.GetCurrentPlayer();
 }
예제 #3
0
 public Simulation(Game game)
 {
     this.game     = game;//.Copy();
     initialScore  = game.GetScore();
     initialPlayer = game.GetCurrentPlayer();
 }