243 Commits

Author SHA1 Message Date
Paolo Di Lorenzo 44ef7a1aa9 Release version 0.17.0 (#72) 0.17.0 2025-11-12 18:33:45 -05:00
Paolo Di Lorenzo 022086aa94 Codable conformance (#71)
Enabled `Codable` conformance for all public types (except `Board`).
This allows objects derived from `ChessKit` to be encoded/decoded for
storage or network transmission.

#### `Board` conformance to Codable
`Board` conformance will be enabled once `BoardDelegate` is removed
completely. Until then, `Board.position` and `Board.state` can be
encoded/decoded instead as a reasonable proxy.

> [!note]
Using `position`/`state` alone will lack the position count information
used to calculate threefold repetition.
2025-11-12 18:28:41 -05:00
Paolo Di Lorenzo 37507c8f47 Add missing items from 0.16.0 changelog 0.16.0 2025-09-15 18:52:09 -04:00
Paolo Di Lorenzo 7f0a9ecb31 Release version 0.16.0 (#70) 2025-09-15 18:47:18 -04:00
Paolo Di Lorenzo a4b15bcade Prepare for 0.16.0 release 2025-09-15 18:44:32 -04:00
Paolo Di Lorenzo bbd65274e9 Replace BoardDelegate with Board.State (#69)
* `BoardDelegate` has been deprecated and will be removed in the future
(most likely in version 1.0)
* `state` property of type `Board.State` has been added to `Board`
* After making a move on `Board`, the `state` property is updated with
an information of note, i.e. checks, checkmates, draw conditions, and
promotions
2025-08-12 22:03:42 -04:00
Paolo Di Lorenzo 27f8fdbd1e Improve appearance of board state example in readme 2025-08-12 22:02:14 -04:00
Paolo Di Lorenzo 276d7ace48 Fix Board.update(position:) documentation 2025-08-12 21:35:13 -04:00
Paolo Di Lorenzo 8abcc5962c Remove unnecessary pgn conversion in game tests 2025-08-12 21:17:14 -04:00
Paolo Di Lorenzo 502ae5a814 Add board state to readme 2025-08-12 21:04:28 -04:00
Paolo Di Lorenzo dbff1474c4 Replace board delegate with state property and update documentation 2025-08-12 20:45:57 -04:00
Paolo Di Lorenzo f56e22a5c8 Fix result PGN parsing and disambiguation SAN parsing (#68) 2025-06-29 21:27:47 -04:00
Amir Zucker 22e510180e parsers_bug_fixes - restored sample pgn castling to use Os instead of zeros 2025-06-26 16:24:44 +03:00
Amir Zucker b2a4fb656f parsers_bug_fixes - moves resulting in a check or checkmate fails regex test and are not disambiguated. 2025-06-26 15:34:45 +03:00
Amir Zucker 9532ca1445 parsers_bug_fixes - added '½' as a supported result token character. 2025-06-26 15:33:41 +03:00
Amir Zucker 2244194eff parsers_bug_fixes - fixed a bug where a decisive game result is tokenized as a number 2025-06-26 15:32:47 +03:00
Paolo Di Lorenzo b17a60dab8 Add vhs-based cli demo gif 2025-06-23 22:00:19 -04:00
Paolo Di Lorenzo 2c5620ff9c Release version 0.15.0 (#67) 0.15.0 2025-06-19 17:40:37 -04:00
Paolo Di Lorenzo d94e0ca174 Prepare for 0.15.0 release 2025-06-19 17:37:51 -04:00
Paolo Di Lorenzo 3131db260d Add chesskit-cli command line interface (#66)
* Added command line interface for testing and exploring ChessKit
features.
* Allows user to manipulate `Board` object by making moves and viewing
the output.
* Uses `FENParser` and `SANParser` to parse inputs.
2025-06-19 17:35:01 -04:00
Paolo Di Lorenzo 20c229959f Update changelog with chesskit-cli changes 2025-06-19 17:31:50 -04:00
Paolo Di Lorenzo b234400614 Improve cli code formatting 2025-06-19 17:28:47 -04:00
Paolo Di Lorenzo 3d04722d4f Fix chesskit-cli gif in readme 2025-06-19 17:17:44 -04:00
Paolo Di Lorenzo 851083620a Add chesskit-cli to readme 2025-06-19 17:13:35 -04:00
Paolo Di Lorenzo 07da2f9a0a Implement basic command line interface 2025-06-19 16:05:14 -04:00
Paolo Di Lorenzo ee7dd77ef2 Reformat to improve code coverage 2025-06-08 21:04:09 -04:00
Paolo Di Lorenzo 46d4dc4512 Rewrite PGNParser (#64)
* Rewrite `PGNParser` completely to be more accurate, efficient, and
informative.
* Add `Position.Assessment` for positional assessments.
* Legacy `PGNParser.parse(game:startingWith:)` function has been
deprecated but remains available currently.
* Fix several minor issues related to move assessments and tag parsing
(even in the legacy parser).

### `PGNParser`
The new PGN parser has been rewritten from the bottom up to conform to
the [Standard: Portable Game Notation Specification and Implementation
Guide](https://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm)
(both import and export formats). PGN's are split into tag pair and
movetext sections and each is parsed separately.

Both sub-parsers (`PGNParser.TagParser` and `PGNParser.MoveTextParser`)
use an iterative multi-pass approach. The first pass (lexer) separates
out each token in the string and the second pass (parser) converts the
tokens to meaningful `ChessKit` objects (e.g. `Move`, `Game`,
`Move.Assessment`, etc.).

The PGN parser suite now throws typed `PGNParser.Error` errors whenever
an issue is encountered to explain why the parsing failed.
2025-06-08 20:26:23 -04:00
Paolo Di Lorenzo 6f7f9d55e3 Fix name for pgn parser performance test 2025-06-08 18:41:16 -04:00
Paolo Di Lorenzo 63b0ce7d6c Add move tests for custom string convertible conformance 2025-06-08 18:37:23 -04:00
Paolo Di Lorenzo c2b52414f1 Clean up divider mark comments 2025-06-08 18:37:05 -04:00
Paolo Di Lorenzo 76248bf8ab Add custom string convertible conformance to Game and Move 2025-06-08 18:10:39 -04:00
Paolo Di Lorenzo cbc4c7ba81 Add null to move assessment notation initializer 2025-06-08 17:17:52 -04:00
Paolo Di Lorenzo 5b17fe284a Improve various minor areas of code and test coverage 2025-06-08 16:41:25 -04:00
Paolo Di Lorenzo da6d2b96a2 Improve concurrency safety in Attacks and improve documentation 2025-06-08 12:53:03 -04:00
Paolo Di Lorenzo 3973834fa4 Add Game.Tags.all and improve PGNParser formatting 2025-06-08 11:51:11 -04:00
Paolo Di Lorenzo cb271f01db Reorganize pgn parser function layout 2025-06-08 00:21:54 -04:00
Paolo Di Lorenzo 3fc6ad4ac5 Add complete test coverage of new PGNParser 2025-06-08 00:07:11 -04:00
Paolo Di Lorenzo 1a17248326 Add positional assessments 2025-06-07 22:45:23 -04:00
Paolo Di Lorenzo aecf1d7a8e Implement updated PGNParser and update related tests
New parser uses iterative state machines with multiple passes (lexer + parser).
2025-06-07 21:19:05 -04:00
Paolo Di Lorenzo 4d29b2380d Clean up PGNParser 2025-06-06 11:36:54 -04:00
Paolo Di Lorenzo d439d8c74e Fix en passant parsing in SANParser (#63)
* Fixed en passant parsing in SANParser
* Deprecated `enPassantIsPossible` parameter in `Position` (now
initialized internally)
* Added `PositionTests` to handle cases that are not tested by
`BoardTests`
2025-06-05 17:03:53 -04:00
Paolo Di Lorenzo f36703719a Improve SANParser test coverage 2025-06-05 16:57:51 -04:00
Paolo Di Lorenzo bc8d22610a Remove deprecated position initializer
It was internal anyway - no breaking changes.
2025-06-04 22:02:02 -04:00
Paolo Di Lorenzo 2a78ba2c02 Fix en passant parsing in SANParser 2025-06-04 18:02:12 -04:00
Paolo Di Lorenzo ae95923899 Release version 0.14.0 (#62) 0.14.0 2025-06-03 22:51:50 -04:00
Paolo Di Lorenzo 2640a0ae6b Prepare for 0.14.0 release 2025-06-03 22:46:15 -04:00
Paolo Di Lorenzo 104cb196a8 Fix san validation when invalid san starts with valid san 2025-06-03 17:05:15 -04:00
Paolo Di Lorenzo 607634ce14 Add support for earliest os version's possible 2025-06-03 13:14:26 -04:00
Paolo Di Lorenzo 9f8552032d Migrate unit tests to Swift Testing (#61)
* Migrated all unit tests (except performance tests) from `XCTest` to
Swift Testing.
* Added `CustomStringConvertible` conformance to `Piece`, `Piece.Color`,
and `Piece.Kind`.
2025-06-03 12:48:36 -04:00
Paolo Di Lorenzo 733b60f266 Merge branch 'master' of github.com:chesskit-app/chesskit into feature/use-swift-testing 2025-06-03 12:15:39 -04:00