Skip to content

Instantly share code, notes, and snippets.

@keller
Created January 28, 2012 04:27
Show Gist options
  • Save keller/1692627 to your computer and use it in GitHub Desktop.
Save keller/1692627 to your computer and use it in GitHub Desktop.
Birthday Card for Kate
sing = (lyric, song) ->
lines = (song.line(i, lyric) for i in [0...song.length])
full_song = lines.join(",\n")+"!"
alert full_song
birthday =
length: 4
line: (line, lyric) ->
lyric + if (line == 2) then " birthday, dear #{@name}" else " birthday to you"
to: (@name) ->
this
sing 'Happy', birthday.to 'Kate'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment