Commit Graph

255 Commits

Author SHA1 Message Date
Vincent Velociter 65e62ace3c Merge pull request #54 from HaonRekcef/lazy-pgn
Add lazy parsing for multi-game PGN strings + tests
2026-05-19 10:18:00 +02:00
Vincent Velociter 829538954c Make Position completely immutable by switching pockets implementation 2026-05-18 10:55:10 +02:00
Vincent Velociter 3764620bd7 Fixes 2026-05-17 15:04:25 +02:00
Vincent Velociter 767a7b1960 Fix formatting 2026-05-17 14:27:38 +02:00
Vincent Velociter 8243acdb38 Remove fast immutable collections 2026-05-17 14:16:19 +02:00
Vincent Velociter 54010e89d0 Change signature of makeLegalMoves 2026-05-16 01:22:57 +02:00
Noah a4f9f10104 Add lazy parsing for multi-game PGN strings + tests 2026-05-14 21:46:16 +02:00
tom-anders a2f3e3dcc1 fix Crazyhouse.isGameOver and isCheckmate when the only legal moves are drop moves 2026-03-21 10:24:19 +01:00
Vincent Velociter 70f62d4acf Fix lint 2026-03-03 13:02:14 +01:00
Vincent Velociter f07f3ebb79 Add the explosionSquares method to Atomic 2026-03-03 13:02:03 +01:00
tom-anders e79a901409 Horde: rename _hordeBishops to _numBishops
This is closer to what Scalachess does and makes the code more readable.
_hordeBishops() now always returns the bishops of the Horde and
_piecesBishops always returns the bishops of the pieces.
2026-02-19 10:22:44 +01:00
tom-anders 2bc2980c71 Horde: fix failing insufficient material test cases
Found this by comparing with scalachess
2026-02-19 10:22:44 +01:00
tom-anders ac3eaaffe5 Horde: require King to be black in Horde.fromSetup 2026-02-19 10:22:44 +01:00
tom-anders 8f01abdccd Horde: fix crash during insufficient material detection.
`setPieceAt` returns a new board but that was ignored here, leading to
the pawn not being removed, causing infinite recursion

add @useResult to make sure something like this does not happen again in
the future.
2026-02-19 09:23:58 +01:00
tom-anders a3b0e86030 crazyhouse: fix en passant capture not filling pockets 2026-02-03 12:06:41 +01:00
tom-anders 619142b070 crazyhouse: reset en passant square after drop-moves 2026-02-03 11:07:14 +01:00
tom-anders 36a291fc19 atomic: correctly detect en passant capture 2026-02-03 12:08:56 +01:00
Vincent Velociter 170296429e Add the current FEN info to PlayException 2025-04-04 11:27:17 +02:00
Vincent Velociter 3bb93ad3c2 Rename isChess960 to includeAlternateCastlingMoves 2025-03-31 10:28:37 +02:00
Vincent Velociter 72e6ee2912 Make Position non generic 2025-02-17 10:29:35 +01:00
Vincent Velociter ab307f5bfa Improve Position types 2025-02-10 14:50:05 +01:00
Vincent Velociter e46db9ec24 Remove unused import 2024-10-19 15:08:19 +02:00
Vincent Velociter 0d1add722b Fix castling rights parsing 2024-10-19 15:05:05 +02:00
Vincent Velociter c8c13d0d7f Merge pull request #42 from KMK-Git/pgn-fix-flagbased
Fix PGN test by differentiating single and multigame PGN parsing
2024-10-16 10:20:03 +02:00
Vincent Velociter c1516b33d0 Use an enum for PieceKind 2024-10-09 17:55:17 +02:00
Kaustubh Khavnekar 66361cc5be Fix empty line handling by presplitting multigame PGN 2024-10-07 01:15:30 -04:00
Kaustubh Khavnekar 331c24b89e Revert "Add flag to indicate whether single game or multi game pgn is being parsed, handle linebreaks accordingly"
This reverts commit db66704b0e.
2024-10-07 00:40:43 -04:00
Kaustubh Khavnekar e97e820f2d Revert "Fix comment"
This reverts commit 80f5af523b.
2024-10-07 00:40:36 -04:00
Kaustubh Khavnekar 03cc1a8a14 Fix for comment at end of line 2024-10-07 00:39:39 -04:00
Kaustubh Khavnekar 80f5af523b Fix comment 2024-10-03 00:16:28 -04:00
Kaustubh Khavnekar db66704b0e Add flag to indicate whether single game or multi game pgn is being parsed, handle linebreaks accordingly 2024-10-02 23:01:52 -04:00
Vincent Velociter d50bf0c9f9 Fix isLegal and normalizeMove
Position.isLegal was generating illegal moves from the king due to a bug
in _getCastlingSide.

Fixes #25
Closes #27
2024-08-02 12:09:23 +02:00
Vincent Velociter a9d42cbade Document legalMoves castling format
Re-introduce `makeLegalMoves` to export legal moves in a convenient
format.

Closes #33
2024-08-02 11:10:33 +02:00
Vincent Velociter 05af18077d Add more san disambiguation tests 2024-08-02 10:39:30 +02:00
Vincent Velociter 065eb4d494 Refactoring 2024-08-02 10:13:43 +02:00
Vincent Velociter 95ff91e03f Wip on removing Box 2024-08-02 09:24:20 +02:00
Vincent Velociter 949408b3f8 Refactor Errors types
Closes #40
2024-08-01 14:48:57 +02:00
Vincent Velociter 6d154d261f Tweak 2024-08-01 13:04:34 +02:00
Vincent Velociter f9b9e0e75a Remove Coord type 2024-08-01 12:35:46 +02:00
Vincent Velociter 48311c5f9a Add Square.fromCoords 2024-08-01 12:33:17 +02:00
Vincent Velociter 7adc5f9889 More refactoring: remove utils 2024-08-01 10:52:16 +02:00
Vincent Velociter 485131f6c0 Tweak API 2024-08-01 10:29:26 +02:00
Vincent Velociter 81690367cb Update Move api 2024-07-31 17:53:33 +02:00
Vincent Velociter 63f2b2bd3e Add file and rank getters to Coord 2024-07-31 12:00:06 +02:00
Vincent Velociter bbcb028131 Add the Coord extension type 2024-07-31 11:32:46 +02:00
Vincent Velociter a971758f19 Tweak offset API 2024-07-31 10:58:31 +02:00
Vincent Velociter e4e4edeb14 Add more tests 2024-07-31 10:31:17 +02:00
Vincent Velociter 470ef705f0 Use extension types for File, Rank and Square 2024-07-31 10:09:28 +02:00
Vincent Velociter 71a4c16ac2 Remove files and ranks constants 2024-07-30 16:57:51 +02:00
Vincent Velociter 9ee3f608a0 Refactor Square: use an enum 2024-07-30 16:53:33 +02:00