Class: ChessEngine::Elephant
Instance Attribute Summary
Attributes inherited from Piece
Instance Method Summary collapse
-
#initialize(color) ⇒ Elephant
constructor
A new instance of Elephant.
- #moves ⇒ Object
Methods inherited from Piece
#beats_diagonally?, #beats_straight?, #inspect
Constructor Details
#initialize(color) ⇒ Elephant
Returns a new instance of Elephant.
31 32 33 34 |
# File 'lib/chess_engine/piece.rb', line 31 def initialize(color) super @symbol = (@color == :black) ? "\u25B2" : "\u25B3" end |
Instance Method Details
#moves ⇒ Object
36 37 38 |
# File 'lib/chess_engine/piece.rb', line 36 def moves [[1, 1], [1, -1], [-1, 1], [-1, -1]] end |