lib/codebreaker/game.rb in codebreaker-0.1.4 vs lib/codebreaker/game.rb in codebreaker-0.1.4.1
- old
+ new
@@ -51,10 +51,10 @@
@game_status = 'loose' if @round_number >= MAX_ROUNDS
result
end
def hint
- if @hint_val.empty?
+ if @hint_val.to_s.empty?
hint_pos = Random.rand(CODE_LENGTH);
hint_pos.times {@hint_val += '*'}
@hint_val += @secret_code[hint_pos].to_s
(CODE_LENGTH - hint_pos - 1).times {@hint_val += '*'}
end
\ No newline at end of file