C
Charlie Ca
Hello World,
I am new to programming and am writing a program in ruby that serves as
a tutorial for absolute beginners. It's heavily reliant on if & else. I
was wondering if there is a method for exiting a program. Here is the
Context;
puts ' If you would like to begin, press enter.'
confirm1 = gets.chomp
if confirm1 == ''
puts 'OK, Lets begin!'
else
puts 'Try pressing enter this time.'
gets.chomp
if gets.chomp == ''
puts 'Press enter twice'
else
puts 'Next time press enter ;( '
end
end
puts ' If you are reading this you have already downloaded'
puts ' the interactive ruby console with the' #...
When they don't press enter the 2nd time, I would like to exit the
program. Thanks, Charlie
I am new to programming and am writing a program in ruby that serves as
a tutorial for absolute beginners. It's heavily reliant on if & else. I
was wondering if there is a method for exiting a program. Here is the
Context;
puts ' If you would like to begin, press enter.'
confirm1 = gets.chomp
if confirm1 == ''
puts 'OK, Lets begin!'
else
puts 'Try pressing enter this time.'
gets.chomp
if gets.chomp == ''
puts 'Press enter twice'
else
puts 'Next time press enter ;( '
end
end
puts ' If you are reading this you have already downloaded'
puts ' the interactive ruby console with the' #...
When they don't press enter the 2nd time, I would like to exit the
program. Thanks, Charlie