Method: ChessData::AtMostCount#check
- Defined in:
- lib/chess_data/position-definition.rb
#check(board) ⇒ Object
Returns true if board contains at most n of piece
101 102 103 |
# File 'lib/chess_data/position-definition.rb', line 101 def check board board.count(@piece) <= @n end |