Class: ChessEngine::Queen
Instance Attribute Summary
Attributes inherited from Piece
Instance Method Summary collapse
-
#initialize(color) ⇒ Queen
constructor
A new instance of Queen.
- #moves ⇒ Object
Methods inherited from Piece
#beats_diagonally?, #beats_straight?, #inspect
Constructor Details
#initialize(color) ⇒ Queen
Returns a new instance of Queen.
76 77 78 79 |
# File 'lib/chess_engine/piece.rb', line 76 def initialize(color) super @symbol = (@color == :black) ? "\u265B" : "\u2655" end |
Instance Method Details
#moves ⇒ Object
81 82 83 84 |
# File 'lib/chess_engine/piece.rb', line 81 def moves [[0, 1], [0, -1], [1, 0], [-1, 0], [1, 1], [1, -1], [-1, 1], [-1, -1]] end |