This blog no longer exists.
You will be redirected to something cool.

Thursday, October 28, 2010

Getting in the Groove (Embedded Variables)

Yeah, I'm still on the whole embedded variables thing, but this is SOOOOOO much easier. Today I worked on getting used to doing things this way. It'll take a bit of time to memorize, but in the meantime I created a mad lib to kind of get used to it. Enjoy!

#  Is it customary to start variable counts at one? (ie. noun1) or
#  at zero (ie. noun and the second being noun1) or how else is this
#  handled?

print( 'Enter an adjective: ' )
adjective1 = gets.chomp()
print( 'Enter a verb ending in "ed": ')
verbEd = gets.chomp()
print( 'Enter a plural noun: ')
pluralNoun1 = gets.chomp()
print( 'Enter a liquid: ')
liquid = gets.chomp()
print( 'Enter another plural noun: ')
pluralNoun2 = gets.chomp()
print( 'Enter a famous person: ')
famousPerson = gets.chomp()
print( 'Enter a place: ')
place = gets.chomp()
print( 'Enter an occupation: ')
occupation = gets.chomp()
print( 'Enter a noun: ')
noun1 = gets.chomp()
print( 'Enter a nationality (ie. American or Irish): ')
nationality = gets.chomp()
print( 'Enter a female celebrity: ')
femaleCelebrity = gets.chomp()
print( 'Enter another noun: ')
noun2 = gets.chomp()
print( 'Enter the name of a female friend: ')
femaleFriend = gets.chomp()
print( 'You\'re almost done. Enter another plural noun: ')
pluralNoun3 = gets.chomp()
print( 'Enter a number: ')
number = gets.chomp()
print( 'Enter an adjective: ')
adjective2 = gets.chomp()

puts ( 'Personal Ad:')
puts
puts ( "I enjoy long, #{adjective1} walks on the beach, getting #{verbEd} in 
the rain and serendipitous encounters with #{pluralNoun1}.
I really like piƱa coladas mixed with #{liquid}, and romantic, candle-lit
#{pluralNoun2}. I am well-read from Dr. Seuss to #{famousPerson}. I travel
frequently, especially to #{place}, when I am not busy with work. (I am a
#{occupation}.) I am looking for #{noun1} and beauty in the form of a 
#{nationality} goddess. She should have the physique of #{femaleCelebrity}
and the #{noun2} of #{femaleFriend}. I would prefer if she knew how to
cook, clean, and wash my #{pluralNoun3}. I know I’m not very attractive in
my picture, but it was taken #{number} days ago, and I have since become 
more #{adjective2}. ")

0 comments: