lib/game.rb in codebreaker_paratskiy-0.2.2 vs lib/game.rb in codebreaker_paratskiy-0.2.3
- old
+ new
@@ -5,12 +5,12 @@
attr_reader :stats, :secret_code_for_hint
def initialize(player_name, difficulty)
@stats = Statistic.stats
@player_name = player_name
- @difficulty_name = DIFFICULTIES.key(difficulty).to_s
- @attempts = difficulty[:attempts]
- @hints = difficulty[:hints]
+ @difficulty_name = difficulty
+ @attempts = DIFFICULTIES[difficulty.to_sym][:attempts]
+ @hints = DIFFICULTIES[difficulty.to_sym][:hints]
@db = DB
@secret_code_for_hint = []
end
def use_hint