Skip to main content
2 of 2
added 149 characters in body
Matt Noonan
  • 1.1k
  • 8
  • 14

Haskell -- 138 137 chars

As a standalone program:

r n=show n++s!!n
s=" o'clock rock,\n":c:c:" o'clock, ":s
c=", "
main=putStr$(r=<<)[1..11+1]++"We're gonna rock around the clock tonight."

Edit: I used to have a helper function o used to define s by

s=o" rock,\n":c:c:o c:s;o=(" o'clock"++)

but it turns out to cost 1 extra character. Is there any way to compress all of the "o'clock"s / "rock"s / "ock"s?

Matt Noonan
  • 1.1k
  • 8
  • 14