# Pick a random number.
rno = rand(100) + 1
print "Your magic number is ", rno, "\n"
# Perform all sort of totally uselss test on it and report the results.
if rno % 2 == 1 then
print "Ooooh, that's an odd number.\n"
print "That's an even number.\n"
if rno > 2 then
print "It's not prime, BTW.\n"
if rno > 50
print "That's more than half as big as it could be!\n"
elsif rno == 42
print "That's the ultimate magic number!!!!\n"
elsif rno < 10
print "That's pretty small, actually.\n"
print "What a boring number.\n"
if rno == 100 then print "Gosh, you've maxxed out!\n" end
This is the conventional use of the
Notice that there is no need for curly braces (
The body of the
ends with the appropriate keyword,
word is generally optional, though you need it if you
want to put start the body on the same line as the
the way the last statement does.
As in most languages (excluding Python), indenting is not required,
and is ignored by the interpreter. Of course, it is wise to
indent in a way which reflects the structure of the code.