Class: ChessEngine::Rook
Instance Attribute Summary
Attributes inherited from Piece
Instance Method Summary collapse
-
#initialize(color) ⇒ Rook
constructor
A new instance of Rook.
- #moves ⇒ Object
Methods inherited from Piece
#beats_diagonally?, #beats_straight?, #inspect
Constructor Details
#initialize(color) ⇒ Rook
Returns a new instance of Rook.
88 89 90 91 |
# File 'lib/chess_engine/piece.rb', line 88 def initialize(color) super @symbol = (@color == :black) ? "\u265C" : "\u2656" end |
Instance Method Details
#moves ⇒ Object
93 94 95 |
# File 'lib/chess_engine/piece.rb', line 93 def moves [[1, 0], [0, 1], [-1, 0], [0, -1]] end |