diff --git a/lib/rubies/game.rb b/lib/rubies/game.rb index 0bd92f2..59e04ea 100644 --- a/lib/rubies/game.rb +++ b/lib/rubies/game.rb @@ -147,8 +147,16 @@ def check_answer(current, input, target) routine = lambda { eval(input) } output = routine.call puts "=> #{output}" - puts - output == target + # Ensure they don't just paste in the required output + trimmed_input = input.to_s.delete '\'\"' + trimmed_target = target.to_s.delete '\'\"' + if (trimmed_input != trimmed_target) + puts + output == target + else + puts + false + end rescue Exception => e eprinter(e) false