Brainfuck - 680
test it here: ideone.com/Wi9ftB
>>>++++[>+++++++++[>+++[<<<<+<+>>>>>-]<<<+<<<+<+>>>>>>-]<-]+<++++++++<+++<---------<++++++++
++++<----<++++++++++<+++[>>>+.>>>.<<<<.>>>>>>[>[<<<<<<--------.-.>>>.<<<<.>+..<.>>>.>-----.<
------------.+++++++++.+++.------------.++++++++.++++>+++++.<<<<.>.+.>>>>->>-]+<<+>-]+<[<<<<
+.>>>.<<<<.>+.<.>>>.>-----.<<.>---.+++.<.>----.++++>+++++.<<<<.>+.>>>>-]<<<<<.>>>.>-----.<<.
>---.+++.<.>----.<<<.>>>+++++++.---.<.>----.++++>+++++.<<<<<.<-]>[>>++++<<-]>>---.[-]<[>+<-]
>>++.>>-----.<+++.<.<.>++.>---.-..<------.<.>>++++.---.<++.>----.<<.>--.>+++++++.---.++++++.
-------.<+++.<.>>++++++.<++++.---.<.>--.>--------.+++.<.>----.<<.>>+++++++++.-----.-.-----.-
-.+.>[>+++<-]>-.<<<---[>>+<<--]>>--.
as i promised, here's a better version. my brain feels like.. ooh so that's where the name comes from.
explanation: (because it is unmaintainable and i don't want to forget how it works)
firstly you have to choose the best data layout for this challenge. i came up with
-4 outmost loop
-3 newline char
-2 space
-1 numbers
1 lowercase #1
2 lowercase #2
3 comma, apostrophe, period
4 condition (outmost loop < 3)
5 inner loop
6 second inner loop
We have to belive this is optimal unless there will be too many shifts (which case you have to rearrange the layout)
After that I used a 4x9x3 loop to set the starting values for newline, number, the two lowercase letter and the comma. (all the smaller ascii codes got 4x9=36 and the two lowercase letter got 4x9x3=108, then I added and substracted some to get their real value)
When the preset is done, the code enters the outmost loop that cycles 3 times. I explain it by pseudocode.
for 3 to 1 where i = numbers
print '++i, '
while inner_loop != 0 # this is true after the first loop
while second_inner_loop != 0 # and this is true after the second
print '10, 11 o'clock, 12' # prints the difference
condition = 0 # it prevents the printing below
second_inner_loop += 1
inner_loop += 1
while condition != 0
print '++i, ++i o'clock, ++i'
print ' o'clock rock,\n'
When this section is done I just have to print the last line.
But we have an uppercase W that must be produced without using too many characters.
At this point we are here:
Address Value Pointer
-4 0 <--
-3 10
-2 32
-1 50
1 99
2 111
3 44
so I put [-3] 4 times to [-1] and substract 3 to get 87 (W): >[>>++++<<-]>>---.
then erase it [-]
and move [-2] to this location [-1] so space will be close to the lowercase letters. <[>+<-]
After that it just prints the letters. lowercase #1 is for the lower part 97-107
and lowercase #2 is for the above region.
11
. Does the instruction mean you can only use the number 1 or the digit 1? \$\endgroup\$1
. I didn't specify how many times, so the fact that people have used11
is a clever loophole, and I'm all for it. \$\endgroup\$