コード例 #1
0
        public void GetUniqueIdentifier_should_returnDifferentValuesForDifferentInTurnPlayer()
        {
            var b = "OOKOO" +
                    "....." +
                    "....." +
                    "....." +
                    "ookoo";

            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, inTurnPlayerIndex: 0)).Should().NotBe(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, inTurnPlayerIndex: 1)));
        }
コード例 #2
0
        public void GetUniqueIdentifier_should_returnSameValuesForFlippedBoard_1()
        {
            var b = "OOKOO" +
                    "....." +
                    "....." +
                    "....." +
                    "ookoo";
            var cardNumbers1 = new[] { 0, 1, 2, 3, 4 };
            var cardNumbers2 = new[] { 2, 3, 0, 1, 4 };

            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, inTurnPlayerIndex: 0, cardNumbers: cardNumbers1)).Should().Be(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, inTurnPlayerIndex: 1, cardNumbers: cardNumbers2)));
        }
コード例 #3
0
        public void GetUniqueIdentifier_should_returnDifferentValuesForDifferentCards()
        {
            var b = "OOKOO" +
                    "....." +
                    "....." +
                    "....." +
                    "ookoo";
            var cards        = new[] { Card.Boar, Card.Cobra, Card.Dragon, Card.Eel, Card.Frog };
            var cardNumbers1 = new[] { 0, 1, 2, 3, 4 };
            var cardNumbers2 = new[] { 0, 1, 2, 4, 3 };

            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers1)).Should().NotBe(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers2)));
        }
コード例 #4
0
        public void GetUniqueIdentifier_should_returnDifferentValueForBoardsWithPawnRemoved()
        {
            var b1 = "OOKOO" +
                     "....." +
                     "....." +
                     "....." +
                     "ookoo";
            var b2 = "OOKOO" +
                     "....." +
                     "....." +
                     "....." +
                     "ook.o";

            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b1)).Should().NotBe(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b2)));
        }
コード例 #5
0
        public void GetUniqueIdentifier_should_returnDifferentValueForBoardsWithPawnsInDIfferentPositions2()
        {
            var b1 = "OO..." +
                     "..K.." +
                     "...o." +
                     ".o..." +
                     "..k.o";
            var b2 = "OO..." +
                     "..K.." +
                     "...o." +
                     "..o.." +
                     "..k.o";

            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b1)).Should().NotBe(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b2)));
        }
コード例 #6
0
        public void GetUniqueIdentifier_should_returnSameValueForMirroredBoards_3()
        {
            var b1 = "....K" +
                     "O...O" +
                     "....." +
                     "....." +
                     "oo..k";
            var b2 = "K...." +
                     "O...O" +
                     "....." +
                     "....." +
                     "k..oo";

            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b1)).Should().Be(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b2)));
        }
コード例 #7
0
        public void GetUniqueIdentifier_should_returnSameValuesForSameCardsInDifferentOrder()
        {
            var b = "O.KOO" +
                    "....." +
                    ".O..." +
                    "..oo." +
                    "..koo";
            var cards        = new[] { Card.Boar, Card.Cobra, Card.Dragon, Card.Eel, Card.Frog };
            var cardNumbers1 = new[] { 0, 1, 2, 3, 4 };
            var cardNumbers2 = new[] { 1, 0, 2, 3, 4 };
            var cardNumbers3 = new[] { 0, 1, 3, 2, 4 };
            var cardNumbers4 = new[] { 1, 0, 3, 2, 4 };

            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers1)).Should().Be(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers2)));
            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers1)).Should().Be(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers3)));
            MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers1)).Should().Be(MiniMax.GetUniqueIdentifier(GameUtil.ParseGameState(b, cards, 0, cardNumbers4)));
        }