@@ -12,19 +12,18 @@ import (
1212// to /cmd/bench which is ~10% slower with go1.10.
1313//
1414// TODO -> What's going on here?
15- //
1615func BenchmarkPerft (b * testing.B ) {
1716 type set struct {
1817 Fen string
1918 Depth int
2019 Result uint64
2120 }
2221 testsets := []set {
23- set {Fen : "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" , Depth : 6 , Result : 119060324 },
24- set {Fen : "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1" , Depth : 5 , Result : 193690690 },
25- set {Fen : "n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1" , Depth : 6 , Result : 71179139 },
26- set {Fen : "r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1" , Depth : 5 , Result : 15833292 },
27- set {Fen : "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 0" , Depth : 7 , Result : 178633661 },
22+ {Fen : "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" , Depth : 6 , Result : 119060324 },
23+ {Fen : "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1" , Depth : 5 , Result : 193690690 },
24+ {Fen : "n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - - 0 1" , Depth : 6 , Result : 71179139 },
25+ {Fen : "r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1" , Depth : 5 , Result : 15833292 },
26+ {Fen : "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 0" , Depth : 7 , Result : 178633661 },
2827 }
2928
3029 board := NewBoard ()
@@ -84,23 +83,23 @@ func TestSquareDiffs(t *testing.T) {
8483 }
8584
8685 testset := []set {
87- set {0x72 , 0x12 , ROOK | QUEEN }, // file test down to up
88- set {0x12 , 0x72 , ROOK | QUEEN }, // file test up to down
89- set {0x51 , 0x54 , ROOK | QUEEN }, // rank test left to right
90- set {0x54 , 0x51 , ROOK | QUEEN }, // rank test right to left
91- set {0x64 , 0x37 , BISHOP | QUEEN }, // diagonal up_left to down_right test
92- set {0x37 , 0x64 , BISHOP | QUEEN }, // diagonal down_right to up_left test
93- set {0x77 , 0x0 , BISHOP | QUEEN }, // diagonal up_right to down_left test
94- set {0x0 , 0x77 , BISHOP | QUEEN }, // diagonal down_left to up_right test
95- set {0x0 , 0x12 , KNIGHT }, // knight jump right+up_right
96- set {0x0 , 0x21 , KNIGHT }, // knight jump up+up_right
97- set {0x77 , 0x56 , KNIGHT }, // knight jump down+down_left
98- set {0x77 , 0x65 , KNIGHT }, // knight jump left+down_left
99- set {0x74 , 0x65 , KING | QUEEN | BISHOP }, // one step diagonal (king test)
100- set {0x4 , 0x5 , KING | QUEEN | ROOK }, // one step orthogonal (king test)
86+ {0x72 , 0x12 , ROOK | QUEEN }, // file test down to up
87+ {0x12 , 0x72 , ROOK | QUEEN }, // file test up to down
88+ {0x51 , 0x54 , ROOK | QUEEN }, // rank test left to right
89+ {0x54 , 0x51 , ROOK | QUEEN }, // rank test right to left
90+ {0x64 , 0x37 , BISHOP | QUEEN }, // diagonal up_left to down_right test
91+ {0x37 , 0x64 , BISHOP | QUEEN }, // diagonal down_right to up_left test
92+ {0x77 , 0x0 , BISHOP | QUEEN }, // diagonal up_right to down_left test
93+ {0x0 , 0x77 , BISHOP | QUEEN }, // diagonal down_left to up_right test
94+ {0x0 , 0x12 , KNIGHT }, // knight jump right+up_right
95+ {0x0 , 0x21 , KNIGHT }, // knight jump up+up_right
96+ {0x77 , 0x56 , KNIGHT }, // knight jump down+down_left
97+ {0x77 , 0x65 , KNIGHT }, // knight jump left+down_left
98+ {0x74 , 0x65 , KING | QUEEN | BISHOP }, // one step diagonal (king test)
99+ {0x4 , 0x5 , KING | QUEEN | ROOK }, // one step orthogonal (king test)
101100 // impossible moves
102- set {0x0 , 0x71 , NONE },
103- set {0x5 , 0x36 , NONE },
101+ {0x0 , 0x71 , NONE },
102+ {0x5 , 0x36 , NONE },
104103 }
105104
106105 for i , ts := range testset {
@@ -120,22 +119,22 @@ func TestDiffDirs(t *testing.T) {
120119 }
121120
122121 testset := []set {
123- set {0x70 , 0x07 , DOWN_RIGHT },
124- set {0x47 , 0x65 , UP_LEFT },
125- set {0x77 , 0x11 , DOWN_LEFT },
126- set {0x24 , 0x46 , UP_RIGHT },
127- set {0x61 , 0x66 , RIGHT },
128- set {0x33 , 0x30 , LEFT },
129- set {0x22 , 0x62 , UP },
130- set {0x55 , 0x25 , DOWN },
131- set {0x00 , 0x12 , RIGHT + UP_RIGHT },
132- set {0x00 , 0x21 , UP + UP_RIGHT },
133- set {0x70 , 0x62 , RIGHT + DOWN_RIGHT },
134- set {0x70 , 0x51 , DOWN + DOWN_RIGHT },
135- set {0x77 , 0x65 , LEFT + DOWN_LEFT },
136- set {0x77 , 0x56 , DOWN + DOWN_LEFT },
137- set {0x07 , 0x15 , LEFT + UP_LEFT },
138- set {0x07 , 0x26 , UP + UP_LEFT },
122+ {0x70 , 0x07 , DOWN_RIGHT },
123+ {0x47 , 0x65 , UP_LEFT },
124+ {0x77 , 0x11 , DOWN_LEFT },
125+ {0x24 , 0x46 , UP_RIGHT },
126+ {0x61 , 0x66 , RIGHT },
127+ {0x33 , 0x30 , LEFT },
128+ {0x22 , 0x62 , UP },
129+ {0x55 , 0x25 , DOWN },
130+ {0x00 , 0x12 , RIGHT + UP_RIGHT },
131+ {0x00 , 0x21 , UP + UP_RIGHT },
132+ {0x70 , 0x62 , RIGHT + DOWN_RIGHT },
133+ {0x70 , 0x51 , DOWN + DOWN_RIGHT },
134+ {0x77 , 0x65 , LEFT + DOWN_LEFT },
135+ {0x77 , 0x56 , DOWN + DOWN_LEFT },
136+ {0x07 , 0x15 , LEFT + UP_LEFT },
137+ {0x07 , 0x26 , UP + UP_LEFT },
139138 }
140139
141140 for i , ts := range testset {
0 commit comments