Email address obfuscation in effect -- please
click here to turn it off.
[Date Prev][
Date Next][Thread Prev][
Thread Next][
Date Index][
Thread Index]
OK, just bragging that my 13-year-old son can write a little ruby script
now. He wrote the code entirely on his own but I changed the indenting to
make it easier to read. It won't win any prizes, but it works as intended
and it is kinda funny. I like the prediction that "You will meet a
strange man in a small allyway who will sell you a turban for an inflated
price. If you accept, you will recieve a 42" flatscreen plasma tv!" That
Chris Pine tutorial...
http://pine.fm/LearnToProgram/
...definitely works. --Mike
--------------------------------------------------------------------------
def m
'That\'ll be 5 dollars.'
end
puts 'I am a fortune teller, if you answer my question I will tell you your future! What is your favorite color?'
color = gets.chomp.downcase
if color == 'blue'
puts 'You will meet a strange man in a small allyway who will sell you a turban for an inflated price. If you accept, you will recieve a 42" flatscreen plasma tv!'
puts m
else if color == 'red' or color == 'pink'
puts 'That stain on your carpet isn\'t apple juice!'
puts m
else if color == 'yellow'
puts 'Oh my! I have some wonderful news! I\'m going to save a lot of money on car insurance!'
puts m
else if (color == 'purple' or color == 'violet')
puts 'You will return home to discover a large rodent making a nest in your bathtub.'
puts m
else if color == 'orange'
puts 'You will be eaten alive by a small otter.'
puts m
else if color == 'green'
puts 'While driving down the road, you will see a cow doing a tap dance.'
puts m
else if color == 'turqoise'
puts 'You will awaken from a drunken haze to find yourself working a temp job playing the piano at a jewelry and fine penguine skin store.'
puts m
else
puts 'That\'s the dumbest favorite color I\'ve ever heard!'
end
end
end
end
end
end
end
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members