Module: Sashite::Pnn
- Defined in:
- lib/sashite/pnn.rb,
lib/sashite/pnn/name.rb
Overview
PNN (Piece Name Notation) implementation for Ruby
Provides a formal naming system for identifying pieces in abstract strategy board games. PNN uses canonical, human-readable ASCII names with optional state modifiers and case encoding for player assignment. It supports unlimited unique piece identifiers with consistent, rule-agnostic semantics.
Format: [<state-modifier>]<case-consistent-name>
Examples:
"KING" - First player king (normal state)
"queen" - Second player queen (normal state)
"+ROOK" - First player rook (enhanced state)
"-pawn" - Second player pawn (diminished state)
"BISHOP" - First player bishop (normal state)
Defined Under Namespace
Classes: Name
Class Method Summary collapse
-
.name(value) ⇒ Pnn::Name
Create a new Name instance directly.
-
.parse(pnn_string) ⇒ Pnn::Name
Parse a PNN string into a Name object.
-
.valid?(pnn_string) ⇒ Boolean
Check if a string is valid PNN notation.
Class Method Details
.name(value) ⇒ Pnn::Name
Create a new Name instance directly
62 63 64 |
# File 'lib/sashite/pnn.rb', line 62 def self.name(value) Name.new(value) end |