This entry is intended to compete at least for the following awards: - best one liner (who said lines must be horizontal? Slight rule abuse: the column of backslashes does not count as a line, they're redundant. Justification: after a very early translation phase, the backslash/newline removal, the source really *is* only one line). - most surprising invariance properties - most versatile utility Why I think it is obfuscated: It's short. C is often criticized for its terseness. Therefore, one-liners must be obfuscated by definition. Where is main? What function does it call? For reasons explained below, I was explicitly *forbidden* to make any identifiers visible in the source. The program is incomprehensible and incomplete without knowledge of the compilation options. Yuck. People think they're smart and immediately jump to the conclusion "This program prints some familiar message I know from my first programming lesson." Not so. The "default" as specified in the build file does something even more useful... Try to indent that beast. FreeBSD's, Solaris' and GNU indent 1.9.1 choke and spit out something that doesn't even compile anymore. The source has the following invariance properties (i.e. will remain compilable and exhibit the same semantics). You may rot13 < prog.c Yo! That's the joker! If you find my program while having a glance at alt.sex.* (where it looks as if it's so hot to require rot13 protection) I can assure you that you can't break it by repeatedly hitting Control-R from within your news reader. Design and Implementation Remarks. I could not use any ANSI/POSIX function name in the program. Folks, I really tried. First I extracted all function declarations from all headers (on FreeBSD). Then I rot13'd them and checked whether a known name showed up in the sorted list -- nope. Main translates to znva. I thought of defining znva and have it be a twin of main where one would call the other. All attempts were either infinite recursions or more than 80 chars. Therefore, main and other function names had to be specified on the command line. Because rot13 transforms all characters, and identifiers are made up of characters and [0-9_], only underscores optionally followed by a number were left. I admit that the first cut of the program was intended (not indented) to printf "hello, world\n". [Note that only this exact string with punctuation and capitalization as given is the canonical greeting from K&R.] Thus I had to somehow dispose of the rot13'd string. Thank K&R, there was this nifty ?: ternary operator. The first condition I tried read 'A' < 66 ? (source was not rot13'd) : (source was rot13'd) Looking at it from a programmer's point of view I thought to myself "Ugly. I'm a 'C' programmer. Real programmers do it with 'C'". So 'C' < 68 was born. Looking at that from an aesthetic's point of view I thought to myself "Ugly. I'm a 'C' programmer who does not allow magic constants other than zero and one in his source." After a sharp look at rot13 properties I ended up with 'C' & 1 There! Another character squeezed out! But let's obfuscate a little more by swapping the operands 1 & 'C' which nearly reads (or rather, rhymes with) "come and see". The default version of my program is especially handy when you inadvertently typed at your shell prompt $ echo > 'hello, world > ' (which happens every day, believe me, on thousands of terminals all over the quadrant) and you want to get rid of the darn thing with the space and newline in the name. Simply run prog and it's beamed to the bit bucket. Depending on how you define _0 at compile time, my program can perform various helpful tasks, including, but not limited to * remind you of your first programming lesson (printf) * same as above but output an empty line before the next prompt (puts) * get rid of some oddly named directory (rmdir) * or make it the current working directory (chdir) * or make it the root of the file system (chroot) * run an oddly named executable (system) * control amount of virtual memory (swapon) Seven programs in 49 bytes of code. That's seven bytes per utility. Nobody can accuse me of code bloat or feeping creaturism. All of them fit the UNIX philosophy "one tool to do one thing well". Check your implementation for prototypes matching func ([const] char *), chances are you may be able to create even more utilities; I pay a six pack to the first person providing me with so many possible _0 definitions pressing the bytes/utility ratio below 1! I suggest you compile variations for any of these defines and make them available under descriptive names like 'what-did-my-first-program-say', 'nuke-that-directory-with-the-blank-and-newline-in-its-name' and 'yo!-more-memory,how-about-it?' [I hope your not on SVR3 or another system where filenames are restricted to 14 characters]. Special thanks to: ANSI, for dreaming up the \a escape that makes the rot13 of "hello, world\n" a legal string literal. The ancient Romans for inventing an alphabet with a number of letters that is not divisible by 4 (28 letters and 1&'C' would not work any longer as a rot14 test).