A
Ashley Wharton
[Note: parts of this message were removed to make it a legal post.]
Hi - sorry to bother with such a basic question, but is there a better way
to write the following: (before I move on I want to make sure I am following
best practice)
def require_number number_cur
puts number_cur
reply = gets.to_i
while reply < 100
reply = reply + 1
puts reply
end
if reply > 100
true
require_number 'Please enter a number less than 100: '
end
end
require_number 'Enter a number: '
Thanks so much!
Hi - sorry to bother with such a basic question, but is there a better way
to write the following: (before I move on I want to make sure I am following
best practice)
def require_number number_cur
puts number_cur
reply = gets.to_i
while reply < 100
reply = reply + 1
puts reply
end
if reply > 100
true
require_number 'Please enter a number less than 100: '
end
end
require_number 'Enter a number: '
Thanks so much!