Module: Sashite::Feen
- Defined in:
- lib/sashite/feen.rb,
lib/sashite/feen/error.rb,
lib/sashite/feen/hands.rb,
lib/sashite/feen/dumper.rb,
lib/sashite/feen/parser.rb,
lib/sashite/feen/styles.rb,
lib/sashite/feen/position.rb,
lib/sashite/feen/placement.rb,
lib/sashite/feen/dumper/style_turn.rb,
lib/sashite/feen/parser/style_turn.rb,
lib/sashite/feen/dumper/pieces_in_hand.rb,
lib/sashite/feen/parser/pieces_in_hand.rb,
lib/sashite/feen/dumper/piece_placement.rb,
lib/sashite/feen/parser/piece_placement.rb
Overview
FEEN (Forsyth–Edwards Enhanced Notation) module provides parsing and dumping functionality for board game positions.
FEEN is a universal, rule-agnostic notation for representing board game positions. It extends traditional FEN to support multiple game systems, cross-style games, multi-dimensional boards, and captured pieces.
A FEEN string consists of three space-separated fields:
-
Piece placement: Board configuration using EPIN notation
-
Pieces in hand: Captured pieces held by each player
-
Style-turn: Game styles and active player
Defined Under Namespace
Modules: Dumper, Parser Classes: Error, Hands, Placement, Position, Styles
Class Method Summary collapse
-
.dump(position) ⇒ String
Dump a Position object into its canonical FEEN string representation.
-
.parse(string) ⇒ Position
Parse a FEEN string into an immutable Position object.
Class Method Details
.dump(position) ⇒ String
Dump a Position object into its canonical FEEN string representation.
Generates a deterministic FEEN string from a position object. The same position will always produce the same canonical string, ensuring position equality can be tested via string comparison.
38 39 40 |
# File 'lib/sashite/feen.rb', line 38 def self.dump(position) Dumper.dump(position) end |
.parse(string) ⇒ Position
Parse a FEEN string into an immutable Position object.
This method parses the three FEEN fields and constructs an immutable position object with placement, hands, and styles components.
63 64 65 |
# File 'lib/sashite/feen.rb', line 63 def self.parse(string) Parser.parse(string) end |