- Sashité for Developers
- Specifications
- PCN
- 1.0.0
- Examples
PCN Examples
Comprehensive examples demonstrating Portable Chess Notation v1.0.0 across various recording scenarios, per-player time control systems, and game types.
Time control lives per player. Define it in
sides.first.periodsandsides.second.periods. If a side’speriodsis omitted or an empty array, that side has no time limit.
Available Examples
Minimal Documents
Smallest valid PCN documents, from absolute minimum to basic records. Featured: Empty boards, chess starting positions, minimal metadata.
Time Control Systems
End-to-end demonstrations of PCN’s period-based time control.
Featured: Bank (moves=null), Per-move (moves=1, cap rule), Quota/Canadian (moves≥2), asymmetric handicap, and no-time cases.
Traditional Games
Standard board game recordings using PCN. Featured: Western Chess, Japanese Shōgi, Chinese Xiangqi (complete records).
Special Moves
Non-standard move mechanics using PAN.
Featured: Castling (~), en passant (~), promotion (=), drops (*), static captures (+).
Game Status
Game termination and status conditions via CGSN. Featured: Checkmate, stalemate, resignation, time limit, insufficient material, in progress.
Draw Offer Scenarios
Draw proposal and acceptance patterns using the draw_offered_by field.
Featured: Pending offers, accepted draws, proposer tracking, mutual agreements.
Cross-Style Games
Games where players use different rule systems. Featured: Chess vs Makruk, Chess vs Shōgi, asymmetric styles.
Positions Without Moves
PCN documents used for position recording rather than full games. Featured: Puzzles, endgame studies, tactical and opening positions.
Complete Game Records
Full-featured examples combining metadata, players, time control, moves, and status. Featured: Tournament games, rated matches, cross-style competitions.
Quick Reference
Basic Structure
{
"meta": { /* Optional metadata */ },
"sides": { /* Optional player info + per-player periods */ },
"setup": "/* Required FEEN position */",
"moves": [ /* Optional [PAN, seconds] tuples */ ],
"draw_offered_by": /* Optional: "first" | "second" | null */,
"status": /* Optional CGSN value */
}
Move Tuples
All moves are pairs with PAN and time spent (float ≥ 0.0):
["e2-e4", 8.0]
- Seconds are raw thinking time for that move (the increment is applied by the period rules).
Time Control (per player)
Period objects (defaults in parentheses):
"periods": [
{ "time": 300, "moves": null, "inc": 3 } // moves defaults to null (bank), inc defaults to 0
]
- Per-move cap: for
moves = 1, each move must satisfyseconds ≤ time; otherwisestatus = "time_limit". - Bank overshoot: if bank
≤ 0and a next period exists, the next period applies to the next move; if no next period and bank< 0,time_limit. - Quota reset: for
moves ≥ 2, when the quota reaches 0: transition to next period if it exists; otherwise reset the quota & budget and stay in this period.
Active Player Derivation
Let side0 be the side to move in FEEN setup; with n = moves.length:
active = (n % 2 == 0) ? side0 : opposite(side0)
Navigation Guide
- New to PCN? Start with Minimal Documents.
- Implementing time control? See Time Control Systems.
- Recording special moves? Check Special Moves.
- Understanding draw offers? Visit Draw Offer Scenarios.
- Cross-variant games? Visit Cross-Style Games.
- Need complete examples? Browse Complete Game Records.
