<commit_before>require "./piece"

module Chess
  class SlidingPiece < Piece
    # queen, rook, bishop
  end


  class Queen < SlidingPiece
    def to_s
      (color == :white) ? "\u2655" : "\u265B"
    end
  end

  class Rook < SlidingPiece
    def to_s
      (color == :white) ? "\u2656" : "\u265C"
    end
  end

  class Bishop < SlidingPiece
    def to_s
      (color == :white) ? "\u2657" : "\u265D"
    end
  end
end<commit_msg>Add offsets for sliding movements<commit_after>require "./piece"

module Chess
  class SlidingPiece < Piece
    def moves
      offsets = move_offsets
    end
  end


  class Queen < SlidingPiece
    def to_s
      (color == :white) ? "\u2655" : "\u265B"
    end


    private

    def move_offsets
      # clockwise from midnight
      [[0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1], [-1, 0], [-1, 1]]
    end
  end


  class Rook < SlidingPiece
    def to_s
      (color == :white) ? "\u2656" : "\u265C"
    end


    private

    def move_offsets
      # clockwise from midnight
      [[0, 1], [1, 0], [0, -1], [-1, 0]]
    end
  end


  class Bishop < SlidingPiece
    def to_s
      (color == :white) ? "\u2657" : "\u265D"
    end


    private

    def move_offsets
      # clockwise from midnight
      [[1, 1], [1, -1], [-1, -1], [-1, 1]]
    end
  end
end
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.05683563748079877, 'mean_word_length': 2.0023041474654377, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2435884', 'n_tokens_mistral': 549, 'n_tokens_neox': 492, 'n_words': 148}