lib/codebreaker/game.rb in sarcasm-codebreaker-0.2.5 vs lib/codebreaker/game.rb in sarcasm-codebreaker-0.2.6
- old
+ new
@@ -1,9 +1,9 @@
module Codebreaker
class Game
- attr_reader(:max_attempts, :state, :score, :secret,
- :attempts, :secret, :hints_left, :elements_revealed,
+ attr_reader(:max_attempts, :max_hints, :settings, :state, :score,
+ :secret, :attempts, :secret, :hints_left, :elements_revealed,
:symbols_count, :symbols_range)
GAME_SETTINGS = { easy: { attempts: 10, symbols_count: 3, symbols_range: 6, hints: 3 },
medium: { attempts: 10, symbols_count: 4, symbols_range: 6, hints: 1 },
hard: { attempts: 20, symbols_count: 6, symbols_range: 6, hints: 1 },
@@ -21,10 +21,11 @@
@max_attempts = settings[:attempts]
@attempts = @max_attempts
@symbols_count = settings[:symbols_count]
@symbols_range = settings[:symbols_range]
@secret = generate_code
- @hints_left = settings[:hints]
+ @max_hints = settings[:hints]
+ @hints_left = @max_hints
@elements_revealed = []
@state = :playing
end
def restart