lib/modules/game.rb in codebreaker_karolina-0.1.4 vs lib/modules/game.rb in codebreaker_karolina-0.1.5
- old
+ new
@@ -39,12 +39,10 @@
end
private
def valid_code?(code)
- return true if code =~ (/[1-6]{4}/)
-
- false
+ !!code[/\A[1-6]{4}\z/]
end
def generate_code
Array.new(CODE_SIZE) { rand(NUM_RANGE) }.join
end