Class: Knight
- Inherits:
-
SteppingPiece
- Object
- Piece
- SteppingPiece
- Knight
- Defined in:
- lib/ari_chess/pieces/knight.rb
Constant Summary collapse
- DELTAS =
[ [-2, -1], [-2, 1], [-1, -2], [-1, 2], [ 1, -2], [ 1, 2], [ 2, -1], [ 2, 1] ]
Instance Attribute Summary
Attributes inherited from Piece
Instance Method Summary collapse
Methods inherited from SteppingPiece
Methods inherited from Piece
#deltas, #dup, #initialize, #move_into_check?, #moves, #next_pos, #update_piece, #valid_moves, #valid_pos?
Constructor Details
This class inherits a constructor from Piece
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/ari_chess/pieces/knight.rb', line 16 def to_s color == :W ? "\u2658" : "\u265E" end |