Ejemplo n.º 1
0
        public void Test03()
        {
            GameState gameState = TestCases.Test03();

            var move = this.brain.Move(gameState);

            Assert.That(move, Is.EqualTo(LegalMove.Down));
        }
Ejemplo n.º 2
0
        public void Test03()
        {
            var gameState = TestCases.Test03();

            var stopwatch = Stopwatch.StartNew();
            var move      = this.brain.Move(gameState);

            Console.WriteLine(stopwatch.Elapsed);

            Assert.That(move, Is.EqualTo(LegalMove.Down));
        }
Ejemplo n.º 3
0
        public void ProcessMoves_MoveIntoOtherSnakeBodyWithFullHealth_SnakeGetsZeroHealth()
        {
            var board = TestCases.Test03().Board;

            int[,] boardArray = GetBoardArray(board);
            var snakeBodies = GetSnakeBodies(board);
            var healths     = GetHealths(board);

            var moves = new LegalMove[] { LegalMove.Up, LegalMove.Up };

            (var futureSnakes, var futureHealths) = this.gameEngine.ProcessMoves(snakeBodies, healths, boardArray, moves);

            Assert.That(futureHealths[0], Is.EqualTo(0));
        }