Skip to content

Instantly share code, notes, and snippets.

@igb
Created September 24, 2015 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igb/b5ae0a1bd9dcb1d7ef5f to your computer and use it in GitHub Desktop.
Save igb/b5ae0a1bd9dcb1d7ef5f to your computer and use it in GitHub Desktop.
Five Little Monkeys Jumping on the Bed
m="monkey"
l="little "
f="Five #{l}#{m}s"
s="So "<<f.downcase
t=[]
t<<"It was bedtime."
t<<"#{s} took a bath."
t<<"#{f} put on their pajamas."
t<<"#{f} brushed their teeth."
t<<"#{f} said goodnight to their mama."
for i in ["five", "four", "three","two", "one"]
t<<"#{ (i == "five") ? "Then..." : "So"} #{i} #{l}#{m}#{ (i == "one") ? "" : "s"} jumped on the bed!"
t<<"One fell off and bumped #{ i == "three" || i == "one" ? "her" : "his"} head."
t<<"The mama called the doctor. The doctor said, \"No more #{m}s jumping on the bed!\""
end
t<<"#{s} fell fast asleep."
t<<"\"Thank goodness!\" said the mama."
t<<"\"Now I can go to bed!\""
for x in t
puts x
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment