<commit_before>module Codebreaker
  class Game
    attr_accessor :options, :current_code, :hint_code_digits, :difficulties

    def initialize
      @difficulties = Loader.load('difficulties')
      self.options = {}
      options[:secret_code] = generate_secret_code
    end

    def asign_game_options (name, difficulty)
      options[:name] = name
      options[:difficulty] = difficulty
      options[:hints] = @difficulties[difficulty][:hints]
      options[:hints_left] = options[:hints].to_i
      options[:attempts] = @difficulties[difficulty][:attempts]
      options[:attempts_left] = options[:attempts]
      self.hint_code_digits = options[:secret_code].clone
    end

    def get_hint
      return false if options[:hints_left].zero?
      options[:hints_left] -= 1
      get_hint_digit
    end

    def hints_left?
      options[:hints_left] > 0
    end

    def code_operations(current_code)
      self.current_code = current_code
      options[:attempts] -= 1
      marking_result
    end

    def win?
      self.current_code == options[:secret_code]
    end
<commit_msg>game Class redone<commit_after>module Codebreaker
  class Game
    attr_accessor :options, :current_code, :hint_code_digits, :difficulties

    def initialize
      self.difficulties = Loader.load('difficulties')
      self.options = {}
      options[:secret_code] = generate_secret_code
    end

    def asign_game_options (name, difficulty)
      options[:name] = name
      options[:difficulty] = difficulty
      options[:hints] = difficulties[difficulty][:hints]
      options[:hints_left] = options[:hints].to_i
      options[:attempts] = difficulties[difficulty][:attempts]
      options[:attempts_left] = options[:attempts]
      self.hint_code_digits = options[:secret_code].clone
    end

    def get_hint
      return false if options[:hints_left].zero?
      options[:hints_left] -= 1
      get_hint_digit
    end

    def hints_left?
      options[:hints_left] > 0
    end

    def code_operations(current_code)
      self.current_code = current_code
      options[:attempts] -= 1
      marking_result
    end

    def win?
      self.current_code == options[:secret_code]
    end

{'fraction_non_alphanumeric': 0.09807516040329972, 'fraction_numerical': 0.002749770852428964, 'mean_word_length': 3.1980769230769233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6683041', 'n_tokens_mistral': 709, 'n_tokens_neox': 660, 'n_words': 130}