Class: RGnuchess::Board
- Inherits:
-
Object
- Object
- RGnuchess::Board
- Defined in:
- lib/rgnuchess.rb
Overview
Board represents a chessboard state (just the pieces, not the castling opportunities or en passant capture opportunities).
Defined Under Namespace
Classes: Piece
Class Method Summary collapse
-
.parse(lines) ⇒ Object
Parse a board from Gnuchess.
Instance Method Summary collapse
-
#initialize(board = nil) ⇒ Board
constructor
A new instance of Board.
- #to_s ⇒ Object
Constructor Details
Class Method Details
Instance Method Details
#to_s ⇒ Object
103 104 105 106 107 |
# File 'lib/rgnuchess.rb', line 103 def to_s @board.map do |row| row.map{|p| p.to_s}.join(" ") end.join("\n") end |