cleanup
This commit is contained in:
11
src/attack.c
11
src/attack.c
@@ -117,16 +117,8 @@ bitboard_t sq_attackers(const pos_t *pos, const bitboard_t occ, const square_t s
|
|||||||
to = pos->bb[c][PAWN];
|
to = pos->bb[c][PAWN];
|
||||||
tmp = bb_pawns_attacks(sqbb, sq_up(opp)) & to;
|
tmp = bb_pawns_attacks(sqbb, sq_up(opp)) & to;
|
||||||
attackers |= tmp;
|
attackers |= tmp;
|
||||||
//to = pos->bb[c][PAWN];
|
|
||||||
//tmp = pawn_shift_upleft(sqbb, opp) & to;
|
|
||||||
//attackers |= tmp;
|
|
||||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||||
bb_print("att pawn upleft", tmp);
|
bb_print("att pawn", tmp);
|
||||||
# endif
|
|
||||||
//tmp = pawn_shift_upright(sqbb, opp) & to;
|
|
||||||
//attackers |= tmp;
|
|
||||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
|
||||||
bb_print("att pawn upright", tmp);
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* knight & king */
|
/* knight & king */
|
||||||
@@ -158,7 +150,6 @@ bitboard_t sq_attackers(const pos_t *pos, const bitboard_t occ, const square_t s
|
|||||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||||
bb_print("att rook/queen", tmp);
|
bb_print("att rook/queen", tmp);
|
||||||
bb_print("ATTACKERS", attackers);
|
bb_print("ATTACKERS", attackers);
|
||||||
printf("attackers=%lx\n", attackers);
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
return attackers;
|
return attackers;
|
||||||
|
@@ -95,10 +95,10 @@ bool pseudo_is_legal(const pos_t *pos, const move_t move)
|
|||||||
* One case not handled anywhere else: when the two "disappearing" pawns
|
* One case not handled anywhere else: when the two "disappearing" pawns
|
||||||
* would discover a R/Q horizontal check.
|
* would discover a R/Q horizontal check.
|
||||||
*/
|
*/
|
||||||
if (is_enpassant(move)) {
|
if (unlikely(is_enpassant(move))) {
|
||||||
bitboard_t rank5 = bb_rel_rank(RANK_1, us);
|
bitboard_t rank5 = bb_rel_rank(RANK_5, us);
|
||||||
|
|
||||||
if ((pos->bb[us][KING] & rank5)) {
|
if (unlikely((pos->bb[us][KING] & rank5))) {
|
||||||
bitboard_t exclude = BIT(pos->en_passant - sq_up(us)) | BIT(from);
|
bitboard_t exclude = BIT(pos->en_passant - sq_up(us)) | BIT(from);
|
||||||
bitboard_t rooks = (pos->bb[them][ROOK] | pos->bb[them][QUEEN]) & rank5;
|
bitboard_t rooks = (pos->bb[them][ROOK] | pos->bb[them][QUEEN]) & rank5;
|
||||||
|
|
||||||
|
@@ -226,13 +226,14 @@ static __unused void compare_moves(movelist_t *fish, movelist_t *me)
|
|||||||
|
|
||||||
static int usage(char *prg)
|
static int usage(char *prg)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: %s [-d depth] [-p pertf-modules] -n\n", prg);
|
fprintf(stderr, "Usage: %s [-d depth] [-p pertf-modules] [-n][-v]\n", prg);
|
||||||
|
fprintf(stderr, "\t-d: depth, -p: 1-3, -n: no SF res check, -v: output moves\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int __unused ac, __unused char**av)
|
int main(int ac, char**av)
|
||||||
{
|
{
|
||||||
int i = 0, test_line;
|
int test_line;
|
||||||
u64 sf_count = 0, my_count;
|
u64 sf_count = 0, my_count;
|
||||||
char *fen;
|
char *fen;
|
||||||
pos_t *pos = NULL, *fenpos;
|
pos_t *pos = NULL, *fenpos;
|
||||||
@@ -258,7 +259,7 @@ int main(int __unused ac, __unused char**av)
|
|||||||
case 'd':
|
case 'd':
|
||||||
depth = atoi(optarg);
|
depth = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
case 'p': /* 1 or 2 */
|
case 'p': /* 1 or 2 or 3 for both */
|
||||||
run = atoi(optarg);
|
run = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
@@ -369,10 +370,6 @@ int main(int __unused ac, __unused char**av)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
// pos_del(savepos);
|
|
||||||
i++;
|
|
||||||
/* to run first test only */
|
|
||||||
// exit(0);
|
|
||||||
}
|
}
|
||||||
pos_del(pos);
|
pos_del(pos);
|
||||||
if (sf_run) {
|
if (sf_run) {
|
||||||
|
Reference in New Issue
Block a user