-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roadmap: chess.js 1.0.0 #319
Comments
The variation code will most likely come later in version 2.0.0 (I refer to it above as RAV - Recursive Annotation Variation). The PGN loading code needs to be rewritten from the ground up. It's currently a set of hand crafted rules that are a little tedious to maintain and follow. A better approach would be to include the PGN grammar and then use a parser generator to generate the parsing code. Once this is done, adding support for variations should be significantly easier. |
Hey @jhlywa, |
Just began using this repo, but this is exciting! I'll happily make some contributions once the FIX_ME branch is live. |
@coffeeDev98 I'd be interesting in creating the grammar from scratch. I think it would give us a better understanding of how the PGN parser works, and frankly, I think it would be easier than maintaining the existing regexes. |
Hi all, I just pushed the new dev branch this morning. I manually copied over all of the tests from the 0.13.2 tag and added a few extras where necessary. However, there does seems to be a discrepancy in the number of tests cases jest is running in 0.13.2 (339 test cases) and dev (237 cases). We should investigate this. |
Hey @jhlywa, |
@jhlywa, did you ever resolve the test issue? I don't see as big of a discrepancy between
|
Hi @DevAndrewGeorge. No, I haven't been able to account for the discrepancy in tests cases. I did omit a few cases that I though were redundant on the
|
Ah, good catch. The main source of your discrepancy is that the |
If there's a major version bump coming anyway, can I suggest the accessor functions that take no arguments be converted to properties? For example: fen() {
...
} Could become: get fen() {
...
} |
Edit: I'm withdrawing my original request. After some more thought, I realized that the move history should be differentiated from the position history. In my wrapper, I split this into two properties:
I think this differentiation is an example of the Fencepost Problem, where the positions represent the posts and the positions represent the panels between them. I don't know if this differentiation is helpful to anyone else, but creating it has made using my wrapper much, much simpler. |
If missing kings is considered invalid, extra kings should also be considered invalid. |
Wicked stuff! Using Chess.js in our Chess engine! Gave the package credit for move generation and game state detection on the website and the in the docs :) |
Never use all caps for abbv. / acronyms, they tend to mess with other things. |
Hi all. The latest beta has been pushed to NPM. I have one more planned code change (adding a https://github.com/jhlywa/chess.js/releases/tag/v1.0.0-beta.0 |
There's a packaging issue with the beta:
It looks like the module ships with the typescript code ( |
@SheetJSDev Doh! Thanks for the feedback. A fix tagged 1.0.0-beta.1 has been published. |
This change would be really nice, having before and after fen :) |
@qwerty084 It's been pushed to npm as 1.0.0-beta.4 |
@jhlywa "moves() should work even if there are no kings on the board." can be ticked off this list now :) |
🥺 waiting for chess 960 support #122 |
I am interested in the support for null moves and I have already made some thoughts how to implement such a feature to this package. Before I provide a pull request, have there been any thoughts on the SAN of a null move. There is no standard SAN representation for a null move. I would suggest "--" but there are others (see e.g. https://chess.stackexchange.com/questions/14072/san-for-nullmove ) |
Hi @ppeloton. The lack of a standard is why we traditionally didn't support null moves. However, with switch to the permissive SAN parser, I think it's time we add it. I think it's reasonable to start with "--" as the SAN representation of a null move. |
@jhlywa : I made a pull request with an implementation for SAN "--" and I also added a test case. I am happy to discuss any necessary changes / further enhancements. I think the implementation is quite straight forward, however when making a null move a dummy move is created (black king moves from a8 to a8). It is not really visible to a user, only if you make the chess.history({ verbose: true }) command. Maybe someone has a better idea how to implement this part. |
looking forward 960 support! |
After 13 years of pre-1.0.0 development .... it's time.
This is a working document to track planned features/changes and their statuses for version 1.0.0. Please comment if there's something you'd like to see included or changed. I appreciate and value your feedback. Check back frequently for updates.
I'll push a basic typescript implementation to dev branch to use as starting point.
Please wait for the dev branch before submitting PR's.dev branch is now active
Proposed 1.0.0 Changes
Code
null
. This will allow the library to provide more detailed error messages for common issues (e.g. bad moves, bad FEN, bad PGN). The functions that throw exceptions are listed in the API Changes section..load()
Chess()
constructorloadPgn()
move()
move()
permissive
andstrict
.load
in permissive mode (the default mode) should let the user load FEN without supplying castling rights, ep square, and move numbers (e.g. chess.load(rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w
))load
andloadPgn
should allow an option to use the strict parsermoves()
should work even if there are no kings on the board.Docs
Other
API Changes
game_over
->isGameOver
in_check
->isCheck
in_checkmate
->isCheckmate
in_draw
->isDraw
is_stalemate
->isStalemate
in_threefold_repetition
->isThreefoldRepetition
insufficient_material
->isInsufficientMaterial
load_pgn
->loadPgn
set_comment
->setComment
get_comment
->getComment
get_comments
->getComments
delete_comment
->deleteComment
delete_comments
->deleteComments
validate_fen
->validateFen
Chess
constructorload
loadPgn
move
Questions
Should acronyms be capitalized in function names (e.g.Decided not to capitalize acronyns.loadPgn
vsloadPGN
)? Consider the impact this could have on the.fen()
and.pgn()
functions. I'm leaning towards no, but it's up for discussion.Future Changes beyond 1.0.0
Issues for First Time Contributors
ascii()
functionThe text was updated successfully, but these errors were encountered: