Compare commits
No commits in common. "c6ea3de8229273ceee602eb0e98d4779ef84021b" and "1ca79fa2cad2f45b24c562d0c9d6c4f9194d20c6" have entirely different histories.
c6ea3de822
...
1ca79fa2ca
|
|
@ -26,6 +26,8 @@ class Movegen {
|
||||||
|
|
||||||
Move Movegen::next_move() {
|
Move Movegen::next_move() {
|
||||||
while(square <= 0x77) {
|
while(square <= 0x77) {
|
||||||
|
if(square & 0x88) square += 8;
|
||||||
|
|
||||||
byte piece_type = Board::field[square] & 0x7;
|
byte piece_type = Board::field[square] & 0x7;
|
||||||
|
|
||||||
if(
|
if(
|
||||||
|
|
@ -47,7 +49,6 @@ Move Movegen::next_move() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
square++;
|
square++;
|
||||||
if(square & 0x88) square += 8;
|
|
||||||
direction = 0;
|
direction = 0;
|
||||||
target_square = square;
|
target_square = square;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
Tasks.h
17
Tasks.h
|
|
@ -14,10 +14,19 @@ unsigned long pseudo_perft(byte depth) {
|
||||||
Movegen gen;
|
Movegen gen;
|
||||||
Move m;
|
Move m;
|
||||||
|
|
||||||
while((m = gen.next_move()).sq_to != 255) {
|
while (true) {
|
||||||
Board::make(m);
|
m = gen.next_move();
|
||||||
move_count += pseudo_perft(depth-1);
|
if(m.sq_to != 255) {
|
||||||
Board::unmake();
|
Board::make(m);
|
||||||
|
if(!Threat::illegal()) {
|
||||||
|
move_count += pseudo_perft(depth-1);
|
||||||
|
} else {
|
||||||
|
//Board::print();
|
||||||
|
}
|
||||||
|
Board::unmake();
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return move_count;
|
return move_count;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue