- Sashité for Developers
- Specifications
- FEEN
- 1.0.0
- Examples
FEEN Examples
- Field Expression Encoding Notation (FEEN) v1.0.0
- Author: Cyril Kato
- License: Open Web Foundation Agreement 1.0
Overview
This document provides comprehensive examples of FEEN (Field Expression Encoding Notation) usage across various game types, scenarios, and configurations. These examples illustrate practical applications of the FEEN specification while remaining rule-agnostic.
Note: All examples are for illustration purposes only. FEEN does not define or assume any game-specific rules, movement patterns, or win conditions.
Quick Reference Examples
Traditional Game Starting Positions
# Chinese Xiangqi (2D: 9×10 = 90 squares, 32 pieces)
rheag^aehr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RHEAG^AEHR / X/x
# Japanese Shōgi (2D: 9×9 = 81 squares, 40 pieces)
lnsgk^gsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGK^GSNL / S/s
# Japanese Shōgi - Gote has the Jeweled King
lnsgk^'gsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGK^GSNL / S/s
# Japanese Shōgi - Sente has the Jeweled King
lnsgk^gsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGK^'GSNL / S/s
# Thai Makruk (2D: 8×8 = 64 squares, 32 pieces)
rnsmk^snr/8/pppppppp/8/8/PPPPPPPP/8/RNSK^MSNR / M/m
# Western Chess (2D: 8×8 = 64 squares, 32 pieces)
-rnbqk^bn-r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / C/c
Games After Opening Moves
# Chess after 1.e4
-rnbqk^bn-r/+p+p+p+p+p+p+p+p/8/8/4P3/8/+P+P+P+P1+P+P+P/-RNBQK^BN-R / c/C
# Chess after 1.e4 c5 (Sicilian Defense)
-rnbqk^bn-r/+p+p1+p+p+p+p+p/8/2p5/4P3/8/+P+P+P+P1+P+P+P/-RNBQK^BN-R / C/c
# Shōgi after 1.P-7f
lnsgk^gsnl/1r5b1/ppppppppp/9/9/2P6/PP1PPPPPP/1B5R1/LNSGK^GSNL / s/S
Dimensional Examples
FEEN supports boards of any dimensionality through a hierarchical separator system.
1D Boards
1D boards have no separators — just a sequence of placement tokens.
# 1D board with 8 squares, 2 pieces
k^+p4+PK^ / C/c
# 1D board with 4 squares, 4 pieces
K^QqK^ / C/c
# Minimal 1D board: 1 square, 1 piece
k^ / S/s
# Minimal 1D board: 1 square, 0 pieces (empty)
1 / G/g
2D Boards
2D boards use single slashes (/) to separate ranks.
# Standard chess starting position (8 ranks × 8 files)
-rnbqk^bn-r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / C/c
# Shōgi starting position (9 ranks × 9 files)
lnsgk^gsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGK^GSNL / S/s
# Irregular 2D board (ranks of different sizes: 3, 2, 4)
rkr/pp/PPPP / G/g
# Empty 8×8 board (64 squares, 0 pieces)
8/8/8/8/8/8/8/8 / C/c
# Empty 3×3 board (9 squares, 0 pieces)
3/3/3 / G/g
3D Boards
3D boards use double slashes (//) to separate layers, and single slashes (/) to separate ranks within each layer.
# 3D Raumschach starting position (5 layers × 5 ranks × 5 files = 125 squares)
-rnk^n-r/+p+p+p+p+p/5/5/5//buqbu/+p+p+p+p+p/5/5/5//5/5/5/5/5//5/5/5/+P+P+P+P+P/BUQBU//5/5/5/+P+P+P+P+P/-RNK^N-R / R/r
# Simple 3D board (2 layers × 2 ranks × 2 files = 8 squares)
ab/cd//AB/CD / G/g
# Empty 3D board (2 layers × 3 ranks × 3 files = 18 squares)
3/3/3//3/3/3 / G/g
4D Boards
4D boards use triple slashes (///) to separate cubes, double slashes (//) to separate layers, and single slashes (/) to separate ranks.
# 4D board (2 cubes × 2 layers × 2 ranks × 2 files = 16 squares)
ab/cd//ef/gh///AB/CD//EF/GH / G/g
Dimensional Coherence
FEEN enforces dimensional coherence: if a separator group of length N appears, each segment it separates must contain separators of length N-1.
Valid examples:
| Piece Placement | Structure | Why valid |
|---|---|---|
rkr |
1D (3 squares) | No separators needed |
rkr/PPPP |
2D (2 ranks) | / separates segments |
a/b//c/d |
3D (2 layers × 2 ranks) | // separates structures containing / |
a/b//c/d//e/f |
3D (3 layers × 2 ranks) | // separates structures containing / |
a/b//c/d///e/f//g/h |
4D | /// separates structures containing // |
Invalid examples:
| Piece Placement | Why invalid |
|---|---|
rkr//PPPP |
// used but segments lack / (skips dimension) |
a//b//c |
// used but segments lack / |
a/b///c/d |
/// used but segments lack // |
a///b |
/// used but segments lack // and / |
Cardinality Constraints
FEEN enforces cardinality constraints inherited from the Game Protocol:
- n ≥ 1: The board must have at least one square.
- p ≤ n: The number of pieces cannot exceed the number of squares.
Where:
- n = total squares (sum of empty-counts + piece tokens in Field 1)
- p = total pieces (piece tokens in Field 1 + sum of multiplicities in Field 2)
Valid Examples
| FEEN | n | p | Validity |
|---|---|---|---|
k^ / S/s |
1 | 1 | ✓ (1 ≤ 1) |
1 / G/g |
1 | 0 | ✓ (0 ≤ 1) |
8/8/8/8/8/8/8/8 / C/c |
64 | 0 | ✓ (0 ≤ 64) |
4/4/4/4 2P2p/ C/c |
16 | 4 | ✓ (4 ≤ 16) |
-rnbqk^bn-r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / C/c |
64 | 32 | ✓ (32 ≤ 64) |
Invalid Examples
| FEEN | n | p | Why invalid |
|---|---|---|---|
K^k^ 2K^/2k^ S/s |
2 | 6 | p > n (6 > 2) |
k^K^ 10k^/ S/s |
2 | 12 | p > n (12 > 2) |
Empty Board Positions
FEEN supports positions with zero pieces, useful for placement games like Go.
# Empty 19×19 Go board (361 squares, 0 pieces)
19/19/19/19/19/19/19/19/19/19/19/19/19/19/19/19/19/19/19 / G/g
# Empty 9×9 board (81 squares, 0 pieces)
9/9/9/9/9/9/9/9/9 / S/s
# Empty 8×8 board (64 squares, 0 pieces)
8/8/8/8/8/8/8/8 / C/c
# Minimal empty board (1 square, 0 pieces)
1 / G/g
Same-Style Games
Chess Positions
Opening Phase
# Ruy Lopez Opening: 1.e4 e5 2.Nf3 Nc6 3.Bb5
r1bqk^bnr/+p+p+p+p1+p+p+p/2n5/1B2p3/4P3/5N2/+P+P+P+P1+P+P+P/RNBQK^2R / c/C
# Queen's Gambit: 1.d4 d5 2.c4
-rnbqk^bn-r/+p+p+p1+p+p+p+p/8/3p4/2PP4/8/+P+P2+P+P+P+P/-RNBQK^BN-R / C/c
Cross-Style Games
Chess vs Alternative Styles
Chess vs Makruk
# Initial hybrid position (First player: Chess, Second player: Makruk)
rnsmk^snr/8/pppppppp/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / C/m
Custom Style Combinations
# Fantasy styles
abcde^fgh/hgfedcba/8/8/8/8/ABCDEFGH/HGFED^CBA / A/b
# Numeric style identifiers
xyz123xy/8y^6/8/8/8/8/6Y^8/YX321ZYX / S/t
Positions with Captured Pieces
Pieces in Hand
The second field encodes pieces located in each player’s Hand.
# Position with captures (First player has: 1 pawn; Second player has: 1 bishop)
r1bq1b1r/+p+p+p+p1k^+p+p/2n2n2/4p3/4P3/5N2/+P+P+P+P1+P+P+P/-RNBQK^2+R p/B C/c
# Shōgi position with multiple pieces in hand
ln1gk^g1nl/1r2s2b1/pppp1pppp/9/4p4/9/PPPP1PPPP/1B5R1/LNSGK^GSNL P/p S/s
# Multiple pieces of same type in hand (using multiplicity)
8/8/8/8/8/8/8/8 3P2B/3p2b C/c
Hand Attribution
The Piece Side encoded in an EPIN token is independent of the Hand’s associated Side.
# First player's hand contains a piece with Side = second (lowercase 'p')
8/8/8/3K^4/8/8/8/8 p/ C/c
# Second player's hand contains a piece with Side = first (uppercase 'P')
8/8/8/3k^4/8/8/8/8 /P c/C
This reflects the Game Protocol’s rule that captured pieces go to the Active Player’s Hand regardless of their Piece Side.
Piece State Modifiers
EPIN tokens support state modifiers (+ for enhanced, - for diminished).
# Chess with castling rights encoded via state modifiers
# Rooks with '+' indicate castling is available
-rnbqk^bn-r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / C/c
# Shōgi with promoted pieces ('+' prefix)
ln1gk^gsnl/1r5b1/p1pppp+Bpp/9/9/1p7/P1PPPPPPP/7R1/LNSGK^GSNL / S/s
Terminal Pieces
The terminal marker (^) indicates pieces critical to match continuation.
# Chess: Kings are terminal
-rnbqk^bn-r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / C/c
# Xiangqi: Generals are terminal
rheag^aehr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RHEAG^AEHR / X/x
# Multiple terminal pieces
k^4K^/8/8/8/8/8/8/q^4Q^ / C/c
Canonical Form
FEEN requires canonical form for valid strings.
Empty-Count Merging
Consecutive empty squares must be merged into a single empty-count.
# Canonical (correct)
8/8/8/8/8/8/8/8 / C/c
# Non-canonical (invalid): "4" + "4" should be "8"
# 44/44/44/44/44/44/44/44 / C/c ← INVALID
Hand Ordering
Hand items must be ordered by: multiplicity (desc), letter (asc), case (upper first), state modifier (- < + < none), terminal marker (absent < present), derivation marker (absent < present).
# Canonical ordering: 3P comes before 2B (higher count first)
8/8/8/8/8/8/8/8 3P2B/ C/c
# Canonical ordering: B before P (alphabetical), then uppercase before lowercase
8/8/8/8/8/8/8/8 BbPp/ C/c
QPI Inference Examples
These examples demonstrate how FEEN positions map to Qualified Piece Identifier (QPI) identifiers:
Simple QPI Conversion
Chess Position
Given this FEEN position:
-rnbqk^bn-r/+p+p+p1+p+p+p+p/8/8/4p3/8/+P+P+P+P1+P+P+P/-RNBQK^BN-R /P C/c
Board QPI Mappings:
-r(a8) →c:-r-R(a1) →C:-Rp(e4) →c:p
Hand QPI Mappings:
P(second player’s hand) →C:P
Summary Table
| Feature | Example | Notes |
|---|---|---|
| 1D board | k^+p4+PK^ |
No separators |
| 2D board | 8/8/8/8/8/8/8/8 |
Single / separators |
| 3D board | a/b//c/d |
// separates layers |
| 4D board | a/b//c/d///e/f//g/h |
/// separates cubes |
| Empty board | 8/8/8/8/8/8/8/8 / C/c |
p = 0 is valid |
| Pieces in hand | 8/8 3Pp/ C/c |
Multiplicity + EPIN tokens |
| State modifier | +P, -R |
Enhanced/diminished states |
| Terminal marker | k^, K^ |
Critical pieces |
| Derivation marker | k^', K^' |
Derived style |
