2026-10-18 01:54:06 +03:00
|
|
|
//! Chess model, game tree and PGN import/export.
|
|
|
|
|
//!
|
|
|
|
|
//! No UI dependencies. See `docs/dev/chess-core.md` for the API overview and
|
|
|
|
|
//! the compatibility policy for real-world PGN.
|
|
|
|
|
|
|
|
|
|
pub mod comment;
|
|
|
|
|
pub mod database;
|
|
|
|
|
pub mod diagnostic;
|
|
|
|
|
pub mod edit;
|
|
|
|
|
pub mod encoding;
|
|
|
|
|
pub mod game;
|
|
|
|
|
pub mod nag;
|
Paste a line, play on from here, learn the opening
Paste a line from the clipboard (Ctrl+V on a game, the move menu, ☰):
chess-core paste.rs plans where the text fits without touching the game — a
PGN game where its moves part from this one along any branch, or where one of
its positions occurs (another move order, noted); a fragment (SAN, numbered
or not, «…» for black, UCI) after the selected move, instead of it, or at its
move number — and grafts the new moves with their comments, symbols and
variations (the pasted game's alternatives along the way too) as one undo
step, the players' names after the line. A game with no position in common
is refused with a message; a line going elsewhere than the selected move is
asked about; an impossible move inserts nothing.
Play on from here (the move menu, Ctrl+G on a game, ☰): the play dialog shows
the position on a small board and the game it comes from; the new game holds
the moves up to it (Maia sees the history, repetitions count), dimmed during
play, with a comment saying where it comes from; take-backs, abort and resign
count only the new moves; the source game waits under it («⬅ Back to the
game»); the side to move plays by default, a rematch keeps the colour.
Learn the opening up to this move (the move menu, ☰): a training screen over
the game; the user plays both sides; a wrong move is counted, shown for
400 ms in red with a short sound and taken back; from the third mistake on a
move «Show the move» puts an arrow (the run marked with a hint); at the end
the mistakes by move, the line's runs (last, best, clean in a row, recent),
«Again» (Enter). Runs are kept in training.json by the line (start position
and moves), shared between games; an entry or a file that does not read is
kept aside, not lost. New sounds Wrong (Kenney, CC0) and Success (Lichess
Victory, Kenney).
Keys of the game do nothing under a modal question or dialog. Dev hooks
CP_PASTE_LINE, CP_PLAY_FROM, CP_TRAIN, CP_TRAIN_MOVES, CP_TRAIN_KEEP,
CP_TRAINING_FILE. Texts in nine languages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 14:51:09 +03:00
|
|
|
pub mod paste;
|
2026-10-18 01:54:06 +03:00
|
|
|
pub mod pgn;
|
|
|
|
|
pub mod repair;
|
|
|
|
|
pub mod start;
|
|
|
|
|
|
User comments: an editor in the notation, symbols, arrows on the board
Enter on a move (the move's menu, a double click on a comment, the ☰ menu) opens
the editor where the comment stands: after any move, in a variation too (the
flow is cut at the move), or at the start of the game; Enter — done, Esc —
cancel, Shift+Enter — a paragraph; another move writes the draft; one edit —
one undo step. Symbols of the move (! ? !! ?? !? ?!, Ctrl+1…6) and of the
position in the editor and in the menu. The right mouse button draws arrows
and circles on the board ([%cal]/[%csl] of the current move; colours by
modifiers). Existing comments are edited and deleted; their commands and
untouched bytes are kept. chess_core: with_text, with_shapes, shapes,
Game::set_comments_before. Dev hooks CP_COMMENT_EDIT, CP_TYPE, CP_SHAPE.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 02:35:54 +03:00
|
|
|
pub use comment::{
|
|
|
|
|
Annotation, CommentPart, ShapeColor, comment_display_text, parse_comment, shapes, with_shapes,
|
|
|
|
|
with_text,
|
|
|
|
|
};
|
2026-10-18 01:54:06 +03:00
|
|
|
pub use database::{OpenError, PgnDatabase, SourceFingerprint};
|
|
|
|
|
pub use diagnostic::{Diagnostic, DiagnosticCode, Severity, SourceLocation};
|
|
|
|
|
pub use edit::{EditError, EditOutcome};
|
|
|
|
|
pub use encoding::{Confidence, EncodingGuess, TextEncoding, detect_encoding};
|
|
|
|
|
pub use game::{EngineHistory, Game, GameMove, GameResult, HistoryKind, MoveKind, Node, NodeId};
|
|
|
|
|
pub use nag::Nag;
|
|
|
|
|
pub use pgn::{
|
|
|
|
|
Cancelled, EntryFlags, GameEntry, ParseOptions, ParsedGame, ScanProgress, WriteOptions,
|
|
|
|
|
parse_game, parse_str, scan_games, write_game,
|
|
|
|
|
};
|
|
|
|
|
pub use repair::{LetterRepairCounts, LetterRepairDetection};
|
|
|
|
|
pub use start::{FenError, FenRepair, StartPosition};
|
|
|
|
|
|
|
|
|
|
/// Re-export of the rules library used in the public API.
|
|
|
|
|
pub use shakmaty;
|