Class: Knight
- Inherits:
-
SteppingPiece
- Object
- Piece
- SteppingPiece
- Knight
- Defined in:
- lib/pieces/knight.rb
Instance Attribute Summary
Attributes inherited from Piece
Instance Method Summary collapse
Methods inherited from SteppingPiece
Methods inherited from Piece
#dup, #in_range_of_enemy?, #initialize, #move_into_check?, #sum_positions, #valid_moves
Constructor Details
This class inherits a constructor from Piece
Instance Method Details
#move_diffs ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pieces/knight.rb', line 9 def move_diffs [ [1, 2], [2, 1], [-1, 2], [2, -1], [-1, -2], [-2, -1], [-2, 1], [1, -2] ] end |
#symbol ⇒ Object
5 6 7 |
# File 'lib/pieces/knight.rb', line 5 def symbol '♞' end |
#value ⇒ Object
22 23 24 |
# File 'lib/pieces/knight.rb', line 22 def value 3 end |