D
Devin Rawlek
Hi Everyone,
I don't know if this is possible as I haven't found anything on google
or in here. Is it possible to have an elsif to be looped?
$Str = gets.chomp
if $Str.to_i < 0
puts 'Sorry you cannot be that weak. Please enter a valid stat.'
elsif $Str.to_i > StartStats.to_i
puts 'You cannot give more stats than what you have available.
Please enter a valid stat.'
else puts 'Your Strength is '+($Str)
end
Is there a way to make this a loop so that if $Str.to_i < 0 it would
restart and ask for an input again? Even if the answer is the same it
would still restart?
I tried setting up a retry and redo but I couldn't get it to work.
Thank you for your time.
I don't know if this is possible as I haven't found anything on google
or in here. Is it possible to have an elsif to be looped?
$Str = gets.chomp
if $Str.to_i < 0
puts 'Sorry you cannot be that weak. Please enter a valid stat.'
elsif $Str.to_i > StartStats.to_i
puts 'You cannot give more stats than what you have available.
Please enter a valid stat.'
else puts 'Your Strength is '+($Str)
end
Is there a way to make this a loop so that if $Str.to_i < 0 it would
restart and ask for an input again? Even if the answer is the same it
would still restart?
I tried setting up a retry and redo but I couldn't get it to work.
Thank you for your time.