3 ms·
I know that's totally beside the point, but I'd have coded the example like this: print """ Happy Birthday To You Happy Birthday To You
by cousin_it 17y ago
I know that's totally beside the point, but I'd have coded the example like this:
print """
Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear XXX
Happy Birthday To You
"""
- swannodette 17y agoYour solution is: print"""Happy Birthday To You\nHappy Birthday To You\nHappy Birthday Dear XXX\nHappy Birthday To You""" -> 103 chars This came up on the Clojure mailing list: (dotimes[x 4](println"Happy Birthday"({2"Dear XXX"}x"To You"))) -> 63 chars 40 less characters.
- cema 17y agoA nice trick! And can be derived directly from the "definition" of the song (that is, from the way the song is constructed). Great!