lib/codebreaker/game.rb in codebreaker-mikhail-0.1.3 vs lib/codebreaker/game.rb in codebreaker-mikhail-0.1.4
- old
+ new
@@ -24,9 +24,13 @@
validate_guess(input)
user.decrement_attemts
MatrixGenerator.new(input, @secret_code).call
end
+ def self.statistics
+ load_file.each.sort_by { |game| [game[:attempts], game[:used_hints], game[:used_attempts]] }
+ end
+
def hints?
(user.hints <= Constants::DIFFICULTIES[@user.difficulty][:hints]) && user.hints.positive?
end
def attempts?