Module: Sashite::Pin
- Defined in:
- lib/sashite/pin.rb,
lib/sashite/pin/identifier.rb
Overview
PIN (Piece Identifier Notation) implementation for Ruby
Provides ASCII-based format for representing pieces in abstract strategy board games. PIN translates piece attributes from the Game Protocol into a compact, portable notation system.
Format: [<state>]<letter>
-
State modifier: “+” (enhanced), “-” (diminished), or none (normal)
-
Letter: A-Z (first player), a-z (second player)
Examples:
"K" - First player king (normal state)
"k" - Second player king (normal state)
"+R" - First player rook (enhanced state)
"-p" - Second player pawn (diminished state)
Defined Under Namespace
Classes: Identifier
Class Method Summary collapse
-
.identifier(type, side, state) ⇒ Pin::Identifier
Create a new identifier instance.
-
.parse(pin_string) ⇒ Pin::Identifier
Parse a PIN string into an Identifier object.
-
.valid?(pin_string) ⇒ Boolean
Check if a string is a valid PIN notation.
Class Method Details
.identifier(type, side, state) ⇒ Pin::Identifier
Create a new identifier instance
62 63 64 |
# File 'lib/sashite/pin.rb', line 62 def self.identifier(type, side, state) Identifier.new(type, side, state) end |
.parse(pin_string) ⇒ Pin::Identifier
Parse a PIN string into an Identifier object
47 48 49 |
# File 'lib/sashite/pin.rb', line 47 def self.parse(pin_string) Identifier.parse(pin_string) end |
.valid?(pin_string) ⇒ Boolean
Check if a string is a valid PIN notation
34 35 36 |
# File 'lib/sashite/pin.rb', line 34 def self.valid?(pin_string) Identifier.valid?(pin_string) end |