<commit_before>require "./piece"

module Chess
  class SteppingPiece < Piece
    private

    def find_moves(offsets)
      moves_array = []

      offsets.each do |x_offset, y_offset|
        new_x = position[0] + x_offset
        new_y = position[1] + y_offset

        if new_x.between?(0, 7) && new_y.between?(0, 7)
          moves_array << [new_x, new_y]
        end
      end

      moves_array
    end
  end


  class King < SteppingPiece
    def moves
      offsets     = [[0, 1],
                     [0, -1],
                     [1, 0],
                     [-1, 0],
                     [-1, -1],
                     [-1, 1],
                     [1, -1],
                     [1, 1] ]
      find_moves(offsets)
    end

    def to_s
      (color == :white) ? "\u2654" : "\u265A"
    end
  end


  class Knight < SteppingPiece
    def moves
      offsets     = [[1, 2],
                     [2, 1],
                     [2, -1],
                     [1, -2],
                     [-1, -2],
                     [-2, -1],
                     [-2, 1],
                     [-1, 2] ]
      find_moves(offsets)
    end

    def to_s
      (color == :white) ? "\u2658" : "\u265E"
    end
  end
end<commit_msg>Reformat offsets<commit_after>require "./piece"

module Chess
  class SteppingPiece < Piece
    private

    def find_moves(offsets)
      moves_array = []

      offsets.each do |x_offset, y_offset|
        new_x = position[0] + x_offset
        new_y = position[1] + y_offset

        if new_x.between?(0, 7) && new_y.between?(0, 7)
          moves_array << [new_x, new_y]
        end
      end

      moves_array
    end
  end


  class King < SteppingPiece
    def moves
      offsets = [[0, 1],
                 [0, -1],
                 [1, 0],
                 [-1, 0],
                 [-1, -1],
                 [-1, 1],
                 [1, -1],
                 [1, 1] ]
      find_moves(offsets)
    end

    def to_s
      (color == :white) ? "\u2654" : "\u265A"
    end
  end


  class Knight < SteppingPiece
    def moves
      offsets = [[1, 2],
                 [2, 1],
                 [2, -1],
                 [1, -2],
                 [-1, -2],
                 [-2, -1],
                 [-2, 1],
                 [-1, 2] ]
      find_moves(offsets)
    end

    def to_s
      (color == :white) ? "\u2658" : "\u265E"
    end
  end
end
{'fraction_non_alphanumeric': 0.13136842105263158, 'fraction_numerical': 0.043789473684210524, 'mean_word_length': 1.041237113402062, 'pattern_counts': {'":': 0, '<': 13, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1410415', 'n_tokens_mistral': 864, 'n_tokens_neox': 800, 'n_words': 198}