lib/codebreaker/player.rb in Codebreaker_RG2016-0.1.4 vs lib/codebreaker/player.rb in Codebreaker_RG2016-0.1.5
- old
+ new
@@ -11,16 +11,16 @@
print 'Type your secret code or "hint": '
@player_code = input_code
end
def agree?
- input =~ /^yes|y/i ? true : false
+ input =~ /^(yes|y)$/i ? true : false
end
private
def input
- gets.chomp
+ STDIN.gets.chomp
end
def input_name
print 'Please, enter your name: '
input