Commit Graph

280 Commits

Author SHA1 Message Date
26b9a5b58a brchess func calls changes, always run perft() & perft2() 2024-03-27 12:53:42 +01:00
65fe74c9c5 movegen: don't separate promotions, perft: loop uses next_legal() 2024-03-27 12:52:39 +01:00
9b2f5ff751 move_{do,undo}: do not save/restore pos state 2024-03-27 12:42:45 +01:00
edcc87be5a a few more perft debug tests 2024-03-27 12:41:38 +01:00
09afd98971 fen2pos: no more pos_checkers etc... position.c: pos_check -> pos_ok (bool) 2024-03-27 12:40:16 +01:00
08ba989170 is_legal: fix check+pinned and knight check; perft-test + perft2() 2024-03-26 17:43:59 +01:00
7637bdad10 attack.c: sq_is_attacked() and is_in_check() 2024-03-26 17:34:11 +01:00
70d6c23c00 position add: pos_set_pinners_blockers() 2024-03-26 17:31:44 +01:00
aaeab03089 revert captured in position before change to move struct 2024-03-23 19:49:35 +01:00
ce2e0e8459 add forgotten changes in bitboard-switch branch (git is so... difficult) 2024-03-23 17:41:15 +01:00
d0279125ae move_{do,undo}: FIX forgotten king[] update, add few bug_on() 2024-03-23 17:37:40 +01:00
798047b84d Merge branch 'bitboard-switch' 2024-03-23 17:26:26 +01:00
856e3e52da add movedo-test 2024-03-21 07:00:20 +01:00
51a348c1e4 add pos_cmp (as a debug check after move_{do,undo}) 2024-03-21 06:58:56 +01:00
51c35e21f4 castling: lowercase macros, nove-{do,undo}: full (untested) version 2024-03-20 10:00:07 +01:00
3a06407d5a move: exclusive M_CAPTURE / M_EN_PASSANT 2024-03-20 09:58:42 +01:00
ae6328ce26 position: add captured piece 2024-03-20 09:57:10 +01:00
08064dd1a1 start bb-based move_do 2024-03-19 18:30:31 +01:00
49705bc707 rename few macros to lowercase, add M_DPUSH move flag 2024-03-19 18:30:10 +01:00
8527c3dee1 movegen: separate all captures (easier later handling) 2024-03-18 10:21:25 +01:00
dc916f5c56 move.h: revert flags to direct bit mask 2024-03-18 09:15:16 +01:00
748953a767 move-gen: separate pawn capture from en-passant (easier later testing) 2024-03-18 09:13:51 +01:00
9c2e76442d add a struct_group for move_do() irreversible changes 2024-03-17 17:34:21 +01:00
49302c7a60 lowercase move flags macros 2024-03-17 17:33:48 +01:00
db38b507ff add gmon.out 2024-03-17 17:30:51 +01:00
9d40a53aea simplify pos_next_legal() 2024-03-16 12:14:59 +01:00
260d8d34bd move.h: simplify flags. movegen.c: add pos_next_legal() 2024-03-16 10:06:55 +01:00
037d49e4ca move-do: copy from pre-bitboard version 2024-03-15 10:53:26 +01:00
4eb620a873 add occ param in sq_attackers() 2024-03-15 09:14:10 +01:00
92dcb1e778 fix king move in pos_is_legal() 2024-03-15 09:12:42 +01:00
c8aea61529 pos_checkers(): add occ parameter 2024-03-15 09:11:28 +01:00
b3f0dd0534 add move_str() 2024-03-15 09:10:32 +01:00
0f06ccb8db simplify piece_details structure/functions (need to rewrite) 2024-03-15 09:08:49 +01:00
3e477f7442 movegen-test: add SF/uci promotion parsing 2024-03-15 09:07:02 +01:00
aba0113344 add piece-test 2024-03-15 09:04:44 +01:00
cc7d91ebfb default compile-command: make testing 2024-03-15 09:03:30 +01:00
17d1dc52f9 movegen: pseudo_is_legal() and pos_legalmoves() 2024-03-12 10:45:20 +01:00
cc3754ae00 add position blockers 2024-03-12 10:44:25 +01:00
08082faed3 moves_print() and move_sort_by_sq(): use movelist_t instead of pos_t 2024-03-12 10:42:24 +01:00
6ee4cd1642 cleanup 2024-03-11 16:12:45 +01:00
b7fdcca66d pos_check(): add adjacent kings test 2024-03-11 16:11:51 +01:00
890cb05296 add move_make_promote_capture and move_make_capture 2024-03-11 16:10:16 +01:00
301ca24783 add funcs comments and const parameters 2024-03-11 16:07:12 +01:00
d81dca6e23 add sq_line array, bb_sq_aligned3, renamed sq_manh to sq_taxi 2024-03-11 16:04:45 +01:00
87e7695873 new pos/bb funcs, legal(), better castling gen, etc. [see commit details]
- new sq_pinners
- new pseudo_is_legal() (unfinished)
- improve castling pseudo move gen

- more position and lower level bitboard helper funcs:
  - pos_{_occ,between_occ,between_count,pinners}
  - bb_{rank,file,rel_rank,_sq_aligned,_sq_between)
- rename some bitboard globals
- replace bb ranks/files enums with defines (issue with clang)
  -> Need to find a way to use enum safely
- tests:
  - add common-test.h
  - new attack-test.c
2024-03-10 10:58:14 +01:00
b351d198b8 sq_attackers() + others (see dedails). Ready for move do/undo ?
- add many "const" in func parameters
- attack.c: sq_attackers()
- move print_board_raw from position.c to to board.c
- move some fen_check() tests to pos_check()
- add REL_RANK() macro. TODO: add one more for bitboards
- fen.c: more tests for FEN validity
- position.c: add pos_checkers() and pos_check()
- tests: add common-test.h (for shared FEN positions access)
2024-03-04 21:34:29 +01:00
a499893f32 add board_print, board_print_mask 2024-03-02 07:10:23 +01:00
dc6ceb3407 Makefile cleanup 2024-02-29 10:05:44 +01:00
beaa7bfcbc movegen: start to fix early bugs (wrong masks, etc...) 2024-02-29 09:33:18 +01:00
be32bae86a strengthen FEN parsing 2024-02-29 09:31:40 +01:00