<commit_before>require 'pry'

$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'guessr/version'
require 'guessr/init_db'

## Number Guessing Game
#* New Game
#* Existing Game

#* New Game
#* Ask them to choose player
#* Each turn, they can guess a number or quit

#* Existing Game
#* Each turn, they can guess a number or quit

module Guessr
  class Player < ActiveRecord::Base
  end

  class Game < ActiveRecord::Base
    def win?
      self.answer == self.last_guess
    end

    def play
      until self.win?
        puts "Please guess a number (or quit with 'q'): "
        result = gets.chomp
        if result == 'q'
          exit<commit_msg>Add association so a Player has many games.<commit_after>require 'pry'

$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'guessr/version'
require 'guessr/init_db'

## Number Guessing Game
#* New Game
#* Existing Game

#* New Game
#* Ask them to choose player
#* Each turn, they can guess a number or quit

#* Existing Game
#* Each turn, they can guess a number or quit

module Guessr
  class Player < ActiveRecord::Base
    has_many :games
  end

  class Game < ActiveRecord::Base
    belongs_to :player

    def win?
      self.answer == self.last_guess
    end

    def play
      until self.win?
        puts "Please guess a number (or quit with 'q'): "
        result = gets.chomp
        if result == 'q'
          exit
{'fraction_non_alphanumeric': 0.09216255442670537, 'fraction_numerical': 0.0, 'mean_word_length': 2.8954802259887007, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2301778', 'n_tokens_mistral': 446, 'n_tokens_neox': 440, 'n_words': 158}