<commit_before>module RockPaperScissors

  class Game
    @@move_lookup = {'r' => 'rock', 'p' => 'paper', 's' => 'scissors'}

    def initialize mode="AI"
      puts "\n*********************************************"
      puts "**    Welcome to Rock, Paper, Scissors!    **"
      puts "*********************************************"
      mode = select_mode
      initialize_players(mode)

      puts "\n(Remember to begin play by entering game.play)"
    end

    def play
      loop do
        @player1.select_move
        @player2.select_move

        get_result

        break if quit?
      end
    end

    private

    def get_result
      puts "\n\n"
      if @player1.move == @player2.move
        puts "It's a draw!  Let's try again!"
        play
      elsif player1_win?
        puts "#{@player1.name} WINS with #{@@move_lookup[@player1.move].upcase} beating #{@player2.name}'s #{@@move_lookup[@player2.move].upcase}!"
      else
        puts "#{@player2.name} WINS with #{@@move_lookup[@player2.move].upcase} beating #{@player1.name}'s #{@@move_lookup[@player1.move].upcase}."
      end
    end

    def select_mode
      puts "\nType 1 for 1 player or 2 for 2 players"
      print " > "
      gets.chomp.to_i
    end

    def initialize_players(mode)<commit_msg>Fixes quit bug<commit_after>module RockPaperScissors

  class Game
    @@move_lookup = {'r' => 'rock', 'p' => 'paper', 's' => 'scissors'}

    def initialize mode="AI"
      puts "\n*********************************************"
      puts "**    Welcome to Rock, Paper, Scissors!    **"
      puts "*********************************************"
      mode = select_mode
      initialize_players(mode)

      puts "\n(Remember to begin play by entering game.play)"
    end

    def play
      loop do
        @player1.select_move
        @player2.select_move

        break if winner
      end

      play unless quit?
    end

    private

    def winner
      puts "\n\n"
      if @player1.move == @player2.move
        puts "It's a draw!  Let's try again!"
      elsif player1_win?
        puts "#{@player1.name} WINS with #{@@move_lookup[@player1.move].upcase} beating #{@player2.name}'s #{@@move_lookup[@player2.move].upcase}!"
        true
      else
        puts "#{@player2.name} WINS with #{@@move_lookup[@player2.move].upcase} beating #{@player1.name}'s #{@@move_lookup[@player1.move].upcase}."
        true
      end
    end

    def select_mode
      puts "\nType 1 for 1 player or 2 for 2 players"
      print " > "
      gets.chomp.to_i
    end

    def initialize_players(mode)
{'fraction_non_alphanumeric': 0.18988326848249026, 'fraction_numerical': 0.013229571984435798, 'mean_word_length': 2.502724795640327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '397544', 'n_tokens_mistral': 825, 'n_tokens_neox': 799, 'n_words': 208}