Sha256: 2eaa6829281e4514ef42f7b08fb7cb105d3ca13d2c656595a9b1a65fb830f53f
Contents?: true
Size: 564 Bytes
Versions: 11
Compression:
Stored size: 564 Bytes
Contents
require 'just_chess/pieces/piece' module JustChess # = Knight # # The piece that jumps over pieces 1v2h or 2v1h class Knight < Piece # All the squares that the piece can move to and/or capture. # # @param [Square] square # the origin square. # # @param [GameState] game_state # the current game state. # # @return [SquareSet] def destinations(square, game_state) game_state.squares.not_orthogonal_or_diagonal(square).at_range(square,2).unoccupied_or_occupied_by_opponent(player_number) end end end
Version data entries
11 entries across 11 versions & 1 rubygems