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

Haskell -- 138138 137 chars

As a standalone program:

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

Edit: I triedused 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 someall of the "ock"s similar to how"o'clock"s o compresses " o'clock", with no luck. Any ideas/ "rock"s / "ock"s?

Haskell -- 138 chars

As a standalone program:

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

I tried to compress some of the "ock"s similar to how o compresses " o'clock", with no luck. Any ideas?

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?

Post Undeleted by Matt Noonan
Post Deleted by Matt Noonan
Source Link
Matt Noonan
  • 1.1k
  • 8
  • 14

Haskell -- 138 chars

As a standalone program:

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

I tried to compress some of the "ock"s similar to how o compresses " o'clock", with no luck. Any ideas?