Last semester I took a class in operating systems. I wasn't surprised that the whole class was taught in C but the heavy use of it seemed to annoy some people of the class. When the course was over couple of those who disliked the language were raising their voices about how happy they were not having to have to program in C again. This started a small debate between students (and teachers) which ended with a reply from one of the teacher who taught the course. His answer was written in C code:
#include <stdio.h>
unsigned char output[] = {
0xe7, 0x3a, 0x1d, 0x2f, 0x01,
0x92, 0x42, 0x09, 0x48, 0x01,
0x92, 0x32, 0x09, 0x8e, 0x01,
0x92, 0x0a, 0x09, 0x48, 0x01,
0xe7, 0x73, 0xdd, 0x2f, 0x00,
};
int main() {
unsigned char* wb;
int i;
for (wb = output; *wb; wb++) {
if (*wb == 0x01) {
printf("\n");
continue;
}
for (i = 7; i >= 0; i--) {
putchar((((*wb >> i) & 1) + 0x20));
}
}
printf("\n");
return 0;
}
This prints:
!!! !!! !!! ! !!! ! ! !!!!
! ! ! ! ! ! ! ! !
! ! ! !! ! ! !! !!!
! ! ! ! ! ! ! ! !
!!! !!! !!! !!!! !!! ! ! !!!!
which is about the coolest thing I've seen anyone do in C code my entire life!!! Can anyone explain to me how this is done?
[Edit: Adjusted the indentation for clarity]