コード例 #1
0
ファイル: GeneralTests.cs プロジェクト: vergi40/ChessArena
        public void Transposition_ExecuteMove_Tests()
        {
            var transposition = new TranspositionTables();

            transposition.Initialize();

            var board = new Board();

            board.InitializeEmptyBoard();

            //
            var firstPawnMove = new SingleMove("d2", "d4");
            var firstMoveHash = board.Shared.Transpositions.GetNewBoardHash(firstPawnMove, board, board.BoardHash);

            board.ExecuteMove(firstPawnMove);
            firstMoveHash.ShouldBe(board.BoardHash);

            //
            var second         = new SingleMove("e7", "e5");
            var secondMoveHash = board.Shared.Transpositions.GetNewBoardHash(second, board, board.BoardHash);

            board.ExecuteMove(second);
            secondMoveHash.ShouldBe(board.BoardHash);

            //
            var capture         = new SingleMove("d4", "e5", true);
            var captureMoveHash = board.Shared.Transpositions.GetNewBoardHash(capture, board, board.BoardHash);

            board.ExecuteMove(capture);
            captureMoveHash.ShouldBe(board.BoardHash);
        }
コード例 #2
0
ファイル: GeneralTests.cs プロジェクト: vergi40/ChessArena
        public void InitializeBoardHash()
        {
            var transposition = new TranspositionTables();

            transposition.Initialize();

            var board = new Board();

            board.InitializeEmptyBoard();

            var hash = board.BoardHash;
            // 121398
        }
コード例 #3
0
 public SharedData()
 {
     Transpositions = new TranspositionTables();
     Transpositions.Initialize();
 }