예제 #1
0
        public void Test01()
        {
            GameState gameState = TestCases.Test01();

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

            Assert.That(move, Is.EqualTo(LegalMove.Right));
        }
예제 #2
0
        public void Test01()
        {
            var gameState = TestCases.Test01();

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

            Console.WriteLine(stopwatch.Elapsed);

            Assert.That(move, Is.EqualTo(LegalMove.Right).Or.EqualTo(LegalMove.Left));
        }
예제 #3
0
        public void ProcessMoves_MoveIntoUpperWallWithFullHealth_SnakeGetsZeroHealth()
        {
            var board = TestCases.Test01().Board;

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

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

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

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