module FEEN::Parser

Overview

The parser module.

Defined in:

feen/parser.cr
feen/parser/in_hand.cr
feen/parser/shape.cr
feen/parser/square.cr
feen/parser/turn.cr

Class Method Summary

Class Method Detail

def self.call(feen) #

Parse a FEEN string into position params.

@param feen [String] The FEEN string representing a position.

@example Parse a classic Tsume Shogi problem call("3,s,k,s,3/9/4,+P,4/9/7,+B,1/9/9/9/9 0 S,b,g,g,g,g,n,n,n,n,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,r,r,s")

=> {

"in_hand": ["S", "b", "g", "g", "g", "g", "n", "n", "n", "n", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "p", "r", "r", "s"],

"shape": [9, 9],

"side_id": 0,

"square": {

3 => "s",

4 => "k",

5 => "s",

22 => "+P",

43 => "+B"

}

@return [Hash] The position params representing the position.


[View source]