diff --git a/92_Trap/ruby/trap.rb b/92_Trap/ruby/trap.rb index ca1f8349..b00c4253 100644 --- a/92_Trap/ruby/trap.rb +++ b/92_Trap/ruby/trap.rb @@ -20,6 +20,12 @@ def main end end +def yes?(prompt) + print "\n#{prompt} " + answer = gets + return answer.downcase.start_with?("y") +end + def print_banner_and_instructions banner = "Creative Computing -- Morristown, New Jersey" @@ -89,10 +95,4 @@ def get_guesses(prompt) end end -def yes?(prompt) - print "\n#{prompt} " - answer = gets - return answer.downcase.start_with?("y") -end - main