示例#1
0
        public void CheckIfTicBotAddsCrosses()
        {
            var game = new Game();

            game.InitHistory();
            game.InitBoard();
            var ticBot = new SimpleBot(Side.Tic);

            ticBot.MakeAutoMove(game);
            Assert.Equal(Side.Tic, game.History.LastTurn.Side);
        }
示例#2
0
        public void PlayBotVersusBot()
        {
            var game = new Game();

            game.InitHistory();
            game.InitBoard();
            var ticBot = new SimpleBot(Side.Tic);
            var tacBot = new SimpleBot(Side.Tac);

            while (!BoardIsFull(game.Board) && !TicTacToeRulesHelper.HasWinner(game.Board.Squares))
            {
                ticBot.MakeAutoMove(game);
                tacBot.MakeAutoMove(game);
            }
        }