class FEEN::Dumper::InHand

Overview

The pieces in hand module.

Defined in:

feen/dumper/in_hand.cr

Class Method Summary

Class Method Detail

def self.dump(piece_names) #

Serialize pieces in hand lists into a string.

@param piece_names [Array] A list of pieces in hand.

@example Dump a list of pieces in hand dump(["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"])

=> "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"

@example Dump an empty list of pieces in hand dump([])

=> "-"

@return [String] A string representing the pieces in hand.


[View source]