<commit_before>module Pentago
  class Game
    include Observable
    include Pentago::Rules

    def initialize(player1, player2, board=Board.new)
      @player1        = player1
      @player2        = player2
      @board          = board
      @player         = nil
      @winner         = nil
    end

    attr_reader :player1, :player2, :board

    def play
      while !@board.game_over?
        @player = who_plays?
        @player.play_turn(@board)

        changed
        notify_observers @player, @board
      end
      @winner = @player unless tie_game?
    end

    def turns
      return @board.moves if @board
      0
    end

    def player_at_turn
      @player
    end

    def winner
      @winner
    end

    def who_plays?
      players.next
    end

    private

    def players
      @players ||= [player1, player2].cycle
    end
  end
end
<commit_msg>removed unnecessary methods & renamed some vbles. on Pentago::Game<commit_after>module Pentago
  class Game
    include Observable
    include Pentago::Rules

    def initialize(player1, player2, board=Board.new)
      @player1        = player1
      @player2        = player2
      @board          = board
      @current_player = nil
      @winner         = nil
      @players        = nil
    end

    attr_reader :player1, :player2, :board, :current_player, :winner

    def play
      while !game_over?
        @current_player = players.next
        @current_player.play_turn(@board)

        changed
        notify_observers @current_player, @board
      end
      @winner = @current_player unless tie_game?
    end

    def turns_played
      @board && @board.moves
    end

    def players
      @players ||= [player1, player2].cycle
    end
  end
end
{'fraction_non_alphanumeric': 0.07262247838616714, 'fraction_numerical': 0.012103746397694525, 'mean_word_length': 1.87893864013267, 'pattern_counts': {'":': 0, '<': 3, '<?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': '190768', 'n_tokens_mistral': 533, 'n_tokens_neox': 517, 'n_words': 141}