From c1466f516534aaceb18ba6d55699f7a650f76682 Mon Sep 17 00:00:00 2001
From: Landon Curt Noll XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1984/anonymous/index.html Author: The original version of this entry was added, by request, in order to
+show the code that was turned into the tattoo,
+as the alternate code. See below for the tattoo side-by-side with the
+code. NOTE: this version might not work on some systems like macOS. The author was too embarrassed that they could write such trash, so I
+promised to protect their identity. I will say that the author of this
+program has a well known connection with the C programming language. This program is a unique variation on the age old “hello, world!”
+program. What reads like a read may be written like a write! In 2005 someone by the name of Thomas Scovell got a tattoo of this
+entry. See his web
+page on the Internet Wayback Machine for more information on the
+tattoo. Along with the code, this is what it looks like: Some years after this entry was published we asked the author if they
+still wished to remain anonymous and they said: Yes, I want to keep my anonymity. But you can tell them that I am
+well known for my connection to the C language. The author, when told about this tattoo, said: I feel honored that my entry will be the first IOCCC winner to become
+a tattoo. It is the first entry to become a tattoo isn’t it? Landon Curt Noll, the one who told the author about the tattoo, wrote
+back: Yes, to our knowledge it is. Landon Curt Noll wrote that the author regrets not making the program
+a one-liner and not moving the This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1984/decot/index.html Author: NOTE: there is an alternate version
+which will only work if you have an old enough compiler or a compiler
+that supports The current status of this entry is: For more detailed information see 1984
+decot in bugs.md. This alternate code, the original, requires a compiler that supports
+ This program prints out a string of garbage. The judges also offer this one comment: understand remarks! Some new (in 1984) compilers disliked line 15 of the original source,
+so we changed it from: to: To see what we mean look at the original
+source file. The alternate code is the
+version that has this modification. The fixed version has instead: No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1984/laman/index.html Author: The program accepts ONE POSITIVE number. Seeing is believing, so try
+things like: This code should run you in circles. Some new compilers (in 1984) dislike lines 6 and 10 of the source, so
+we changed them from: to: I hope you have a C beautifier! No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1984/mullender/index.html Authors: NOTE: the original code will not work on any system other than VAX-11 and PDP-11 and this is why
+we encourage you to use the alt version instead. See original code below for the original
+version. The current status of this entry is: For more detailed information see 1984 mullender in bugs.md. Hit ctrl-c/intr to exit the program. The default microseconds is 190000 as this is approximately how long
+it slept in the original entry but it can be no lower than 5000 as any
+lower doesn’t work very well. This feature is so you can experiment with
+different speeds in between writes. It can be useful if your CPU is too
+fast :-) The author stated that the original version also had a delay but the
+difference is it required one to hit enter for it to print another line;
+the alt code will start over once it times out or if one hits a key. Note that the microseconds is argc and it uses BTW: is there such a thing as too fast a CPU ? :-) Actually yes for
+certain code which is probably not as uncommon as you think :-). What happens if you hit enter after it reaches the end of the line?
+Why? What happens after some time of waiting? This original code will only execute correctly if your machine is a
+VAX-11 or PDP-11. In the following
+years, 1985 on, machine dependent code was discouraged. Without question, this C program is the one of the most obfuscated C
+program that has ever been received! Like all great contest entries, it
+resulted in a change of rules for the following year. To prevent a flood
+of similar programs, the rules were changed, requesting non-machine
+specific code. This program was selected for the 1987 t-shirt collection. The C startup routine (via crt0.o) transfers control
+to a location named The first word is a PDP-11 branch
+instruction that branches to the rest of the PDP
+code. On the VAX This small program makes direct calls to the What happens if you hit enter after it writes a line of output? BTW: to this day, 2023, this remains one of my (Landon Curt Noll’s)
+all time favorite entries! In 2023 remarks were discovered from Sjoerd Mullender, one of the
+authors, and so was the program that was used by the authors to generate
+the array that he referred to. Because a.out.h,
+which gentab.c uses, is not available in all
+systems (like macOS) and more importantly because we wanted it to be as
+close to as the original as possible we used a copy of https://raw.githubusercontent.com/dspinellis/unix-history-repo/Research-Release/usr/include/a.out.h
+in the fabulous Unix
+History Repo. NOTE: it is highly unlikely that you will be able to run the output
+of These remarks, found at https://lainsystems.com/posts/exploring-mullender-dot-c/,
+were provided by Sjoerd Mullender years later. We thank the author of
+the article for the quote! For a more detailed analysis, taken from the
+book Obfuscated C and Other Mysteries, see below. We hope that this is
+okay with the author of the book. Considering that the analysis is
+entirely the authors’ comments we don’t think this will be a problem.
+Unfortunately the excerpt was PDF and it did not copy paste well. We had
+to go back and forth to type so it’s possible he made a typo though he
+also fixed some typos found in the extract. As for the other
+comments: I have never known a lot about the VAX assembly, so
+we used the C compiler to create the VAX code. We didn’t write it
+ourselves from scratch as we did with the PDP
+code. This is the reason why the VAX code is more complex,
+including the extra data after the PDP
+code. Robbert and I were students at the VU
+(Free University in Amsterdam) at the time (mathematics with CS as
+our major since there was no CS curriculum when we started). We had an
+assignment to create a pair of programs for the computer networks
+course. The programs were supposed to send data reliably from one
+program to the other over an unreliable channel. This channel was
+simulated with a pair of pipes. We decided for fun to create an obfuscated
+set of programs, only for the PDP,
+to do this, but circumventing the channel (i.e. cheating, hence the
+needed obfuscation.). Our programs worked and we handed them in. Of course, the teacher had a good laugh and then rejected our
+submission. (We knew him well, so we could get away with this.) Then the IOCCC came along. I
+don’t remember how we heard about it, but at the time there was a
+world-wide messaging network Usenet where we read a bunch of newsgroups.
+I’m sure it was announced
+there and we saw it. Since we had just recently created these obfuscated
+programs) we decided we could use the same technique for an
+obfuscated C program. We upped the ante a bit by making it
+“portable”. To add to the obfuscation),
+we used different formats for the integers in the array: some in
+decimal, some in octal, some in hexadecimal, and when the value would
+fit, some as an ASCII character. The rest is history. Since this was the first contest, we hadn’t seen any old entries, nor
+had any of the other contestants. Of course we knew about
+ When this program is compiled, the compiler places the array
+somewhere in memory, just like it places any compiled code somewhere in
+memory. Usually, the C startup code (crt0.o) calls a routine
+named When the program is run, the C startup code transfers control to the
+location On the VAX, the
+routine The PDP
+and VAX codes implement
+the same algorithm: The result is that the symbols My co-author, Robbert, and I had earlier written a similar program
+for an assignment on the PDP-11. Along
+came the first Obfuscated C Code
+Contest, and we decided that we should write a program like this,
+but make it run on two different architectures. We didn’t think long about what the program should do, so it does
+something very simple. We started with writing the PDP
+code in assembly. We both knew PDP-11 assembly so that
+was no problem. The assembly code we came up with is as follows: This is not the code we originally wrote, but it is the code that we
+ultimately used in the program. The string to be printed is shared by
+the VAX and the PDP
+code and is located between the two sections. First, the program deals with figuring out the address of the string.
+Then the program
+counter is saved in a scratch register.
+Since the program counter points at the second instruction,
+we subtract 2 from the scratch register in the second instruction. Then
+we subtract the length of the string and store the result in the
+location with label 0. This has to do with the calling sequence of system calls on the
+PDP.
+Following the We assembled this program and extracted the machine code from
+the resulting object
+file. We used this code in the VAX part. Since neither of
+us were fluent in VAX assembly, we
+wrote the VAX code in C and massaged the compiler output. The
+VAX assembly program that we came up with is as follows: The first word (after the label On the VAX, the
+program pushes
+9 (the length of the string), the address of the string and 1 (the file descriptor
+on the stack
+and calls We assembled this program, and extracted the machine code from
+the object file.
+After this we only had to convert the machine code to ASCII and write a little
+bit of C to glue everything together. We wanted to use different formats
+for each constant in the resulting array, and we wanted to choose the
+format randomly. So we wrote a program to choose an appropriate format
+at random. The program we wrote for that follows. This program actually
+also extracted the machine code from the object file. NOTE from judges: see gentab.c for a copy of
+this file that can be compiled in modern systems. As can be seen, there is a slight preference for decimal, and also a
+character format is sometimes used, but only if the data is a printable
+ASCII character. When we ran this program, we were almost completely satisfied with
+the result. The only problem we had was that the program had chosen an
+octal representation
+for the first word. Since everybody knows what a PDP-11 branch
+instruction looks like (everyone knows that the traditional magic word
+for an executable, This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1985/applin/index.html Authors: One liner programs are short but twisted. This “Hello, world!”
+version certainly takes its time saying hello. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1985/august/index.html Author: If you have the Note that An interesting use of a recursive call to If you let it, the program will continue to print a numerical
+sequence (can you guess in what base it is printed by looking at the
+code?) until you run out of memory or until they sell your computer,
+whichever comes first. If you use the primes.sh script can you
+figure out if there’s anything funny going on with the output? No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1985/lycklama/index.html Author: To see why we recommend the alternate version instead of the original
+version, see below and the Original code
+section. This alternate version, which we recommend you you try first, prior
+to the original, slows down the output so that you can see what it
+looked like back in 1985. This will be more enjoyable. It is slowed down
+by the which would set it at 700. Then, whether you use the default value or
+not, try: As explained above, because modern systems run this entry way too
+fast to fully appreciate what it does, we encourage you to first try the
+alternate version. After this, however, you might wish to try the
+original version, fixed for modern systems. Run the program, redirecting a file into it, and notice how it
+redisplays it. The program itself looks like tty noise. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1985/shapiro/index.html Author: There is alternate code which allows one to change the size of the
+maze. See Alternate code below. The code has a define If you wish to change the value you can do it like: Note that if it is not a number then obviously there will be a
+compilation error. If it’s <= 0 || >= 5000 then it is set to 39,
+the default. You might also wish to try: This script will compile the program five times with a random value
+and then prompt you in an infinite loop for values to try, exiting only
+if non-digits are in the input. Also try printing out various sized mazes and solving them with
+pencil or pen or in your head. As submitted, this program was 3 lines (2 of defines and 1 of code).
+To make news & mail happy we split the last line into seven
+lines. This program was selected for the 1987 t-shirt collection. We found this program is be simply amazeing! Run
+this program without arguments and notice the output. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1985/sicherman/index.html Author: There is another version that will be compiled in case the first
+fails. This should happen automatically. See Alternate code below for more details on
+it. The sicherman.alt.c is a slight change
+in the fixed version (fixed so it does not require
+ Although this will be built if the original fails to compile you can
+do it manually like: In this case it will be built as This program abuses the C preprocessor so much that some
+ Be sure to run this program through lint! If your lint works
+correctly, it should warn you that the argument ‘Manual’ isn’t used.
+Like the program says, what’s that mean? Run the program without arguments and enter the letters ‘a’ through
+‘m’ on a line. Now enter the letters ‘n’ through ‘z’. But to borrow a
+quote from Richard Stallman: If you think you understand what this code
+does, then you don’t, so read it again! Explain why: results in diff reporting a difference on some machines. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/applin/index.html Author: The judges were so amused by this little program that we created an
+award just for it. This program is portable to the C and Fortran 77
+compilers as well as executable by the Bourne shell! No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/august/index.html Author: The current status of this entry is: For more detailed information see 1986
+august in bugs.md. This program computes a specific mathematical value. Simply compile
+and give it an infinite amount of stack space and CPU time. Otherwise
+just be satisfied with the approximation displayed just before the core
+dump. This program will pass lint on your system assuming your lint is
+brave enough to try and parse it correctly. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/bright/index.html Author: Compile this program and give a filename as an argument. Mr. Bright exploits the C pre-processor, similar variables and
+excessive shifting to obfuscate an otherwise useful binary display
+program. This gives you a small example of what it is like to maintain
+the Bourne shell! :-} No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/hague/index.html Author: Note that you can run the program without feeding it anything and
+then type in a message and line by line it will show the right output.
+Notice also how certain characters will print a Compile this program and feed ASCII text into standard input. This
+program is known to pass lint on some systems and abort lint on
+others. This program was selected for the 1987 t-shirt collection. Think Morse code when you ponder this program. Note how the use of
+similar variables can be obfuscating! The author noted that this program
+implements the international Morse standard. Now for extra credit, what
+Morse message does the program spell out? No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/holloway/index.html Author: Believe it or not, this is the old standard “Hello, world” program
+performed in a very complex way. The judges and the author defy you to
+determine how it does it. It is a good thing that K&R didn’t use
+this version as the first C program! No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/marshall/index.html Author: NOTE: we FORCE disable the optimiser due to a funny problem with
+different compilers and systems. See below and compilers.md for details. There is an alternate version. The
+reason is a funny problem: in modern systems, depending on the platform,
+compiler and the optimiser, it would work with one compiler with the
+optimiser but it would not work with the other; and if the optimiser
+state is changed the previous problematic compiler might work but the
+other one would not. We describe this in more detail in compilers.md and we encourage you to read it for
+entertainment if nothing else. Due to the different conflicting problems
+with gcc and clang, we instead offer the problematic code as an
+alternate version whereas marshall.c has both
+the infinite loop and the complicated arg to To see if your compiler has the problems noted: Does it work in your system? That is does it not segfault, does it
+print it only once and does it not enter an infinite loop? Or more
+generally does it print the text exactly once and then exit? This program prints the name of the picture. The layout is somewhat
+pretty though it is not the usual sort of output one would expect from
+printing a program! This program was selected for the 1987 t-shirt collection. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/pawka/index.html Author: The judges found this entry to be one of hardest to read without the
+aid of No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/stein/index.html Author: NOTE: to avoid problems with news and mail, the single line was split
+into 3 lines. Join all lines into a single line to recreate the original
+file. The One some machines, a control-M control-N arg is needed to get the
+command to output cleanly: Your system may require another set of characters. In time, you will
+figure out what it does. :-) No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1986/wall/index.html Author: The original version did not have a ‘;’ character in the first line.
+This caused a number of System V C pre-preprocessors to gripe about a
+syntax error. This program is a masterpiece of obfuscation and humor. Larry Wall
+(the hacker who gave us rn and patch) asks you to
+compile and consider the warning message generated by the C compiler.
+Then execute the program and type characters into its standard input.
+You will see why the compiler documents the program. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1987/biggar/index.html Author: By changing the compile line you can make this program do anything
+you want. This is a very efficient way to transfer source, though it
+increases the size of Makefiles. With only slight variations, this program can be set to many uses.
+Consider how easy it would be to release One vendor’s lint got hung in an infinite loop over this entry! FYI: We will let Mark get away with this truly sick entry this time,
+but for the future on we have placed a limit on the size of a compile
+line. NOTE: originally we made a comment in Larry Wall’s entry regarding Mark’s
+contribution but it seems to have been lost in time. If anyone knows
+about its whereabouts we’d appreciate letting us know. Thanks! Passes BSD and UTS lint. At least one version of lint is thrown into
+an infinite loop by this entry. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1987/heckbert/index.html Author: On System V systems, we had to compile with
+ where col is the number of columns to fold at and file is the file to
+fold. Folding at the wrong length may be equivalent to a “Spindle or
+Mutilate” operation. For example: Try not to Fold,
+Spindle or Mutilate files. :-) The judges used this program to fold up No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1987/hines/index.html Author: This program was designed to maximize the bother function for
+structured programmers. This program takes We consider this to be a beautiful counter-example for Frank Rubin’s
+letter to ACM form titled: “‘GOTO
+Considered Harmful’ Considered Harmful”. See the Communications
+of the ACM, March 1987, Page 195-196. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1987/korn/index.html Author: The Judges believe that this is the best one line entry ever
+received. Compile on a UNIX system, or at least one using a C
+implementation that fakes it. Very few people are able to determine what
+this program does by visual inspection. I suggest that you stop reading
+this section right now and see if you are one of the few people who
+can. Several points are important to understand this program: What is the symbol What is the value of the symbol defines a pointer to a is legal C, what type of value is since addition is commutative. What can be said about this value? David
+Korn’s /bin/ksh provides us
+with a greatly improved version of the /bin/sh. The
+source for v7’s /bin/sh
+greatly inspired this contest. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1987/lievaart/index.html Author: To see what it would have looked like without the size
+restrictions: We believe that you too will be amazed at just how much power
+Mr. Lievaart packed into 1024 bytes! This Plays the game of Reversi (Othello)!
+Compile and run. It then asks for a playing level. Enter 0-10
+(easy-hard). It then asks for your move. A move is a number within
+11-88, or 99 to pass. Illegal moves (except for an illegal pass) are
+rejected. Then the computer does its move (or a 0 to pass), until the
+board is full. It plays rather well, for such a small program! Lievaart had to leave
+out the board printing routine, so you’ll have to take a real game board
+to play it (or see below). … Also due to space-limitations (the rules
+for 1987 had a limit of 1024 byes), Lievaart took out the
+passing-handler, which makes its ending-game rather poor. But further it
+knows all the rules, uses alpha-beta
+pruning, and it plays for instance on mobility(!). Most important:
+it can play a pretty good game of Reversi! The Author was kind enough to supply the fully functional version of
+the program. The file lievaart2.c contains
+what the program would have been without the size restriction. This
+version has the full end game logic and displays the board after each
+move! See above for how to use this. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1987/wall/index.html Author: You may of course run the commands manually and enter text as you
+wish. For instance you might try one or both of: and enter some input like: which the script does through a pipeline except that here you can
+enter more text if you wish, line by line. What we found amazing was how the flow of control was transferred
+between subroutines. Careful inspection will show that the array of
+pointers to functions named Some compilers complained about this file, so we changed:
+ No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1987/westley/index.html Author: Line by line symmetry performed better than any C beautifier. Think
+of if it as a C ink blot. :-) No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/applin/index.html Author: A smaller version, originally called As noted above a smaller version can be used in case your
+ Use Way back in 1988 .. This entry took 75 minutes to compile on a Amdahl 5980-300E (a 55658
+Dhyrstone/sec/cpu machine) using the System V Your This entry is by far the most unusual abuse of the C preprocessor
+that we have received thus far. Nearly all of the real work is done in
+the C preprocessor! When we compiled applin.c on an Amdahl
+5890-300E, we found that it spent over 75 minutes in the System V C
+preprocessor! Besides showing that the standard System V
+ The GNU C preprocessor took under 45 seconds to perform the 2nd pass
+on the Amdahl 5890-300E. But due to the ANSI-likeness of GNU
+ No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/dale/index.html Author: The current status of this entry is: For more detailed information see 1988
+dale in bugs.md. Observe that three of the commands in the script are: As the script asks what do the last two do and why do they do it? Why
+do they differ in format from the first command? Finally how can you get
+the more likely desired behaviour? This entry has a very twisted flow of control via recursion,
+iteration and multi-processing. Try to understand what is being done
+with the system calls. NOTE: This program assumes the ASCII character set is being used. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/isaak/index.html Author: There is an alternate version, the original, that can’t be compiled
+in modern systems but can be if you have an old enough compiler. See Alternate code below. The original version of this code is in isaak.alt.c. The original entry starts with the
+line: This works on some systems. Why? Note that
+ This version also relied on being able to define This version will not likely work on modern systems if you can even
+get it to compile. Use The program relies heavily on ASCII. Don’t even think of running it
+on an EBCDIC machine. NOTE: If you named the file anything other than isaak.c, you had to change the NOTE: The use of null comments to separate macros to construct
+different tokens from a single macro (e.g., NOTE: Most System V machines were not be able to execute this program
+correctly due to the fact that BSD style systems have an
+ Since this was fixed, this file is not strictly necessary. See the isaak.alt.c for the original source. FYI: We are likely to be more strict about portability in the
+future. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/litmaath/index.html Author: There is an alternate version provided. See the Alternate code section below. This alternate code, added to help understand the entry and for fun,
+is code that we suggested at the time of the entry publication but which
+we never put in a file. Use Note the unusual structure: Did you notice that the body is empty? Furthermore, it’s interesting to note that only two variables are
+used to achieve everything. The best one can do to understand how the program works is to give it
+two small strings as arguments, and follow the program closely. One
+could make the body of the … which is what the alternate code
+is. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/phillipps/index.html Author: Compile and run without parameters. The program is smaller than even the ‘compressed’ form of its output,
+and thus represents a new departure in text compression standards. The judges thought that this program looked like what you would get
+by pounding on the keys of an old typewriter at random. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/reddy/index.html Author: What happens if you input, and what you do about it? This is a somewhat restricted version of a useful program that has
+been posted to Usenet. What is unusual is what it is able to do so much
+in such little space. No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/robison/index.html Author: The first and second parameters are optional. You might also try: The following might make an interesting benchmark: [Amdahl 5890-300E with System V cc: 8.40 seconds] We suggest that you C pre-process and perhaps C-beautify this
+program. All is not what it may appear to be in this program. Why does a
+ This program shows that C has many unnecessary constructs, in fact
+only This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/spinellis/index.html Author: and follow the instructions this will give you. If your compiler will not read from Type in or copy paste some C code, perhaps from input.txt, and send EOF (typically ctrl-d). Now run again: For clang or compilers that won’t read from and follow the instructions. Type in or copy paste some C code, perhaps from input.txt, and send EOF (typically ctrl-d). Now run again: We enjoyed this entry this year; however in the future programs must
+be able to be compiled from within a Makefile without the need of human
+intervention. This program can be configured to do almost everything. The
+configuration is done during compile time by typing in C code that one
+would like the program to perform. A trivial example is given in the
+`how to compile’ section but the possibilities are clearly limited only
+by your imagination and programming skills. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1988/westley/index.html Author: NOTE: this version is a fixed version for modern C compilers. See the
+Alternate code section below for how to
+use the original and why one might wish to do so. Also try: to show the code with followed by the result so you can truly see the
+magic. This version is the original which might not work as you expect
+nowadays. To see if your compiler has the problem described in the Judges’
+remarks below, try: Does it show the same output as Your compiler must parse as This is what the modified code in westley.c
+does whereas the alt code is the original. You might enjoy looking at the output of: No remarks were provided by the author. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/fubar/index.html Author: The current status of this entry is: For more detailed information see 1989
+fubar in bugs.md. Run this with a single digit argument (or wait a long time and risk
+an infinite loop as described in the bugs.md file). The blank line at the beginning of the source is mandatory. Do you
+know why? NOTE: the file In a nutshell, this is probably the slowest and most obnoxious
+factorial program ever written. Unfortunately, the name of the C source
+must be The source is a legal shell script and a legal C program. The shell
+script compiles itself, and then executes the resulting binary, giving
+the source as input. The program works by successively modifying #define
+lines each pass through. Both This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/jar.1/index.html Author: NOTE: this will run the program itself. There is an alternate version with a slight difference that you may
+wish to try. See the Alternate code
+section below for more details. This alternate code, which prints something slightly different, is
+provided as well. NOTE: this will run the program itself. On many systems the compiler will not allow you to send the object
+file to As a last resort the Abuse of the rules winners usually result in a change of the rules.
+Starting in 1990, compiling entries must result an regular file which
+can be executed. Under certain conditions that are dependent on such diverse things
+such as: the output of raw binary to a terminal can produce various effects
+from the mildly annoying beeps to missing seeing the important output,
+to various “ill effects” such as the crashing of the terminal
+application. Instead we have opted to pipe raw binary thru the strings
+utility before writing to standard output instead of
+ As a historical note, the Makefile does echo the original command to
+standard output, the original shell command that once wrote raw binary
+to the The use of piping raw binary thru stings makes the original 1989
+output more apparent, as was the case when using dumb CRT terminals
+(some do dumb that they couldn’t even process simple ANSI escape
+sequences) were more common. This program is (supposedly) the smallest C program able to print
+“Hello world.”. The compilation itself produces the desired printout and
+the program need not be actually run. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/jar.2/index.html Authors: NOTE: this entry will likely segfault on invalid input. This is the most useful program submitted this year. It is a rather
+large subset of lisp. It has no error recovery, and performs rather
+poorly in a number of cases. Even so, placing all this functionality in
+such a small, densely packed program, is impressive enough to win the
+Best of show award. This program implements a Lisp interpreter in 1465 bytes of source.
+Some sophisticated features supported, e.g. functionals and recursion.
+The special-forms/functions/variables implemented are: Below are sample lisp expressions you might choose to try as input.
+The program implements a conventional lisp listener, i.e. you type in
+lisp expressions (followed by CR), the program evaluates them and prints
+out the return values. End execution by typing an end-of-file
+character. Please do not leave any whitespace before the first parenthesis when
+you type your input, or any other unnecessary whitespace. Please try to
+avoid any undefined variables or functions, wrong number of arguments
+etc. All these errors are likely to dump core (i.e. there are no error
+checks in the program). Traditional Lisp implementations use cons cells as the main data
+structure. Lists are organized of pointer chains of these cells. In this
+program, an alternate representation was chosen: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/ovdluhe/index.html Author: To get this to compile with a modern CPP, we had to replace
+ Run the program this way: The program stops when it reaches the end of the template buffer by
+chance or is killed. The author suggested that one varies the definition of You do not have to define NOTE: if you specify too high a value for Run this program using your favorite text file as input. Files such
+as mailboxes, man pages and usenet articles are especially recommended.
+You will get different output each time you run it. This program implements an “Eddington ape” - it generates random text
+from a supplied template. The template text file is read through stdin.
+The larger the template, the better the result. A maximum of
+ You might want to vary the definition of P between 2 and 10 and
+observe the result. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/paul/index.html Author: There is an alternate version with a trace routine that the author
+had commented out. See alternate code
+below for more details. This version was described by the author like: I could have squeezed the program under 1024 bytes without the trace
+subroutine, but I felt it was important for understanding the program.
+Besides it is fun to watch the tape zooming back and forth as the
+program runs. A much better debugger or trace could easily be added. The author’s comments is a detailed program explanation and spoiler.
+If you want a real challenge, don’t read any further and try to
+understand the program via the source. The original source contained a long line which caused many mailers
+to barf. The original file may be re-constructed by removing the
+trailing However as this is no longer a problem the trailing This programs computes and prints Fibonacci numbers by simulating a
+Turing machine with the proper program. Understanding the C program,
+i.e., a Turing machine simulator, is only the first and simplest step.
+The Turing machine program must be understood, too! (it is trivial,
+perhaps even natural to write incredibly obscure Turing programs.) If the program is invoked with an operand, the operand is used as the
+Turing program. It includes a “trace” facility, subroutine
+ The Turing machine tape is represented as a doubly linked list of
+pointers. The forward and backward links are The simulated Turing machine has a single tape with either a
+ The Turing machine has next state The previous and current Fibonacci numbers are kept in base 1 form
+with the current on the right. The first three steps set up the first
+two numbers, The program requires that the lowest bit of a pointer to be 0. I could have squeezed the program under 1024 bytes without the trace
+subroutine, but I felt it was important for understanding the program.
+Besides it is fun to watch the tape zooming back and forth as the
+program runs. A much better debugger or trace could easily be added. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/robison/index.html Author: The current status of this entry is: For more detailed information see 1989 robison in bugs.md. NOTE: This program will very likely crash or break into tiny bits :-)
+if you feed it numbers with non-binary digits. This, as you might notice
+if you try one of the above commands, can happen with other input as
+well. If you wish to understand why this happens check the source
+code. Sites with punch card facilities will be happy to note that the
+source deck can be re-collated with an ASCII sort. Note that this program uses only a small subset of the constructs
+that the C language supports. For an interesting document on APL, see https://computerhistory.org/blog/the-apl-programming-language-source-code/. This program is a handy picoAPL interpreter written in
+ prints: That is The To obtain a This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/roemer/index.html Author: Do you know what this program does? If you do, look again, there is
+more here than meets the PI. Passes lint, but not with the strictest options, for it contains some
+“null-statements”, as well two identifiers which are, if compilers only
+take 6 characters, the same. It also uses You are very much invited to pass this program through a C-beautifier
+(first strip newlines and tabs, if your This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/tromp/index.html Author: The second command, NOTE: after the game ends a file called … or so, where in this case the luser
+is the winner, the loser is in second place and the winner is the
+loser :-) The author provided an alternate version of the code with some
+improvements. See the judges’ additional remarks in the author’s
+remarks, for more details. Use NOTE: testing more than one user updating the high score file, one of
+the benefits of the alt version, has not been done. The original unmodified alternate code, which will no longer work
+right if it even compiles, is provided later in the author’s
+remarks. This is a character terminal version of the By default, Specifying As was stated last year, we are likely to be more strict about
+portability in the future. [ We mean it this time :-) ] This program plays the familiar game of outputs vt100-like escape-sequences for cursor positioning and
+normal/reverse video in curses like fashion (minimal output for screen
+updates) continuously increasing speed (except in pause) start speed selectable by giving controls also selectable by giving as the second argument a
+string of 6 characters. By default they are
+ screen is blanked during the pause and the score is
+shown maintains a high-score table Giving a full path name for the table will result in a system-wide
+high-score allowing a competition between users. The author provided us with the following notes and new version of
+the program: Here is a somewhat improved version of my tetris entry. All the
+changes are in the You may also want to consider giving just the raw option to
+ NOTE: the alternate version was fixed for modern systems in 2023. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/vanb/index.html Author: This program computes all proper subsets of the set of arguments
+passed to it. Each subset is printed with one element on each line,
+followed by a line of ten dashes. The program has the following charming and possibly non-portable
+features: It has no local or global variables, only the command-line
+parameters. It calls It alters the command-line parameters. It uses the fact that if the high bit is set in a character
+variable, the value is negative. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1989/westley/index.html Author: The current status of this entry is: For more detailed information see 1989 westley in bugs.md. Try compiling and running the 4 resulting programs like: If you need to specify an alternate compiler path, say because your
+default compiler is clang (or in the case of macOS gcc is clang) you can
+do so like: If you wish to delay the script or remove the delay you can do so
+like: Finally try: There is a secret way to get ONE of the versions to print out
+“ This is a filter. If it is run with no arguments, it copies
+ The source code will run if ROT13’ed and/or reversed, using a
+different algorithm for each version (hereafter referred to as
+ When compiling these versions, one needs to define
+ All versions use recursion to work. If the program is NOT reversing
+it’s output, it prints out the (possibly ROT13’d) character before
+recursing, otherwise it prints it out afterward (or doesn’t recurse at
+all when I can’t use any flow control. If I used which is the same as: A/UX on the Macintosh doesn’t get this right; it evaluates ALL
+expressions if they aren’t in an assignment or conditional statement.
+This might warrant a warning, since other compilers may do this. I found
+MANY compilers botched: – Normally (!), a reversible C program is done thus: If your compiler nests comments, it will get this wrong. However, I
+have made some bits of the code palindromic, (or different, but
+reversible) so it is more like: The code can therefore be interlaced. There are eight such
+palindromic bits. You can find them within the
+ The body of the code of This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/baruch/index.html Authors: There is an alternate version for those using Turbo-C or MSC. See alternate code below for details. The current status of this entry is: For more detailed information see 1990
+baruch in bugs.md. Why is there no output? This alternate code is for the very few users here who will need it. Nonetheless if
+you’re using Turbo-C or MSC, the code is available, based on the
+authors’ remarks except that the Use This program reads an integer between 4 and 99 from the
+ NOTE: The original program did not have a newline at the end of the
+file. We added a final newline to the file to make unpacking easy. The goal of this work was to write a program that solves the classic
+n-queens
+problem, with a board size of up to 99x99, while keeping the program
+as short as possible. The program finds all possibilities to place N chess queens on an NxN
+chessboard so
+that no queen is in range of any other queen (not in the same column row
+or diagonal). For each solution the chess board and the place of the
+queens is printed to stdout. This program is about as simple and as readable as possible. To make
+things even more simple we used a very limited subset of C: In short, it contains no C language that might confuse the innocent
+reader. :-) This program demonstrates the claim that in C, any program can be
+written using a single ‘for’ statement, as long as it is long
+enough. In order to compile the program under Turbo-C or MSC,
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/cmills/index.html Author: The Makefile uses several The macro The author noted that a compiler being used assumed that
+ This is a blackjack program. It does splits, doubling down,
+insurance, etc. As best I can figure, it should be ANSI-compliant, as well as
+portable to BSD & SysV (as well as the irritating compiler I was
+using which assumes The way it deals with splits is particularly cool (IMHO). You can
+split many times, and it will show all hands as they are played. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/dds/index.html Author: Give the following lines as input: NOTE: this entry is probably one of the only times CAPS LOCK might be
+worth having (though still not useful enough to enable :-) ) as all
+input has to be UPPER CASE. Be sure not to run out of fuel! This is the DDS-BASIC Interpreter (Version 1.00). ( Boolean expressions evaluate to 0 for false and 1 for true. No error checking is performed. It might dump core if a syntax or
+semantic error is encountered. ANSI C, traditional K&R C or OSF ANDF ASCII or EBCIDIC character
+set 48K bytes memory. The Speed of DDS-BASIC Interpreter (Version 1.00) relative to
+Microsoft Advanced BASIC 3.31 is approximately 60%. The code size could be further reduced by doing ugly things like not
+declaring the return type of functions, not freeing memory, defining
+define, and joining lines. In its present 1536 character form the
+program is reasonably portable (it may fail to run in a tagged object
+architecture) and nicely formatted (it fits in an This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/dg/index.html Author: Some C preprocessors got confused about single quotes in certain
+cases. In particular, the following source line: sometimes has to be changed to: particularly if the C preprocessor botches single quotes in cpp
+expansions, which we have done for the wider audience. If my preprocessor could hack it, I could write this as one single
+line rather than 4, but when I do that I get a complaint “defines nested
+too deeply”. This is another rot13 job (believe it or not) - the
+ As for the rot13 algorithm, it relies on If This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/jaw/index.html Authors: To test the official C entry, one might try: which should apply the identity transformation to a minimal
+holoalphabetic sentence. The program, in its base form, implements two useful utilities: Included with this entry is a shell script (with comments edited down
+to reduce it to 1530 bytes) which implements the complete shark utility.
+The script, shark.sh, contains a
+ The sender must have The resulting file, NOTE: a limitation is that the script should be in the parent
+directory of the directory it is run from. James A. Woods “Use an algorithm, go to jail.” – anon., circa 1988, pre-Morris worm era Myriad formats have been proposed for network-mailable data. A major
+difficulty undermining the popularity of most file/message bundlers is
+that the sender assumes prior installation of the computational dual of
+such bundling software by the receiver. Command shell archives alleviate
+this problem somewhat, but still require standardization for the
+function of data compression and mail-transparency encoding. On Unix,
+these coding format quandaries are overcome by planting a novel Trojan
+Horse in the archive header to perform negotiation-less
+decoding. Specifically, we outline the development of an extraordinarily
+compact portable bundler/extractor to (dis)assemble data-compressed,
+binary-to-ASCII-converted, length-split, and checksummed directory
+structures using standard Unix tools. Miniature versions of counterparts
+to a Lempel-Ziv coder ( In the function-theoretic sense of minimal Chaitin/Kolmogorov
+complexity, and within a modified Shannon model of communication, the
+‘shark’ effort aims to construct a “shortest program” for source
+decoding in the Turing-universal Unix environment. Oh, the shark has pretty teeth, dear– We have ported this program to a wide variety of systems. Among these
+are: We (the authors) feel this program is obfuscated for the following
+reasons: This is one of the few programs you’ll see WHOSE VERY UTILITY
+DEPENDS ON ITS OBFUSCATION! The contest entry may be used to send its wonderful self to
+anyone in the Unix world! Virus writers need not apply… The basic idea is twisted enough to be patentable, but is, out of
+the kindness of our hearts (as well as to maintain eligibility for the
+large IOCCC prize fund), dedicated to the public domain. Claude Shannon,
+meet Alan Turing. Meta-obfuscation is via obfuscated description (see
+ABSTRACT). “Literary” allusion. Production code contains a reference to
+self-reference, preserved at amazing cost for sheer perversity. Many, many micro obfuscations below, honed over three years time,
+in shell as well as C. Ask about the ‘tar’ pit escape, the
+ Construct May 1987: Karl Fox introduces 1023-byte May 21, 1987: James A. Woods extends idea to construct self
+decompressing May 23, 1987: June 2, 1987: 52 lines of shell, 1991 bytes, now made with
+ Mar-May 1988: abortive run at 5th IOCCC. Aug 29, 1988: production version, now at 1830 bytes. Jan 1990: Paul Eggert does tour-de-force shark
+re-engineering. May 24, 1990: collaboration yields 999-byte May 1990: To which we add: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/pjr/index.html Author: There is an alternate version that does
+something different that can be used if your compiler is incapable of
+compiling Note that some compilers will be unable to compile the expression
+ if this is a problem, which is what this alternate code is. NOTE: it prints something else and it is what the author suggested
+one try as well. This program prints out a string. Can you figure out how it is
+done? By use of pointers to functions returning a struct of pointers to
+functions! This program prints out the string: the quick brown fox jumped over the lazy dog It is simple to make the program print other strings. Each
+alphabetical character from a to z is printed out as its opposite: To encode a new string input the string as it is meant to come
+out: Note: By the way, there is actually a piece of code which is not used in
+the original program! I leave it as an intellectual exercise to the
+reader to find out what it is. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/scjones/index.html Author: The addition of trigraphs has made it easier to make programs hard to
+read. It was a dark and stormy night for C when the ANSI C committee
+added trigraphs to the standard. Too bad that they didn’t just simply
+require a more reasonable ISO character set. The Author sent us this note after he was informed that he won: Although I am quite grateful for the “ANSI Committee’s Worst Abuse of
+C” title (were you aware that I am a member of the committee or is the
+double meaning unintentional?), I was really hoping for something more
+along the lines of “Closest Resemblance to Line Noise.” :-) … it was unintentional. Since this year’s contest is dedicated to ANSI C, here is a strictly
+conforming entry. In accordance with the ANSI definition of a strictly
+conforming program it does not produce output dependent on any
+unspecified, undefined, or implementation defined behavior, and it does
+not exceed any of the minimum implementation limits. It adheres to all
+of the syntactic and semantic constraints of the standard: it
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/stig/index.html Author: NOTE: that’s not a typo or mistake but one can also do: We changed the alias that the author’s suggested alias from a C-shell
+alias to a Bourne-like shell alias. Note that WARNING: This program’s If you like shell programming you may also admire my creative
+quoting. (I use The program is totally portable, but the compile commands are very
+shell specific so don’t be TOO mad at me if they don’t work for you. If you want to put these commands in a Makefile you must add 4 - four
+- backslashes at the end on first line. (At least that’s what works
+here.) If everything works correctly it create an executable named
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/tbr/index.html Authors: The authors provided another version of this program. See the alternate version section below. The current status of this entry is: For more detailed information see 1990
+tbr in bugs.md. In 2023 it was noticed that in some systems like macOS there was
+confusing output due to a warning at runtime that was interspersed with
+the output of the program. For instance it would show: which kind of hid the prompt. Thus the entry was changed to use
+ Also NOTE: globs do not work with this entry. Why? NOTE: What happens if you try using The authors include a section called BUGS that,
+because they were documented, are not considered bugs as such in the
+context of the contest. The authors supplied us with a slightly smaller unformatted version
+of the program which we include below: and in the alternate source. It has the
+ This program touches on a well known Unix utility, the 6th edition
+Bourne Shell ( This program is a rudimentary shell. It does I/O redirection, pipes
+and cd. It flags errors on failed This program is obfuscated in a few notable ways: apart from the
+layout (an unformatted (but crunched) version is included for people who
+want to put this through The error value of Recursion is sneakily employed to avoid a second call to
+ The meta-values array is initialized in a bizarre fashion, and the
+subsequent checks for the Finally, it is notable that the code was hacked for minimality. If
+you look at the compressed version, you will be hard-pressed to
+eliminate more than a few characters (we can’t see how to make it any
+smaller!). 550 characters is pretty lean for a shell that does this
+much. The syntax of the shell has not been fully explored, but if you try
+to redirect in the same direction more than once, only one redirection
+is performed. This is a “feature” of the way the line is parsed; a
+pointer to the stack of arguments is assigned and an argument is stolen
+every time a cats to cats to Depending on your flavor of Unix, There is just one error message, the question mark, but hey, that’s
+all This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/theorem/index.html Author: The current status of this entry is: For more detailed information see 1990 theorem in bugs.md. where: The program’s source implements four functions, all from the same
+source file! When you compile theorem.c as is and run with
+5 args, it numerically solves the equation The ‘expression’ The symbol Try running the program with the following args: But wait, there is more! You also get, free of charge, a reversing
+filter! Try: Still not impressed? The author throws in for free, a sort program!
+Try: This program is safe for home use as well. The author has included a
+safety feature in case you misplace the original program source: And finally, as a special offer to users of this entry, the author
+provides a Fibonacci sequence generator! Try: NOTE: if the two args passed to Program available on 9 track and cartridge cassette. Neither Ginsu knife nor Swiss army
+knife included! :-) When this program was first shown at the 1990 Summer USENIX
+conference, it received a standing ovation; a first for a contest
+entry. Differential equations are solved via the Runge-Kutta method, which
+guarantees local error proportional to Sorting is accomplished with a standard shell sort. Note that the sorting and reversing is limited to files with fewer
+than 500 lines, each less than 99 characters long. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1990/westley/index.html Author: The number should be greater than 0. The alternate code is provided to show how C changed. If you have an old enough compiler try and to see how C has changed
+over the years: If you would rather “Daisy” someone other than Westley, rename the
+program as needed. :-) Read each block of code as if it were a piece of correspondence. For
+example, the first block of code would read: The original source had control-L’s after each code block. To make it
+easier on news readers, we converted each control-L to a blank line. This is a “Picking the Daisy” simulation. Now, instead of mangling a
+daisy, simply run this program with the number of petals desired as the
+argument. This is a good counter-example to peoples’ complaints that C doesn’t
+have an “English-like” syntax. Lint complains about everything - null effect, xxx may be used before
+set, statement not reached, return(e) and return. Lint dumps core on
+some systems. My personal favorite lint complaint is “warning: eroticism unused in function
+main”. Also obviously, This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/ant/index.html Author: There is an alternate version that
+might feel a bit more familiar to vi(m) users. NOTE: the file must already exist and not specifying any arg will
+make the program exit without doing anything. This version changes the commands slightly so that to go to the first
+column you should enter These will make it slightly less unwieldy for those familiar with
+vi(m); the rest was unchanged. Use The author was kind enough to supply a list of references below, in
+case you are still confused after read the source! :-) BTW: you’ve most likely heard the joke that if you want a
+pseudo-random string of characters you can put a user unfamiliar with
+vi(m) in a vi(m) session (in insert mode) and ask them to exit. Well in
+this case you’re likely to have this problem if you ARE a vi(m) user!
+:-) … especially if you don’t read the information below. This means if
+you’re reading this in vi(m) you’ll have to exit this like in normal
+vi(m) and then try the same with NOTE: to enter form feed you should be able to hit
+ Ant’s Editor vIOCCC91 Text files consists of lines of printable text or tab characters. A
+line can be of arbitrary length and is delimited by either a newline or
+the end of file. Carriage return is mapped to newline on input and
+ignored on output. Tab stops are every eight columns. Non-printable
+characters may have unpredictable results depending on the
+implementation of The It is recommend that compact memory model be used on PC class
+machines. Small memory model may work too provided The character constants My goals for this project were to learn and experiment with the
+Buffer Gap Scheme [Fin80][net90], write a useful and portable
+program, and meet the requirements of the IOCCC. I initially planned to
+have a mini I plan to post follow-ups such as unobfuscated versions and bugs
+fixes to comp.editors. Reposts of the editor.101, gap.doc, and
+editor.102 can be found in the same group every so often. This entry will display a file with long lines, but has trouble
+scrolling the screen with long lines. Paging up and down should work
+correctly, however. [Fin80] Craig A. Finseth, “Theory and Practice of Text Editors
+or [KeP81] Kernighan & Plauger, “Software Tools in Pascal”, [Mil86] Eugene W. Myers & Webb Miller, “Row-replacement
+Algorithms for Screen Editors”, TR 86-19, Dept. of Computer
+Science, [MyM86] Eugene W. Myers & Webb Miller, “A simple
+row-replacement [Mil87] Webb Miller, “A Software Tools Sampler”, Prentice Hall, 87
+ISBN 0-13-822305-X, chapter 5 [net90] “Editor 101/102” articles from comp.editors This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/brnstnd/index.html Author: For info on more examples, read the sorta.README.md file. The author wished to win the “most useful program” award and
+documented this in the source code. The judges were unmoved by this
+blatant attempt to influence the contest and rejected this idea… so we
+gave it the “Best of Show” instead!! NOTE: One should remove the final trailing newline to obtain the
+original source file. This step is not needed to compile this entry. To have a chance to compile under a modern CPP, we had to replace
+ This is an interpreter for the programming language SORTA, a systems
+and numerical programming language with features sorta from C, sorta
+from FORTH, and sorta from Ada. SORTA lets you manipulate files and spawn programs easily, has
+bitwise operators, and gives you absolutely brilliant error messages
+like ‘?’ (that’s the C bit). SORTA programs work with a stack (that’s
+the FORTH bit)—actually two stacks, one for integers and one for
+strings. And all SORTA operations are strongly typed, detect practically
+any failure, and garbage-collect (that’s the Ada bit). SORTA also contains features you might not expect from such a small
+interpreter: arbitrary-length string input and concatenation, for
+instance, not to mention infinite-depth tail recursion. SORTA ignores its arguments (though it makes them available to the
+script); it takes all commands, character by character, from its
+standard input. Unrecognized commands are repeated with a ‘?’. SORTA maintains an Here, then, is the SORTA programming language. All non-digits delimit
+numeric constants. Spaces and newlines are ignored except as numeric
+delimiters. Common idioms: To drop the top of the While the program source of course depends highly on
+ The character pool ( Another nice feature is that the SORTA language itself encourages you
+to write not merely obfuscated but plain incomprehensible scripts (like
+the examples in sorta.README.md —after
+working with the language for a while, I guess I can read it pretty
+easily, but I also think FORTH is a beautiful language). The numbers
+running around everywhere will make people think of ASCII, even though
+the code is not ASCII-dependent. What’s your first thought when you see
+several Possible future extensions to SORTA include string extraction and
+matching, reading from files into strings, and encrypting the string
+pool to further confuse the judges. I don’t think I can fit this into
+the size limit, unfortunately. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/buzzard/index.html Author: There is an alternate version which
+might feel more at home for vi(m) users in navigation. The current status of this entry is: For more detailed information see 1991 buzzard in bugs.md. This version changes the keys You will be A-mazed. You are invited to try to cheat, … if you can figure out how! :-) When the game starts, you are at the far end of the maze from the
+exit, looking down a corridor. To move forward, type The game ends if you get out the exit (you’ll know it when you see
+it) or when you type You can, of course, cheat by looking at the maze map. The question
+you need to ask yourself, though, is what sequence of characters marks
+the place where you can escape the maze? The algorithm is quite bizarre–the primary nested loop that generates
+it goes top to bottom on the display, looping forward then backward from
+the current position to draw the left side and then the right side. The program can also be run from other files containing mazes. The
+maze should be laid out graphically in the obvious format; newlines
+separate physical rows in the maze; a space indicates a corridor, and
+any other character is a wall. Tabs are also considered walls, so make
+sure to convert tabs to spaces before using it. Usage: Filename is the name of the file containing the maze. This defaults
+to Escape-char is the character in the maze that represents the exit.
+You can put more than one exit in the maze (for example, you could make
+all ’!’s in the maze be exits). Start-x and start-y mark the coordinates where you begin playing. Y
+coordinate is down the rows in the files, X is to the right through the
+characters of each line. Both X and Y begin counting from 0. The default
+is start-x = 4, start-y = 5, which is needed for the buzzard.c, but
+would probably be inappropriate for other mazes. You can’t change that at start you’re facing down (“south”). The drawing algorithm cannot handle open spaces (two successive
+side-corridors with no wall between them). In fact, it cannot handle
+small dog-legs properly, although the error is subtle. The exit is drawn like a normal corridor from the side view; it’s
+only displayed as the exit when you are facing it. Improper command line arguments are not handled nicely. Mazes with openings at the edges will cause the drawing program to
+reach into arbitrary parcels of memory. The program assumes that tabs are set to 8 characters. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/cdupont/index.html Author: Why is the following label necessary? Notice that if you C beautify (cb) or pre-process this program, it
+will no longer work correctly, if at all. (go ahead, try it… :-)) NOTE: One should remove the final trailing newline to obtain the
+original source file. This step is not needed to compile this entry. The source code holds the letters of the message. Each letter,
+combined with another key letter, is used to compute the coordinates of
+the next letter and key. Thus, the message is code. That is why I use
+silly comments, most often badly spaced. The space character sequence between the words is given by a simple
+computation in an octal constant (given here as an hex value, of
+course). This way, any message can be mixed into a code, since the keys allow
+you to place the meaningful letters wherever you want. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/davidguy/index.html Author: where Of course, you may need to supply a more reasonable address. :-) Can you determine why this makes a difference? We permitted this type of entry to win because: Now that X11 and sockets have become ‘standard’, we plan to open up
+the contest to programs that use them. Future rules will explain this
+further. We are pleased that this entry has helped bring new ‘life’ into the
+contest. The program is a fully-functional X client. It talks directly to the
+X server through a socket without using Xlib, Xt or any other wussy
+toolkit junk. With no arguments, it will try to run locally using the
+unix-domain socket (only on BSD :-( ) or you can give it a command line
+argument identifying a display host address (in dotted octet notation,
+like 127.0.0.1:0.0) where the X server is running. It handles color and
+monochrome displays, and performs whatever byte-swapping and
+bit-reversal is needed (so that the program works even when the server
+and the client have different architectures). It buffers communication
+to the X server for efficiency. NOTE: The original source in davidguy.c used only an IP address
+argument (assumed :0.0) and assumed the color of black and white. The program doesn’t require any user interaction; you can just sit
+back and watch it run. All the action takes place in the root window of
+the display. We think the program is interesting for these reasons: It belongs to a class of programs that programmers make the
+following complaints about: they require a mountain of code to implement
+even the simplest program; and they must be linked with giant libraries
+of hard-to-understand functions. In contrast to these complaints (made
+by wimps, in our humble opinion), our program fits in under 1536 bytes,
+doesn’t need any external functions except for a few system calls, and
+doesn’t need to include any header files. It implements an extremely efficient algorithm for the
+computation it performs. One cool feature of the algorithm (at least as
+far as this contest is concerned) is that its obscurity is fundamentally
+necessary for its efficiency. In other words, even if we took steps to
+present the algorithm clearly, (we haven’t) the relation of the
+computation performed to the specification of what the program was
+supposed to do would still be hard to understand. The program plays Conway’s
+Game of Life in the root window’s background pixmap. It starts by
+setting the background to random bits, and then plays Life, with one
+Life cell for each pixel of the screen. In the game of Life, a cell
+survives to the next round if 2 or 3 of its 8 neighbors are also alive,
+and a cell is born if exactly 3 of its neighbors are alive. Otherwise, a
+cell dies of exposure if it has only 0 or 1 neighbors, and dies of
+overcrowding if it has 4 or more neighbors. The algorithm used to compute the next generation is based on the
+observation that a cell’s state in the next generation is a boolean
+function of its current state, and the states of its 8 neighbors (i.e.,
+a boolean function from 9 bits to 1 bit). This function can be computed
+by a boolean circuit. In addition, intermediate values computed by the
+circuit can be shared between neighboring cells, reducing the number of
+gates per cell required. These ideas have been used before, to compute
+the next generation through a series of bit blits. Instead of doing this, we map values in the circuit to bits in
+registers, so that the next generation can be computed efficiently
+within registers, minimizing memory access. As a result, the computation
+of the next generation is performed with about 1.6 instructions per life
+cell, consisting of .125 memory accesses, .17 shifts, and 1.3 logic
+operations. The net result is that the time to transfer the bits to the
+X server, and for the X server to draw them on the screen, dominates the
+time to compute the next generation. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/dds/index.html Author: The author suggests trying: Notice that a file What happens if you give the program a C program like itself?
+Try: You’ll get errors yes but what does the generated file look like?
+What about other types of files? This obfuscated program translates BASIC programs into obfuscated C
+programs by way of an obfuscated algorithm. This program is a companion to the DDS-BASIC interpreter program that was
+submitted to the contest in 1990. This
+compiles BASIC programs into compilable C code and then compiles it. The
+input format is almost identical to the input format of the DDS-BASIC
+interpreter. The program needs an executable C compiler called
+ Expressions are the same as the expressions of the C language. Many
+system calls and C library calls can be used. The compiler silently ignores many errors. Other errors may produce
+errors in later phases of the compilation. The compiler is NOT written in C, so this is really a meta-obfuscated
+program. The C code is an interpreter for the four register, seven
+instruction The This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/fine/index.html Author: Make sure that you read the last line backwards! Credit goes to Merlyn LeRoy (Brian Westley) for
+that. See his 22 August 1992 rec.puzzles
+post. Some others come from his 1989 entry as well. To those who
+have a harder time reading backwards it says:
+ This filter, 80 chars plus a newline, fits into a single line on most
+terminals (unless your terminal has a line wrap mis-feature :-)). Note in 2023: fixing this entry to work with modern systems increased
+the size, originally to 106 characters but it was dropped back down to
+80 with clever use of the Makefile. This entry is likely one of the smallest C implementations of this
+filter, excluding programs that resort to command line or include file
+tricks. How does this program work? Which 3 bytes of C code can be changed
+into 2 bytes, allowing the program to still work, but also stripping the
+high bit off some input? The author wishes to thank J Greely for the last 6 bytes. Here’s about how it does it: NOTE: Bits are referred to as 76543210, high to low. Get the character in variable Reverse bit 6, and strip bit 5. Bit 6 determines (mostly) whether
+or not this character is a letter. Bit 5 would determine case if we
+cared. Assign this value to variable Check this value to see if it is a letter. It must be non-zero -
+if it is zero, then we have either the If it is not a letter, the conditional expression inside of the
+ Notice that this implementation operates only on characters with the
+high bit clear. The high bit can be ignored without changing the size of
+the program. Also, if you know you are only dealing with seven bit data,
+the size can be reduced by one byte. These are left as exercises for the
+student. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/rince/index.html Author: There are two alternate versions which
+allow one to not be restricted in movements or to change the maximum
+number of movements, even if that’s fewer than the original program. The first alternate version, rince.alt.c,
+disables a maximum move count so that anyone with enough patience and
+time can complete the puzzle, without having to worry about how many
+moves they make, assuming they don’t get stuck. The second version, rince.alt2.c, allows one to reconfigure at
+compilation the maximum number of moves, even if that is lowering the
+count. The author set the maximum number of moves to 484. This will build both alt versions where the first one,
+ To reconfigure the maximum number of moves to 700: To run the first alt version: To run the second alt version: Can you figure out how to make the two alternate versions equivalent
+in functionality without modifying the code? That is can you make the
+second alt version end up allowing any number of movements? In 2023 this entry was updated to allow most ANSI C compilers to
+compile the code and to fix a bug where the win or lose message was not
+seen. This program is a simple puzzle type game. (I’ll leave you to play it
+to see the rest of it .. :-) .) The general idea was to try and write
+the smallest playable game, but keep the playability and enjoyment
+high. Key to map: The general idea of the game is to collect all the diamonds. This
+must be done in the minimum amount of moves. I’ve allowed a margin of 5
+moves which brings the moves allowed to There are two types of boulders. Both can be pushed around, but only
+the hollow (crushable) ones can be turned into diamonds (by pushing it
+onto another hollow one). Of the four types of doors (and keys) only 3 have been defined. This
+was done to keep the source as low as possible (as I only used 3 in the
+map). To unlock a door simply push a key into the corresponding door.
+Take care that it’s facing in the correct direction. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/westley/index.html Author: There is an alternate version that is
+supposed to win all the time. The current status of this entry is: For more detailed information see 1991 westley in bugs.md. NOTE: we have provided a script to perform the below procedure which
+we include for the interested. See the try section if
+you just want to play. Make and then run as follows: where the If you omit We have provided the shell script, ttt, to make
+it easier to play the game: The shell script determines when the game is over, and automatically
+replaces For example here is a potentially losing game: The final might look like: Redirects stderr to This version is based on the author’s remarks. It is not supposed to
+lose but it can lose if you cheat. That’s supposed to happen. Can you
+win any other time? Rather than use Can you figure out why the board looks different than the westley.c? What happens if you make a move already made? Now go try and draw or better yet win (without cheating which is very
+easy :-) )! Why is win better than draw? Because everyone knows how to
+draw: Professor Falken: Did you ever play tic-tac-toe? This is supposed to happen. As is written in the The Jargon
+File: Try not to cheat (even though it’s very easy :-) ), the computer has
+not learned how to catch you doing it. A tic-tac-toe self-modifying program that “learns”. This C program
+plays standard tic-tac-toe on itself. The code is written as a
+tic-tac-toe grid; moves are carried out within the code. The human is The program, when run, reproduces itself with both the player’s move
+and the computer’s move added. Recompile THIS program (using the same
+compile line) and repeat until the game is finished. If the computer wins, the “straight face” in the upper right-hand
+corner, “:-|”, will change into a happy face, “:-)”. If it is a draw,
+the face does not change. If the computer loses, the board is blanked
+and the face changes into a sad face, “:-(”. If this happens, the blank
+board should replace the original program; the computer changes its play
+and will continue to do so until it no longer loses games. If you want a program that never loses, simply replace the string
+ The vertical “bars” of the grid are identical functions, with the
+name of the function as evaluates to The player’s move is bitwise ORed into the The evaluation function The player’s move is evaluated to see if the human has won. The
+smiley is set to “:-)” or “:-(” depending on this. Also, if the human
+has won, the digit in the strategy string is decremented to change the
+computer’s play for the next round. If the human has NOT won, the A non-winning move first checks if The “move templates” are static tic-tac-toe positions that generate
+possible moves by making the …will make the The templates are carefully chosen to eventually block all traps that
+ Also note that the winning & strategy templates are part of the
+compile line, making it possible to change the rules of the game by
+changing the compile line. The templates are: A digit of This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/adrian/index.html Author: The current status of this entry is: For more detailed information see 1992
+adrian in bugs.md. For the slow minded, try: Once you get past the obfuscation, you have an opportunity to learn
+about regular expressions and state machines. NOTE: Some compilers have had trouble optimizing this entry. For those confused by the complexity of full-blown
+ A deterministic finite automaton consists of a finite set of states,
+along with transition rules to move from one state to another, an
+initial state, and a set of accepting states. The automaton takes a
+string as input and begins in the start state. It reads a character of
+the string and consults the rules for the current state, moving to the
+new state indicated by the appropriate rule. This process is repeated
+until the string is consumed. If the current state at this point is one
+of the accepting states, then the string is accepted. The deterministic finite automaton is specified as a series of rules
+for each state: Technically, a deterministic finite automaton should have a rule for
+each possible input character at each state. To simplify descriptions of
+the automata, if no rule is present, the string will not be accepted.
+Also, the With the automaton specification in It will read the file and print out all the lines which the automaton
+accepts. If the file cannot be opened, a system error message will be
+printed. If the input contains errors, then an error message along with
+the number of the offending line will be printed to stderr. The number
+of rules for each state is limited to 17. If more than 17 rules are
+present, you get the error Running: will perform a function similar to that of the unix If no filename is specified on the command line, then
+ I suggest using Compiling the new file, Another possibly interesting automaton can be created by slightly
+adjusting the and repeat the process above The new file now contains all lines which match Compile and run. This is an Two other adjustments to the first line also yield useful results. By
+changing it to you can search for matches to By some freak happenstance, lines of By setting the first line to a clone of the unix on standard input. And the program which results by running
+ Lastly, by setting the first line to you can search for Filtering If either Segmentation fault (core dumped) (The exact text of the above error messages varies from machine to
+machine.) The four programs which read from stdin require lines shorter
+than 999 characters. The other info files are If you want to change the default input filename (line 80) you must
+be careful to choose a name that doesn’t match the wrong search
+patterns, introducing extra lines into one of the programs (again, this
+was changed to be The program will produce at least one warning and possible several
+when compiled depending on the compiler. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/albert/index.html Author: An alternate version exists that fixes
+a bug. The current status of this entry is: For more detailed information see 1992
+albert in bugs.md. An alternate version of this entry, albert.alt.c, is provided. Leo Broukhis, before
+he was an IOCCC judge, sent the IOCCC judges this Email message: The albert.alt.c file is the fixed file,
+whereas the albert.c is the file before applying
+Leo Broukhis’ fix. To compile this alternate version: Use We were impressed with the speed at which it was able to factor
+arbitrarily large numbers consisting of factors that fit into a
+long. The Obfuscated version of the Horst algorithm. This program will factor unlimited length numbers and print the
+factors in ascending order. Numbers of one digit (e.g. 8) are rejected
+without notice. It quits as soon as there is at most one factor left, but that factor
+will not be shown. It accomplishes this efficiently, without resorting
+to division or multiplication, until the candidate factor no longer fits
+in a signed long. The nicest way is to rename the program into e.g. 4294967297 if you
+want to factor Fermat’s 4th number. Then just run it. Or you may type Apart from the foregoing there are no special execution
+instructions. To customize the program into a factorizer of a fixed number, use or some such. There are no data files used, and it is not possible to feed input
+via I think this program is a nice example of algorithmic obfuscation.
+Several times two similar algorithms are merged into one. Then you need
+quite some tricks to get it running, such as long jumps through
+recursive subroutines. I felt like a sword smith, welding the sword very
+long, folding it again to the proper length, keep on hammering till it
+is tight, then fold again. Always keeping it at the proper red hot
+temperature, but not too hot lest the hardness fades. The strict naming conventions for subroutines did not make things
+much clearer after all, but it was not supposed to. I would like to draw attention to the robustness of the program with
+respect to error handling and the nice stopping criterion. The aesthetic
+appeal of some lines is at the expense of clearness, I apologize. Running the program through the C-beautifier reveals nothing, it will
+only destroy some of the lay out. Running the program through lint shows
+the usual remarks for a K&R program. Defeating this through casts
+does not make a program cleaner in my opinion. Here are some hints, but they may not be too helpful: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/ant/index.html Author: where Like much of POSIX, obfuscation has its place. Your task is to figure
+out where. This entry comes complete with a POSIX-like command description.
+Interested POSIX balloters should lobby the IEEE for an obfuscated P1003
+subcommittee. See the file ant.README. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/buzzard.1/index.html Author: To see good C Preprocessor buzzard.1, try: Notice how many statements it takes to do anything useful? What you shouldn’t think about I didn’t just submit the post-C-preprocessed output as an entry. will print out the factorial of will print out the largest common factor of will print out a factor of If the first argument is less than 0, it prints out an error
+message. Don’t expand the Because of the definitional constraints, calls to
+ The simulated comparison operations only work with a certain range of
+numbers; numbers that are too large will cause the output code to fail
+to simulate the input code. This means that this implementation of
+ [Don’t read this unless you’re stumped!] You can figure out the other macros yourself. In the sample program,
+I’ve actually implemented subroutines by saving a return address in a
+variable and then jumping to a routine– specifically, a routine that
+converts a number into BCD, so it can be output by the hexadecimal
+output statement. The essential statement to be able to make interesting programs is
+the conditional (given that we have loops). Since all you can do in the
+given operation output set is assignment, we implement “conditional
+assignment”: To implement this, we constrain This is more obscured by factoring out common terms and restricting
+ourselves to two operand operations: Next we imagine we have a pc. “I’m
+supposed to execute statement pc next”, says our emulator. But suppose
+we’re not currently coming up on statement pc. To handle this, we simply
+make every operation conditional on the pc having the correct value: To combine this with other operations, we simply multiply by our
+( To evaluate A similar approach is used to detect positive numbers. Note that the obvious code to compute Thanks to Bill Pugh for bringing the loop-ability of the AE to my
+attention. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/buzzard.2/index.html Author: There is an alternate version of this program. See Alternate code below for details. First, you must make sure that Second: Third: NOTE: Wait until ‘Ok’ is printed and the type: Yes you should really type the 2 letters: Fourth: This alternate version, buzzard.2.alt.c, does not contain a fix that
+the author notes in their remarks. Use Have fun! It is very difficult to accomplish anything with this set of
+primitives, but they do have an interesting property. This–what this interesting property is, or in other words what first
+is good for–is the major obfuscation; there are also minor source
+obfuscations, as well as some design tricks that are effectively
+obfuscations. Details on the obfuscations are below, and the interesting
+property is discussed much further down. Do not expect to be able to do anything interesting with
+ To do something interesting, you need to feed to do this. Hopefully most operating systems will provide a way to do
+this. It may take some time for this to complete (I seem to remember it
+taking several minutes on an 8086 PC); For more information on what you can do once you’ve piped third into first, type Keep in mind that you are still running I say Other related obfuscations are still present. The top of the stack is
+cached in a variable, which increases performance massively if the
+compiler can figure out to keep it in a register; it also obfuscates the
+code. (Unfortunately, the top of stack is a global variable and neither
+gcc nor most bundled compilers seem to More significant are the design obfuscations. Assuming you’ve waded through all that, you still have to penetrate
+the most significant obfuscation. Traditionally, the question is whether
+a reader can answer the question “what will this do when I run it”. A
+reader who has deciphered I believe THIRD is sorta slow, because When you get the (which adds 2 and 3, and print the result and a newline.) THIRD responds: Now try: and THIRD responds When in The number THIRD replies with is the number of machine words
+( Thus THIRD gives you a relatively complete FORTH
+system in less than 700 chars of C source + about 1000 Software Construction Company gets credit for rekindling my interest
+in FORTH and thus indirectly inspiring me to write this program. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/gson/index.html Author: NOTE: we DISABLE the optimiser because having it enabled causes some
+invocations to crash in some systems. The current status of this entry is: For more detailed information see 1992
+gson in bugs.md. Determine where your system dictionary is located. You may find it
+located in one of the following places: Then using the proper dictionary: Recently some newspapers printed amusing anagrams of one of the names
+listed above. Run this program to find the anagrams they weren’t allowed
+to print! The author provided an obfuscated script that can be used to
+construct dictionaries which has been put in as mkdict.sh. To use try: Then try using the program as shown above with the file
+ The name of the game: AG is short for either Anagram Generator or simply AnaGram. It might
+also be construed to mean Alphabet Game, and by pure coincidence it
+happens to be the author’s initials. AG takes one or more words as arguments, and tries to find anagrams
+of those words, i.e. words or sentences containing exactly the same
+letters. To run AG, you need a dictionary file consisting of distinct words in
+the natural language of your choice, one word on each line. If your
+machine doesn’t have one already, you can make your own dictionary by
+concatenating a few hundred of your favourite Usenet articles and piping
+them through the following obfuscated shell script: Using articles from alt.folklore.computers is likely to make a more
+professional-looking dictionary than rec.arts.erotica. AG must be run with the dictionary file as standard input. Because anagrams consisting of just a few words are generally more
+meaningful than those consisting of dozens of very short words, the
+number of words in the anagrams is limited to 3 by default. This limit
+can be changed using a numeric command line option, as in
+ As you can see, AG takes advantage of the new ‘92 whitespace rules’
+to achieve a clear, readable, self-documenting layout. The identifiers
+have been chosen in a way appropriate for an alphabet game, and common
+sources of bugs such as goto statements and malloc/free have been
+eliminated. As AG also refrains from abusing the preprocessor, it
+doesn’t really have much to offer in terms of “surface obfuscation”.
+Instead, it tries to achieve both its speed and its obscurity through a
+careful choice of algorithms. Some of the finer points of those
+algorithms are outlined in the spoiler below. Here follows a description of some of the data structures and
+algorithms used by AG. It is by no means complete, but it may help you
+get an idea about the general principles. Internally, AG represents words and sentences as arrays of 32 4-bit
+integer elements. Each element represents the number of times a letter
+occurs in the word/sentence. There are 32 elements because 32 is a
+convenient power of two larger than the number of letters in most
+western alphabets, and the elements are 4 bits each because the same
+letter is unlikely to occur more than 15 times in a practical anagram
+generation problem. These This storage format makes it possible to add or subtract two such
+vectors of 32 4-bit values in parallel by simulating a set of 32 binary
+full adders in software using bitwise logical operations. E.g., all the
+LSBs of the result are formed in parallel by taking the exclusive OR of
+the LSBs in each summand, and 32 carry bits are formed in parallel in a
+similar way using a logical AND. Thus, 32 independent 4-bit additions
+can be performed by just four iterations of a loop containing some
+32-bit bitwise logical operations, but no arithmetic operations other
+than those implied by array indexing. Subtraction works similarly, and in fact AG only implements
+subtraction directly, handling addition by means of the identity
+ In addition to this The first thing AG does is to construct a lookup table of 256
+ The next action performed is reading the dictionary. Those words that
+contain letters not in the input sentence are immediately discarded.
+Words containing the right letters but in excessive numbers are
+eliminated in a separate check involving the The remaining words, which will be referred to as “candidate words”,
+are stored in Each Generating the anagrams is then done by traversing the hash table and
+subtracting the letters of each word in the hash table from the “current
+sentence”, which initially is the sentence given on the command
+line. The subtraction is performed in parallel on the 4-bit letter counts
+as described above, and if all 32 results are zero, an anagram has been
+found. If the result is negative for one or more of the letters (as
+indicated by one or more When the deepest recursion level has been reached, an optimization
+can be applied: because no further recursion will be done, there is no
+need to look for partial anagrams, and therefore AG only needs to check
+for words that contain exactly the same letters as the current sentence.
+Those words can be found simply by indexing the hash table with the
+signature of the current sentence. Even when not on the deepest recursion level, AG generally avoids
+examining all the entries of the hash table. The idea is that we are not
+interested in hash buckets whose words contain any letters not in the
+current sentence; these buckets are exactly those whose index has a
+logical one in a bit position where the signature of the current
+sentence has a zero. Put another way, we want to loop through only those
+hash bucket indices It is possible to loop through all such numbers in an efficient way
+by taking advantage of certain properties of binary arithmetic: by
+forcing the bits corresponding to zeroes in AG uses a similar method but works in the opposite direction, finding
+the next lower value with zeroes in given bit positions by propagating
+borrows across those bits. Some additional adjustments are made to the
+hash table index when initiating a recursive search, using similar
+bit-twiddling techniques. Whenever an anagram has been found, it is printed by traversing a
+linked list formed by This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/imc/index.html Author: To see a number of options and configurations: The program is more interesting to run on workstations that can make
+use of a Sun raster file. Others can make use of the -text flag for
+character oriented output. Of course, the source (layout) is self-documenting! :-) NOTE: The original winning source assumed that This program depends upon the ASCII character set, and makes certain
+assumptions about the architecture. It naughtily declares the first
+argument to This program has several parameters; each of them has a default, so
+the program runs happily without any parameters. If you supply an
+incorrect parameter, an obfuscated error message results! :-) Should you
+want to run the program without knowing what it does, then supplying the
+single letter All the code in this program appears between the This is a Mandelbrot/Julia drawer. Normally it produces a monochrome
+Sun-format raster file. The version of The program may be asked to produce text output instead of a raster
+file. Then the characters defined in the The options accepted by the program follow. Each option is a single
+letter; it may be preceded with a minus sign (or any character in
+ all mean the same thing. Most options may be followed by one or two
+numbers. These numbers may be separated from each other and from the
+option by a space, or may be joined to each other with a comma, or may
+be appended to the single-letter option, so all mean the same (note that in The options of this program are: The colour of each point is determined by taking the bitwise AND of
+the number of iterations and the mask. For a raster, the point is black
+(1-bit) if the result is zero, white otherwise. For text, the result of
+the operation determines the greyness of the character produced, with a
+blank for zero going up to a star for the maximum value. For a
+four-colour picture, for example, use a mask with two bits set (e.g. 3),
+and for a 16-colour picture use a mask with four bits set (e.g. 15). For
+a picture with coarse detail, use a mask which ends with several zero
+bits (e.g. 8). While the program is creating your picture, it displays dots on the
+standard error to indicate its progress (one dot per pixel line). Here are a couple of good pictures to draw: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/kivinen/index.html Author: If your machine support the X Window System, Version 11: We recommend that you try the alt version first so you can get a
+better idea of what this looked like back in 1992. See original code for the original should you wish
+to see what we mean. The current status of this entry is: For more detailed information see 1992 kivinen in bugs.md. See also the author’s remarks for other variations. Also try changing the speed that the game moves. For instance if you
+wish to change the Then use the same syntax as above and described by the author. As noted above, the alt version is recommended because the code goes
+too fast in modern systems. If you wish to see the original you may do
+so with the original code. Use The type of entertainment depends on number of arguments you have
+with the program. :-) NOTE: Some systems do not need (or have)
+ NOTE: The original winning source kivinen.orig.c assumed that
+ This kit includes three games from the early era of video games
+designed for the X Window System Version 11 Release 5. It should work
+with earlier releases, though. The classic game of shooting aliens from outer space, trying to
+exterminate all life on earth. The game ends when the first line of
+aliens touches the ground, or destroy you. To win the game you must
+destroy all the aliens. If you evade out from the screen you lose. Break all the bricks with the ball, using your paddle. If you miss
+the ball the game ends. Catch all the falling pieces, before they reach the ground. If you
+miss it, game ends. To win you must catch all 30 pieces. The type of the game is determined by the number of arguments given
+to the program. …and so on… The exit value of the game is your score. The smaller the score the
+better it is. The exit value of zero means you have won. The game has a cheat system, which can be found after examining the
+event loop at the end of program. It is not a bug, it’s a feature! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/lush/index.html Author: The current status of this entry is: For more detailed information see 1992
+lush in bugs.md. The program uses error messages issued by the C Preprocessor to
+generate its message to the world. One program’s error is another
+program’s data! This program is yet another “Hello World.” program with a twist. The
+string Hello World has been encoded in the error messages the compiler
+generates when compiling the source. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/marangon/index.html Author: The object is to refill the table with 5’s, by incrementing or
+decrementing numbers as needed. It is the side effects that get you into
+trouble. If you are not careful, you may find things “at 6’s and 7’s”.
+:-) NOTE: Some compilers have had trouble optimizing this entry. NOTE: Some systems need to compile with NOTE: The original winning source marangon.orig.c, found in the archive
+directory, assumed that It starts off by creating a table with number 5 in all places. The
+CPU melts the numbers and you must return them in original state. When
+you increase a number, all the other eight numbers next to it decrease
+and vice-versa. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/nathan/index.html Author: To see some other fun uses: The judges make no claim as to the strength or security of this
+program. It is likely to be nil, or the next best thing to it. Still,
+you might consider installing it in The ‘winning’ category is also open to question. One could say that
+it is a ‘file obfuscator’. One could also say that it unintentionally
+abused the intent of rule #7 (that programs should be freely
+re-distributable). We suspect that the author may not have intended to
+do this, but that is the way things go sometimes. BTW, ‘abuse of the rules’ entries do not violate the rules. Entries
+that violate the rules are disqualified. Abuse of the rules entries are
+ones that tend to ‘stretch’ the limits and take the contest into
+unexpected territory. The US International Traffic in Arms Regulations controls certain
+exportations going out of the United States. The U.S. Munitions List
+gives the specific categories of restricted exports. Because this entry
+at one time appeared to fall under this restricted category, the judges
+originally were not able to distribute winners outside of the US. Nathan Sidwell stated that he was willing to distribute the winning
+source. To read HIS instructions of how to obtain his winning program
+one was able to run: to learn how to get a copy of the code. See the 1992/nathan.c file in the archive/historic/archive-1992.tar.bz2
+tarball if you’re interested in this file. I think the situation showed just how ridiculous US crypto
+regulations really were/are. Certain US federal officials can get away
+with shipping arms to certain nations in apparent violation of US laws,
+but I personally can’t re-distribute a program contest winner to the
+network! This program is a hello world text encryptor/decryptor. It uses an
+enigma (I think) style encryption algorithm, where the encryption key
+character is modified by a value, determined from the previous
+character. Non-printable characters (those with ASCII values <
+ It’s written in ANSI C, and doesn’t even assume an ASCII character
+set, (it has an array of the characters to convert), so should be
+portable across many platforms. It passes
+ Being an encryptor/decryptor, you probably want the source code to be
+obfuscated, to hide the algorithm. In spite of the fact that it looks like a nice friendly hello world
+program, it isn’t (as documented above). (Short lines have been padded,
+as you’ll find if you look at an encrypted copy of the source.) I’ve also named some of the macros from commonly used functions, just
+to keep things muddy. Of course, all the variables are misnamed. The
+program is kept simply (one for statement), by serious overuse of
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/vern/index.html Author: The current status of this entry is: For more detailed information see 1992
+vern in bugs.md. You might start off by giving the following input: The judges assume no responsibility for the obfuscated opening
+suggested above. :-) For a real quick game try: NOTE: Move values must be restricted to the range 00 to 77. NOTE: Because some mailers have problems with the original winning
+source, a slightly modified version with shorter lines has been
+provided. This program plays chess. You play the white pieces and the program
+the black pieces. Moves are entered as a two-digit number specifying the
+coordinates of the piece to be moved followed by another two-digit
+number specifying the coordinates of where to move it. Rows and columns
+are numbered starting with If the move you enter is illegal then you are just prompted again to
+move. If the move is legal then the new position is displayed and the
+program starts computing its response. For every 64 board positions it
+examines a “.” is printed. Once it has chosen its move it simply
+displays the board updated to reflect the move. Your move is prompted for using a string like
+ There are a few limitations on play: If you checkmate the computer it prints “Rats!” and exits. If your
+own checkmate is imminent it prints “Har har.” but doesn’t exit so it
+can rub your nose in defeat (which may be a move or two away if you’re
+playing at a high “ply” - see the next paragraph). Stalemates are not
+recognized per se, but when selecting its move the program assigns a
+stalemate position a value of 0 so it will try for a stalemate if its
+other options are worse. The program takes one optional argument indicating the ply
+(lookahead) it should use. The default is 2, which is enough to keep it
+from making flaming blunders. The higher the ply, the better the play,
+and the longer you have to wait. For example, at a ply of 2, a response
+to the This program is obfuscated in a number of ways. First, it abuses the
+contest rule regarding ‘;’, ‘{’, and ‘}’ in the source not counting
+against the non-whitespace character limit if followed by whitespace. As
+can be seen from the build file, certain combinations of these
+characters followed by a particular whitespace character are expanded at
+build time into much-needed text. Without this hack the program wouldn’t
+pass the character limit. A nice side effect is that the initial source
+is gloriously difficult to peruse. In particular, the Makefile does: and compiles Second, the rather ho-hum step has been taking of naming each
+variable with a one or two letter identifier to render it meaningless
+(and save space). This tactic is rather effective in a complex
+program. Third, the board is represented not as an array of pieces but rather
+as an array of function pointers (with a separate array representing
+whether a piece is white or black). This obfuscates the program’s
+central data structure. There is one function per type of piece; when
+called they return 1 if the current move is illegal for that piece and 0
+if it is legal. The functions also as a side effect set a global
+indicating the type of the piece (though the type can also be determined
+by comparing the function pointer with the function itself). Fourth, there are no independent routines for generating potential
+moves. Instead, the program generates its moves by brute force: for
+every piece it controls on the board, it attempts to move it to every
+square on the board. Those moves that are legal it then explores to see
+their effects (using alpha-beta
+search). This tactic somewhat obfuscates the algorithm used by the
+program. Finally, there are three key constants that occur throughout the
+program: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/westley/index.html Author: The current status of this entry is: For more detailed information see 1992 westley in bugs.md. If lost: Where NOTE: you MUST have a terminal that is at least 80
+columns for this to show properly. The The author provided a version for the US which we added. To
+build: NOTE: this alternative version also needs a terminal with at least 80
+columns. To find the approximate place where this entry was judged, type: Run the program with your latitude & longitude as integer
+arguments; it will produce a map made up of The program requires the ASCII character set, Lint complains that If you run it with fewer than 2 arguments, it will likely give you an
+exception, as it will access arguments that don’t exist and characters
+before a string constant. The map is printed as one long string of The position of latitude & longitude is changed into a single
+character position within the one long string via the first expression
+ The position counting down to zero changes the The Since the resolution is coarse, a few coastal cities are shown to be
+just off the map; this is an unavoidable artifact. The map is reasonably
+accurate. For a domestic (US) version with higher resolution, try: The code will test the 80-column wrap and document itself if it is
+joined together as one 160-character line and listed. You should
+see: …going down the left edge if your terminal auto-wraps at 80
+characters. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/ant/index.html Author: The current status of this entry is: For more detailed information see 1993
+ant in bugs.md. See the author’s POSIX P1003.2-like documentation file ant.txt for more information. This program demonstrates that POSIX doesn’t guarantee readability.
+:-) Some of the features of my entry are: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/cmills/index.html Author: We recommend you try the alt version first so you can get a better
+idea of what this entry was like back in 1993. See the original code section below to run the
+original. NOTE: this entry requires the To configure how many microseconds to sleep before updates try: The current status of this entry is: For more detailed information see 1993
+cmills in bugs.md. where: NOTE: in most cases We recommend the version that uses Use From the San Jose Mercury News (May 15, 1993 page 20A “West Hackers
+trounce East in computer quiz game”): [The expression on Bill Gates’ face was a sight to behold, as
+reported to us by several who were there]. You must set The optional argument is integer which controls the speed of the
+program. By default the speed is 9. You may want to try 1. You will have to kill the program (i.e., ^C) to stop it. WARNING: Slow servers or servers with long request queues will
+continue to ‘run’ for a while after you have killed the program. This program makes your windows about as useful as their windows.
+:-) The program uses a single backing pixmap (which is the size of the
+screen) for all of its subwindows (with a little bit of trickery to move
+the offset around). This is much better (and faster) than the obvious
+implementation which would require a full-screen pixmap and a separate
+backing pixmap for each subwindow. The chance that a window breaks is based on it’s kinetic energy,
+which in turn is based on it’s area and speed. How silly! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/dgibson/index.html Author: where: We have provided the shell script dgibson.sh
+to make it easier to run this entry. Run this shell script several times
+to see what happens. There are a number of data files available: For dgibson.data5 you will need a large
+screen, lots of virtual memory and lots of time! The try.sh script will run dgibson.sh on all the data files. Good luck trying to use a debugger on this entry! Life is not always
+pretty. This program plays the Game of
+Life. Life is a cellular automaton invented by J. H. Conway, in which each
+of a rectangular grid of cells can be alive or dead, and cells with more
+than 3 or less than 2 (out of 8) live neighbours die, and empty cells
+with exactly 3 neighbours give birth. Further features: the current generation number is preserved, and the
+grid automatically resizes itself as the object gets too big or too
+small. When writing this program, my goal was to make each cell in the life
+grid expand to the code which calculates the fate of that cell. In
+addition, the resulting program is a single expression, which makes it
+necessary to recurse This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/ejb/index.html Author: where: A negative argument plays the patience puzzle. An argument greater
+than 0 plays the Tower of Hanoi puzzle. In either case the absolute
+value of the argument specifies the size of the respective puzzle. Refer
+to the files hanoi.md and patience.md for more information on these
+puzzles. Of course, you need a different kind of “patience” if you give the
+argument 127 to this program and want to see it finish! We note that this also works under macOS just fine. The format of the output for the Towers of Hanoi case is simply a
+text description of how to solve the puzzle. For the patience puzzle, the output is a sequence binary codes
+representing successive states of the puzzle. The rightmost digit
+represents the first ring. A Most people who have written software for other people have been
+asked to count lines of code. Naturally, this brings up the
+controversial question of exactly what defines a line of code. This
+program serves to show that counting semicolons will not always provide
+a meaningful measure of code size. This is especially true in this
+program where the number of semicolons itself is ambiguous. Does it have
+two or three? In addition, the only C keyword this program uses besides
+type names and qualifiers is Although this program has only been tested on UNIX systems it will
+probably run on just about any machine with an ANSI C compiler. It does
+not use the C preprocessor at all. The only functions it uses are
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/jonth/index.html Author: NOTE: this entry requires Use This program’s output may be even more obfuscated when played on
+inverse video. :-) This is This program is also an example of data abstraction. The X array is
+after initialization hidden by the well defined macros This program is highly portable as it runs on a “Notebook” size
+SPARC. This program will not work on machines where
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/leo/index.html Author: To have the computer guess: To guess the computer’s number: where: [colors] is the number of possible colors (1 to 15) (default: 6) By default, the number of colors is 6. You may specify a value of
+between 1 and 15 colors. See the author’s notes for instructions of how
+to play. We look forward to more entries from the newer members of the
+International Internet community. This program plays
+[Mastermind](https://en.wikipedia.org/wiki/Mastermind_(board_game), if
+you call it by a name ending by ‘d’, otherwise it solves
+Mastermind. Call it without parameters to use 6 digits (colors), or
+indicate the number of possible digits (you cannot change the number of
+positions so easily). The number in parentheses is the number of possible combinations,
+based on previous questions and answers. If you solve the puzzle, “(1)”
+indicates that your previous moves are enough to give correct answer. If
+the program acts as solver and terminates prematurely, it means that
+you’re mistaken in your answers to its question(s). Question marks
+indicate the number of digits you have to enter (either 4 when you guess
+or 2 when computer guesses). Note that the program uses the same code for both player and solver,
+and the only place where it makes a difference is the interactive part.
+Many obfuscations have been made to achieve this. An expression giving
+ Suggestions: Use terminal (or emulator) with non-destructive
+backspaces. Do “disable scrolling” on cmdtool or similar emulators. Please don’t type ^D at the prompt!! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/lmfjyh/index.html Author: If you have gcc < 2.3.3 you can build this entry like: This will create a file called
+ For an explanation of why and how this works see the author’s
+remarks. The gist of the entry itself, however, is the file name
+itself is the code. NOTE: we delete the temporary file whether or not the compilation
+succeeds because it is an unsafe filename and not doing so would cause
+problems for anyone running This entry will not compile with gcc < 2.3.3 as it relies on a bug
+which was fixed in gcc 2.3.3 which was fixed a very long time ago now.
+There is an alternate version for those
+of us with gcc >= 2.3.3. See Alternate
+code section below for more details. However, there is an another version that will be compiled in the
+extremely likely case this fails. This should happen automatically. See
+Alternate code below for more details on
+it. The current status of this entry is: For more detailed information see 1993
+lmfjyh in bugs.md. If you have gcc < 2.3.3 (i.e. the entry can compile): This version does what the code did but in a way that will work with
+modern compilers. We’d like to say there’s something special about it
+but there isn’t. Nonetheless it will be compiled in case the original
+entry fails to compile (which will happen unless you have gcc <
+2.3.3. Should you wish to build this version manually: Use There’s more than one way to get around disk quotas. :-) “Practical and efficient method of compressing source code”. I will shortly present a totally new compression method. It may be
+used to compress any types of files, but it works best with C-source
+code. As an example, I have taken a simple “Hello world!” program that
+should be familiar to all C-programmers. Normally a file name is used only to identify the file, but this new
+revolutionary method introduces a totally new concept: THE FILE
+NAME IS THE PROGRAM. There is no need to waste
+valuable disk space to store source code. The program is embedded in the
+file name, only a minor portion of it is inside the file. The sample program in listing 1 is 36 bytes long. By using the new
+compression method, the example program may be squeezed to sixteen
+bytes. In the example the compression ratio is 2:1. It is evident that
+the longer the program is, the better the compression ratio is. The
+maximum compression ratio in a UNIX environment is 254:16 which equals
+approximately to 16:1. By using the method a one megabyte of source code
+file can be compressed to 64 kilobytes. One might easily think that the program could be compressed to a
+single byte by writing a one character long preprocessor directive in
+the source file and defining the actual source code in the command line,
+e.g. In a UNIX environment it is possible to write almost any program by
+including the code in file names. Since In C, the Large programs must be separated into small modules. This enforces
+people to write better programs, since monolithic programming style
+cannot be used. Program development will also be faster, no extra code
+needs be recompiled after changes have been made. I have tested how well this new method works with currently available
+programming tools. Any ANSI conforming C-compiler that runs under a REAL operating
+system should be able to compile the code (there might be problems with
+some older UNIX variants). These worked: These failed miserably: gdb - Printed almost the same error message
+ None of the lints tested environments were able to parse the
+file. The method can be used to compress any type of file and the
+compression ratios are even better when compressing files other than C
+source. For example plain text files may be compressed with INFINITE
+compression ratio. It is trivial task to compress a 100 kilobytes long
+text file in about 400 files whose lengths are zero bytes. The drawback
+is that the files must be unpacked before they can be used, so a large
+amount of temporary disk space is needed, while C source is totally
+usable in the compressed form. Evidently, there is a long way to go before this new programming
+technique may be widely used, since currently there are only few tools
+supporting it. The advantages over the traditional methods are, however,
+so great that there is no doubt that this method will be new
+standard. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/plummer/index.html Author: We recommend that you try the alternate version first to get a better
+idea of what this entry looked like back in 1993. The alternate version
+sleeps (via If you wish to speed the entry up, say to 500 microseconds between
+writes, try: Alternatively if you wish to slow it down, say to 1500 microseconds
+between writes, try: where: Wait until you’re bored enough to send intr/ctrl-c to exit or until
+the Vogons build
+that hyperspace
+bypass. This version, the original, does not sleep in between writes, and is
+thus much faster (depending on the Use For extra credit: What happens when ‘number’ contains non-numeric
+characters, and why? This program prints out all numbers up to a given number of digits on
+a single line. When the largest number is reached, the program starts
+again with 0. It takes two arguments: the first argument specifies the
+number to start counting from and uses leading Variable names are single characters chosen for their similarity to
+other characters ( The first statement points the base of The inspiration for this program came from actual code which dealt
+with scanning for a unique temporary filename by appending a
+successively larger number to the end of a string. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/rince/index.html Author: NOTE: there are two alternate versions of this program, both allowing
+one to slow down the game and the second one with movements more
+familiar to vi users. See the Alternate
+code section below. The current status of this entry is: For more detailed information see 1993
+rince in bugs.md. where: Some people may want to slow down the game by increasing the value 17
+in the lines: and to another value like 18 or 19 which you can do with the alternate
+code. In the case of rince.alt2.c the movement
+keys for the default game are slightly different and will feel more
+familiar to vi users: Replace 18 with whatever number you wish. Use The author has provided several CABBAGE files for your amusement: rince.data1 plays
+[Breakout](https://en.wikipedia.org/wiki/Breakout_(video_game). Keys are
+ rince.data2 plays the old Rince (README.md game from IOCCC
+1991. rince.data3 Sokoban screen 11. You are
+the rince.data4 Sokoban screen 13. Same
+rules as above. For a brief design description, see design.md. If you are running SunOS 4.1.x (assuming you can find an ANSI
+compiler in the first place), this program may be used to log out very
+quickly. Unfortunately, you can’t do anything else with it. Some people report that On some systems that use gcc, the This is a Cellular Automata Based, Beautifully Abysmal Game
+Environment (or CABBAGE for short). To execute the program simply type
+ This is a new breed of generic games. For instance: Game play : Whatever you define Keys : Whatever you define Score : If
+you can figure out how to update it! Levels : Ahh well… it’s not
+totally generic. The proper definition for usage would be:
+ I have compiled in on the following systems: * I never said it worked! The guidelines state that you dislike
+programs that won’t compile under both BSD or SysV
+ Alas, on Solaris it compiles, but mysteriously stops displaying
+output after a while until you quit with control-c, when it all catches
+up again. I think the problem may lie in either The use of I have tried to use as many different obfuscation techniques,
+including some of which (such as Also, the program does require a volatile type (especially when
+optimising) to perform correctly. This is the first time I have ever
+truly needed this when not accessing memory external to this process
+:-) Of course, all the usual obfuscation lurks within, such as combining
+multiple for loops into single ones; warped and twisted logic; plus a
+plethora of other minor oddities. It’s up to you to discover some of
+them of course… Sometimes I have sacrificed length for obfuscation. It
+is all too easy to change the arguments in Very little error checking is performed. I do check for not being
+able to open the requested filename and return 1 upon failure. However,
+badly formatted data files will cause major problems. No other checking
+(such as insufficient memory) is performed. There is no ‘end of game’ checking method. Hence games like Sokoban
+rely on the user to decide when they have had enough. Also, there is no
+quit mechanism other than control-c. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/schnitzi/index.html Author: The current status of this entry is: For more detailed information see 1993 schnitzi in bugs.md. where Certain input will cause the program to fail as described in the
+bugs.md file. We also suggest you ask the program the following questions: Notice how it still manages to answer the first question despite
+there being an intentional spelling error there. Try feeding the program source to the program and ask both: What happens if you ask it other questions with and without a space
+before the After this program prints the contents of ‘file’, ask it some
+questions related to the text. The author suggests the following questions when using schnitzi.info: We suggest you try using the body (minus the header and signature
+line) of a Usenet article. You might want to try something from
+alt.flame. :-) NOTE: If you have certain I wanted to write a program that would read in a text file in natural
+language (such as English) and answer questions about that text file. I
+thought this might be a complicated task, and I was right – it took me
+over 800 bytes. Of course, it doesn’t always work, but that’s AI for
+you. This program accepts the name of a text file as the first parameter.
+For example, to run it on the supplied data file called ‘schnitzi.info’
+you would type If you’re curious as to how it works, I guess you could feed in the
+source as the input file and ask “How does this work?” at the prompt,
+but I’m not guaranteeing any results… The use of This program depends on the first command-line parameter,
+typically called It uses a hidden string to test for punctuation. The layout, variable names, and expression format have been
+chosen in such a way as to cause visual confusion. It uses uses external It uses a clever hack to simulate artificial
+intelligence. The text for the info file, by the way, consists largely of headlines
+from the Weekly World News. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1993/vanb/index.html Author: The current status of this entry is: For more detailed information see 1993
+vanb in bugs.md. where What happens if you use something other than valid digits? The octal expression may contain: No spaces are allowed in the expression. To avoid shell expansion,
+one should surround the expression in single quotes. It is a good thing that this program consists of only one expression,
+otherwise it might become hard to understand. :-) The program does no error checking - erroneous expressions will
+produce spurious results. Note that unary Of course, the fact that the program takes input and produces
+output in octal, rather than a more useful system like decimal, makes it
+“special”. The entire program consists of a single expression, returned from
+ There are no global or local variables other than the parameters
+to All of the constants in the program are expressed in octal -
+including the The variables are given names which cause visual confusion with
+the octal constants. The program is formatted like a Roman numeral 8. The significance
+of 8 is obvious. I chose Roman numerals because it is a numbering system
+even more arcane than octal. It’s not very ‘deceptive’, but it’s
+difficult to deceptively format a program which has no explicit control
+structures (other than Many simple tasks are done many times. I tried to do these
+differently each time, to make the program harder to
+understand. It’s a recursive descent parser, calling it’s decrementing and testing Here’s the grammar ( Here’s how the grammar nonterminals map to octal state numbers: Here’s a version of the program before it got formatted into the
+VIII, augmented with comments showing where each state begins.
+ Note Note The The The This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/dodsond1/index.html Author: At the prompt, try entering The program plays the game that the layout of the source implies. The
+source, on the other hand, implies a language along the lines of Lisp.
+:-) For each turn, the board is displayed and the player is prompted for
+a move. Enter your move as an upper-case character followed by a
+number. The program uses a single function for 4 different purposes – to
+determine if a valid move exists, to verify that a move is valid, to
+make a move, and to determine the value of a move. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/dodsond2/index.html Author: There is an alternate version that allows you to cheat, giving you
+configurable amount of arrows at the start of the game. See the Alternate code section below. The current status of this entry is: For more detailed information see 1994 dodsond2 in bugs.md. This version allows you to choose how many arrows to start with,
+instead of the default 0. If one tries specifying a value < 0 it will
+set it to 0. Fun fact: this version helped uncover and fix a bug that prevented
+the entry from working in some cases. The default number of arrows in this version is 3 but if you want to
+change it, say to 5, try: Each year people find new ways to squeeze more and more out of the
+contest rules. Next year, entries that use compression utilities to get
+around the size limit will find themselves squeezed out of the
+contest! The original source code was submitted as a GZIP compressed file that
+the file(1) command reports as: The dodsond2.gz file was submitted as
+source in an effort to get around the 1994 version of Rule 2: Indeed, when dodsond2.gz is uncompressed,
+it is identical to the dodsond2.c file you find
+today. The IOCCC rules and guidelines were modified in an effort to address
+this fun “abuse of the rules” style hack. It is worth noting that without this compression “abuse of the
+rules” style hack, the dodsond2.c is
+further obfuscated. Go searching for the Wumpus in the Caverns of Doom! But be careful…
+There are pits and bats waiting to seal your fate, as well as a stealthy
+robber lurking in the shadows. Move through the rooms by typing the
+number of the adjacent room you wish to visit. You can feel a breeze if
+there is a pit in an adjacent room. A rustling sound will tell you that
+bats are nearby. The scent of the evil Wumpus can be detected from 2
+rooms away. To win, you must find one or more arrows, determine where the Wumpus
+is, and shoot him, all without falling into a pit or becoming the next
+meal for the Wumpus. To shoot an arrow, type There is a robber who waits in an unknown room. If you enter that
+room carrying an arrow, he will steal that arrow from you and move to a
+new room. If he steals all the arrows in the Caverns, you may catch him
+and recover all of them. Doing this gives you a bonus on your score. You can quit at any time by typing This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/horton/index.html Author: This confuses cb greatly. See horton.alt.c
+for an unobfuscated/enhanced version. Where A, B, C and D are numbers like with Try to figure out how this program prints, for a given slope, the
+right character. And for extra credit, try to figure out which character
+is at the bottom of this hint file. :-) You might be interested in the author’s article that they cite
+towards the end of their remarks, included as PDF files for your
+convenience, the full newsletter and a PDF file of just the pages
+cited. Run it with any 4 numeric arguments,
+e.g. As should be obvious from 20 feet away, the program is a cubic
+plotter. It plots against certain artists, splattering their cubes with
+graphs of their cubic equations. Those dastardly arguments are mere
+coefficients, cogs in the wheels of the grand plot to overthrow the
+cubics! Oh, by the way, it uses a self-contained graphtab and frame buffer.
+It’s easily modified to graph any 96x160 bitmap on a dumb
+terminal. See the gtface program for another example.
+Try: For more information, see my article Using GraphTab; USENIX ;login:
+Sept/Oct 1992, pages 28-31. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/imc/index.html Author: where This entry’s algorithm is as magic as its output! This program may be compiled with an ANSI or K&R compiler. A few
+harmless warnings are displayed only if This entry is really a set of library functions, but an example
+ The program should be supplied with an integer parameter. If no
+parameter or an invalid parameter is given, then 5 is assumed. The
+maximum parameter is determined only by the amount of CPU time, virtual
+memory and display (or file) space available. OK, so you have probably seen magic square printers before. But what
+about one that deals with even sizes as well as odd ones, or one that
+prints out a different one each time (or attempts to, at any rate)? I have formatted the important functions Here are the descriptions of the functions in the library: In the above, The square which is returned will (or should) be a permutation of the
+numbers 1 to This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/ldb/index.html Author: The current status of this entry is: For more detailed information see 1994
+ldb in bugs.md. Trigraphs are natural obfuscators. Most C-beautifiers become
+C-uglifiers because they don’t handle them correctly. Can you figure out how it prints a given random line (or if the line
+is longer than 231 characters, part of that line) from stdin? All input lines must be under 232 characters long. The compiling
+platform should be ASCII based. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/schnitzi/index.html Author: There are two alternate versions, one that has an increased buffer
+size and one that uses The current status of this entry is: For more detailed information see 1994 schnitzi in bugs.md. The first version, The second version, Use Try: Compare the output of the program with its source. Sure the output is
+different, but there is more than meets the You might also wish to redirect the output to another file, compile
+it and compare how it works to the original code. This is a program which takes any text file as input and ‘flips’ the
+input file along a diagonal running from the top left corner down to the
+bottom right. In other words, the first row in the file ends up written
+down the first column of the result, the second row is written down the
+second column, etc. The program is run by redirecting a file into the
+executable on the command line; for instance, for the file ‘info’, the
+program would be run as follows: The program generates interesting results when its source file is
+used as input: The result of this command is a program which does the exact same
+thing – in other words, both the program and the “flipped” version of
+itself work identically (you’ll need to redirect the output of the above
+command into a separate file and compile it). You might notice some
+differences in the flipped version, though. First off, a secret message
+becomes visible that was not visible in the original program. Also, much
+of the code shows up in different places in the flipped program than it
+appeared in the first program. My first version of this program was
+perfectly symmetrical along the diagonal, but I later found out there
+were interesting ways to break the symmetry. The best way to see this is
+to load both the original and flipped versions of the program into an
+editor and switch back and forth between them rapidly. C tokens longer than a character (such as This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/shapiro/index.html Author: The current status of this entry is: For more detailed information see 1994 shapiro in bugs.md. Now find the clock in the same terminal window (or console if at the
+console). Notice what you see in the output of This entry has many different levels of obfuscation, and yet the
+source file is self documenting. :-) From time to time, run See shapiro.md for more information in the
+internals of this program. The file shapiro.alt.c contains a non-obfuscated version
+of this program. Note that this alt file is currently missing. See bugs.md for details. The basic theme (pun) of this program is: “This time (everything) is not where it should be.” ~~~~ My entry (shapiro.c) is mostly comments,
+formatted in the shape of a clock. If you strip out the comments and
+look at the code you will quickly realize that the comments were the
+important part and that the code does very little (see pun above). It
+writes (to The second program (shapiro_t2.c (use
+ Most of the surface obfuscation in the second program (shapiro_t2.c) was an attempt to make it as small
+as possible. You should be able to see around this with
+ This may or may not work on non ASCII systems (I could not find one
+to test it on.) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/smr/index.html Author: Nearly every year, one or more people would submit what they claimed
+was the world’s smallest self reproducing program. While the sizes of
+these submissions varied, a quick glance would reveal that they were too
+big, until this entry came along. While strictly speaking, smr.c is not a valid C
+program, it is not an invalid C program either! Some C compilers will
+compile an empty file into a program that does nothing. But even if your
+compiler can’t, the build instructions supplied with this entry will
+produce an executable file. On most systems, the In the future, the contest rules will specify a minimum size that is
+one character larger than this entry, forever eliminating this sort of
+program from the contest. After all, how many variations can one make on
+this entry? :-) The world’s smallest self-replicating program. Guaranteed. Produces a
+listing of itself on This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/tvr/index.html Author: The author provided a spoiler version as alt code. See Alternate code below. The current status of this entry is: For more detailed information see 1994
+tvr in bugs.md. Mode may be a value from 0 to 12. The author provided us a spoiler version that might be of interest to
+some. where This entry requires the use of X11. It will form two windows
+(hopefully your window manager will ask you where to place these in your
+display) which you should place side by side. Move the cursor around in
+one of the two windows and watch what happens. The fractally minded may be able to detect that mode 0 does not
+calculate Mandelbrot/Julian sets correctly. Can you find the bug? Better
+still, can you fix it without breaking something else? This program contains four pairs of fractals/effects and three
+methods of animating them. There are two windows for a pair of fractals,
+one of which contains static fractal (e.g. Mandelbrot set)
+and the other an animating one (e.g. Julia set) which is
+derived from the same formula as the static one. Only one pair of
+fractals can be displayed in one process. To animate the fractal, you must move your mouse on the static
+fractal window and the animated fractal will be calculated based on
+mouse coordinates. If you are on one of the two non-stable modes (more
+about them later) you can stabilize the picture by pressing a mouse
+button. Pressing it does nothing on stable mode. The three modes are: On Mandelbrot/Julia mode the stable mode calculates normal Julia set
+according to the Mandelbrot coordinates (mouse position). On non-stable
+modes the picture slowly transforms to the same picture as on the stable
+mode but transformation can take some time. Usually, and especially if
+changes are relatively small between mouse movements or frame rate is
+high, the non-stable mode makes much more interesting effects IMHO. The
+difference between the two non-stable modes is that the first tries to
+stabilize the picture. It doesn’t stabilize much, but it helps in some
+cases quite a lot. One notable case where help can be seen is when you
+first move your mouse to non-black areas of the Mandelbrot set, then
+back to near the center. In some cases ‘attractor searcher’ can be seen
+as noise. The first of the fractal pairs is Mandelbrot/Julia set as mentioned
+before. The second is a variation of that. The third makes nice
+3D-look-a-like effects and the fourth is a variation of that with more
+nice effects. The first parameter is the operating-mode of the program. There are 4
+fractal pairs and 3 display modes, making total of 12 modes.
+ The program needs reasonable values for both of these parameters to
+operate. A good first try could be Note that you will need approximately
+ This is the file from which program reads colors for screen
+ There are two You should compile this entry with an optimizing compiler with the
+highest level of optimization possible. You will also need an ANSI
+compatible compiler ( This entry has been tested on wide variety of machines including: Also, many of the X server and X library versions have been tested
+and the program should be highly portable. The program may slow down
+considerably on machines where table references are slow as the program
+makes extensive use of them. Also, due to the huge amount of data sent
+to the X server, considerable slowdown can be noticed if the X server is
+slow or especially if the connection between the X server and the client
+is slow. (Don’t try this on 9600 bps modem line. I did ;) ) Obfuscation is done on different levels. Almost none of it is made at
+the macro level, so Mandelbrot set is calculated from the formula and the Julia set is calculated from the formula where Note that Mandelbrot and Julia on this program aren’t exactly
+correct. Find out why ;) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/weisberg/index.html Author: There is an alternate version that uses more memory. See alternate code below for more details. If you have where If you liked what you saw from the above program, and happen to have
+some 512 Megabytes of virtual memory lying around with to do something
+with you might try this version. Lesser systems will find this alternative version a good way to
+create a core file. :-) This entry confuses some C-preprocessors and some C-beautifiers. We
+found one cpp that processed this source differently when it was read on
+ The following short program implements the “Yet Another” algorithm
+for generating prime numbers. It will generate all primes up to
+33554432, displaying them to the standard output as it churns along. As
+33554432 is rather large on most machines, this code may take quite some
+time to run to completion, so as an added feature, it will cease
+execution upon reception of a signal (any will do equally well), as well
+as in the event of a system shutdown or reboot. The alternative version (weisberg.alt.c)
+has never actually run to completion. After running for close to a week
+it had reached somewhere around 250e6, when it became necessary to test
+the reboot feature (which worked remarkably well). As there are quite a
+lot of primes to be found before reaching The original “Yet Another Prime Program” algorithm used here was
+developed as a Computer Architecture course micro-programming exercise,
+and was designed to take full advantage of the UR300 micro-architecture
+to achieve blindingly fast speed. It was ported to C specifically for
+the IOCCC. In the conversion/obfuscation step some of (much of) the
+blazing speed was lost, but as a bonus, the understandability of the
+code was reduced to zero. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1994/westley/index.html Author: NOTE: the purpose of this entry is to escape the dungeon via the
+compiler line where you get messages as compiler
+errors. Depending on the compiler line you will get different
+error messages and one compiler line will make you win the game! NOTE: your terminal should be set to 80 columns, 8 character tabs,
+and wraparound. There is no running as such. See below. But for something more interesting try compiling it with different cc
+arguments. For example: Not all compiler errors are bad. For spoilers see the end of the notes from the author below. To use: This program, in accordance with the rules, compiles into a legal C
+program without human intervention. However, it simply compiles into
+ This program is a simple adventure game which uses only C
+preprocessor error messages (for missing This will fail, producing an error message for a missing
+ Your compiler error message will vary, but the important part is the
+missing include file name, which functions as the game text. To “do” things, all words must start with …and you will get another error message telling you about the door.
+(note: some compilers will stop after the first missing include file,
+while others will continue to try compiling; the latter will repeat the
+opening message each time, as if you are playing an adventure game with
+“verbose” turned on). The goal of the game is to escape the dungeon. Here is a walk-through for the game, including a few dead-ends: Note that the game has no real state information; you can type these
+commands in any order, at any time. Also note that word order is
+unimportant. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/cdua/index.html Author: We recommend that you try the alternate version first so you can see
+what this entry looked like back in 1995 (with a configurable speed).
+See the original code section below for the
+original entry. The alternate version uses The current status of this entry is: For more detailed information see 1995
+cdua in bugs.md. You might also like to try: Do you see anything strange in this version when With modern systems this was hard to see it solve it in real time
+because it goes so quickly which is why we recommend the alternate
+version first: you can actually see it being solved in real time rather
+than have it go by in a flash. If you wish to use the original version, for instance if you wish to
+see how fast your computer is :-) or use both to see the difference, you
+can do so. This could be used as the basis of an a-maze-ing screen
+exerciser. A program that generates a maze, and then solves it, all this being
+seen by the user. Some highlights of obfuscation are: 3 step function in
+one - This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/dodsond1/index.html Author: You might consider giving the following input: … which can be done like: Istha ogrampra akesta Englishwa extta aswa inputwa andwa anslatestra
+itwa intowa Igpa Atinla. The obfuscation is on several levels. Most obviously, the shape of the program. Underneath that, the variable names are in pig Latin, as are the
+names of the standard C functions, such as The program construction is also very obfuscated, with all of the
+code being inside the This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/dodsond2/index.html Author: An amazing entry! The official chef enjoyed solving the maze, which she did on the
+first attempt. Step into a randomly generated 3D maze and try to get out alive! Use
+the vi movement keys ( Reach the north-west left corner of level 1 to exit. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/esde/index.html Author: where data-file contains lines of < 255 chars in length. When reading the source be careful to distinguish between variable
+names and library functions. If you still don’t know what it does, try https://en.wikipedia.org/wiki/Soundex. This program searches in the file words which have the same Soundex
+code of the given word, and print out lines with those words. The Soundex code is used to find similar sounding words. Soundex code begins with the first letter of the word followed by a
+three-digit code. This is the algorithm: These are the codes: An info file should be a text file consisting of lines of text (max.
+256 bytes in each line). This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/garry/index.html Author: While it may not have been the intention of the author, the judges
+noted that the C pre-processed version (with the The author was kind enough to provide a less obfuscated version of
+the source called garry.fmt.c. This program is a file filter, designed to do environment-expansion
+and incorporating the ability to create binary from escaped data in the
+environment variables. The calling syntax is pretty simple, just use it with
+ or The syntax of the conversion of the input file is as follows: To
+include the value of an environment variable in the output file, place
+the name of the variable between Unknown Env-variables or malformed expressions are ignored and kept
+intact. Additionally, the filter replaces escaped octal values in the
+environment variables by their binary representation, e.g.: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/heathbar/index.html Authors: where num is a non-negative number. The main reason we liked this entry was mainly because the main
+effect of the source was self documenting! :-) Run this program with two non-negative integer arguments
+(e.g. My goal was to create the fastest possible C program. To that end, I
+made three critical observations: Based on #1, I knew that the Fastest Program had to be one that
+performed addition. From #2, I reasoned that it ought to directly
+manipulate the bits, rather than wasting time dealing with bloated,
+high-level, fuzzy-logic, artificial-intelligence, neural-net,
+client-server, object-oriented abstractions like the C language “+”
+operator. And it was obvious from #3 that the program should resemble,
+as closely as possible, a long sequence of the familiar word
+ Also, I’ve looked at some past winning entries of your contest, and
+if you don’t mind a little constructive criticism, some of them are
+kind-of hard to figure out. I didn’t want my program to fall into the
+same trap, so I went out of my way to write self-documenting code.
+Anyone who so much as glances at my program will immediately see that it
+adds two 16-bit unsigned integers by streaming their bits through a
+simulated cascade of hardware adders. I hope my diligent effort to write
+especially clear code gets me extra points! P.S. What does “obfuscated” mean? This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/leo/index.html Author: See the author’s information below on these details. If you don’t have gs or an equivalent postscript viewer, try: and send foo.ps to your local postscript printer or open it in an
+appropriate application (e.g. GIMP). Press return after each image is drawn. The variable names are element-ary. If you find this confusing,
+remember that it is nu-clear. :-) Some Ghostscripts/Postscript programs cleared the screen right after
+the image is drawn, so we added element 106 which acts as an input
+buffer. To qualify for a category specially for yourself in the Geek code,
+find out all the secret switches that the author doesn’t divulge ! (All
+switches are single characters on the command line - anything that’s not
+a number is a candidate.) The usage is: where the first three are literal words, If Some options to try (besides the obvious): This draws the basic pattern I invented in high school: You take a big sheet of “arithmetic” paper and draw a line of length
+1 (between 2 crossings) at the center of the sheet: This makes 2 open ends (I think the notion of an “open end” doesn’t
+require explanations) in step 1. Now, until there are open ends in step
+N, repeat: for each open end pretend it points north and draw 2 lines
+going northwest and northeast from it to the nearest crossings. This
+needs to be done “simultaneously” for all ends that are open at that
+moment. Step 2: Step 3: Step 4: Step 5: The lines marked by Note that so far all the drawings represent valid structural formulas
+of some organic substances. step 1: ethane step 2: 2,3-dimethylbutane step 3:
+(2,5-dimethyl;3,4-isopropyl)-hexane step 4 and 5: I don’t know. Do
+you? Step 6: depending on the desired “hairiness”. The original (paper-based)
+algorithm was “hairy”, but it didn’t look as good on the screen. The program cannot handle non-hairy mode 100% correctly - step 6
+happens to be and so on: the horizontal symmetry has been lost. That’s why the
+opening for step 1 is not a single line but a cross: To watch it repeatedly (as a screen saver), use: The command line: draws the same as above. Try: What happened to the picture? Increase If If and other values of The options …There is a little flaw in the implementation of the algorithm, and
+sometimes the patterns are not symmetrical when they ought to be (the
+program needs to be slightly changed to expose the flaw, otherwise it is
+hardly noticeable, if ever). A quick and dirty fix (turned on by another secret switch) makes the
+patterns symmetrical, but a little too HAIRY. There is one more secret switch (it shall also remain nameless), and
+I don’t even want to explain what it does. You’ve been warned! Special thanks: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/makarios/index.html Authors: The judges were impressed that such a small program could do so much!
+Can you figure out how it does it? This program takes no arguments. It emits the base 8 representation
+of prime palindromes (palindromic in base 8, of course). This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/savastio/index.html Author: I know an l when I see a 1. This program is an infinite-precision factorial calculator. It will
+compute the factorial of any number entered to an infinite degree of
+precision (or the limits of your machine’s memory, whichever comes
+first). I’d suggest you start with small numbers the first few times you
+run it and gradually work your way up in order to get a feel for the
+computation time your machine will require. Aside from having an artistic code layout and confusing variable
+names, the algorithm itself takes advantage of some cute C-isms. Try to
+figure out how it prints the prompt “Enter number:”. Numbers are represented internally by a linked list of
+blocks each containing 1000 buckets of 4-digit integers. To further
+confuse matters, the buckets are arranged backwards in the block. For
+example, the number 8347108947139478934713847134 is represented as: Long integers must be at least 4 bytes. In order to prevent the user from wasting too much time computing
+useless factorials, the maximum factorial that can be computed is
+429539! This limit was selected through extensive research in time
+management studies and the factorial arts. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/schnitzi/index.html Author: WARNING: the author warns to not use too high a number! If you wish
+to ignore the warning it is an exercise to determine how high is too
+high. :-) Sometimes a core dump is a feature, not a bug! This is one of the better one-liners we have seen in a while. Take
+some time to figure out what it does before you run it! Beware, running this program with too high of a number amounts to
+doing a fork bomb on your machine! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/spinellis/index.html Author: While the code does not abuse the rules, its output surely does! P.S. Does the source have any spelling errors? 96% of the program lines (631 out of the 658) are comment text
+rendering the program readable and understandable. With the exception of
+the two include file names (needed for a warning-free compile) the
+program passes the standard Unix spell checker without any errors.
+Checking for spelling errors is considered very important for programs
+that are so heavily commented. This program is exactly 3217 characters
+long through judicious use of white space. Rule abuse? Would I
+ever abuse the rules? This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1995/vanschnitz/index.html Authors: The authors provided a spoiler version, originally uuencoded but
+uudecoded by us in 2023. See Alternate
+code below. The current status of this entry is: For more detailed information see 1995 vanschnitz in bugs.md. The authors provided a spoiler version of the program. Originally
+uuencoded we have decoded it for the wider audience in vanschnitz.alt.c. The Use Back in 1995, values of Back in 1995 we also suggested that for a bad/slow time to try
+ A classic problem in computer science is known as the Towers of
+Hanoi. It involves a set of different-sized disks mounted on one of
+three pegs. The object is to move the pile of disks to one of the other
+pegs. You may only move one disk at a time, and there is an additional
+constraint that a disk may never be placed on top of a smaller disk. Our program solves the Towers of Hanoi problem. Well, that’s not
+exactly true; actually, it’s the compiler that solves the problem. The
+resulting program just prints out the correct solution. How do you trick a compiler into actually solving the problem? First,
+you must tell it how many disks you wish to solve it for. This is done
+by defining the symbol A default value of To loop, the program The resulting program that the compiler generates simply prints out
+the answer. Did I say “simply”? Actually, the whole resulting program
+consists of a single For an odd number of disks, the program will provide a solution
+wherein the disks end up on peg 2; for an even number of disks, they
+will end on peg 3. This should provide some hint as to what sort of
+algorithm is used. We have included a spoiler version of the
+program, with meaningful symbol names and comments, but we encourage you
+to try to decipher the program without it… This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/august/index.html Author: The current status of this entry is: For more detailed information see 1996
+august in bugs.md. NOTE: some compilers will compile this code into infinite loops! If
+the above cat line (or one of the ones later in the try section) does
+not execute in a very short amount of time, then you may need to fix
+your compiler or use gcc. The above should print a This entry can feed on itself. If you C pre-process the source, you
+compile the interpreter: We can now compile the interpreter as follows: and use the compiled interpreter to execute some previously compiled
+code: And we can have the compiled interpreter interpret itself which in
+turn compiles the test program: And if you have lots of spare time, you can recurse one level
+deeper: We (the judges) recommend that you spend some time studying this
+entry as it surely will make the ‘best of the IOCCC’ list. It was very
+well received by those who attended the IOCCC BOF. This program is a bytecode interpreter. This fact is not particularly
+obfuscated; any experienced C programmer can see that in about a
+minute. The interpreter reads the bytecode from the standard input. What
+remains of the standard input after this is left as standard input for
+the interpreted program. Having an interpreter but no code isn’t any fun. But within a comment
+in the beginning of the interpreter is a sequence of bytes that is code
+that the interpreter understands. It is in fact the code for a compiler
+that compiles from OC (Obfuscated C, a subset of C) into the byte code
+that the interpreter understands. The language the compiler understands is a subset of C (the grammar
+is below) with the functions The compiler has absolutely no error checking, so things can go
+wrong. But this is what seasoned C programmers are used to. Assume that the interpreter has been compiled (source in august.c and binary in august) and that we have this
+in a file named We can then compile by And run the compiled program by Or even simpler: A larger example is included fac.oc. The compiler for OC is naturally written in OC (where did you think
+the byte code came from?). It is in the file parse.oc. Hmm… So now we have an interpreter written in OC and a compiler for
+OC, can we compile the interpreter? Yes, we can! The OC compiler does
+not have a preprocessor (hey, what do you expect from a program that is
+this small), so we need to use an external one. To pre-process august.c use the command from the Makefile, but add
+the If OK, we can now compile the interpreter: And we can run it: Here we have the interpreter interpreting another interpreter that
+runs the program. Did you think that was too fast? Just throw in another
+level of interpretation: And another… Fitting the byte code for the compiler into the initial comment was a
+challenge. I had to strip the compiler/interpreter of a lot of
+functionality to bring down their sizes. The initial version had a full
+set of binary operators as well as prefix Anyway, the bytecode from the compiler is first optimized in an
+external optimizer (not supplied here); this brings down the size of it
+by about 30%. The remaining code is then LZ-compressed (roughly) with a
+sliding window of 255 bytes. The most common occurring bytes are then
+encoded using Despite all this work I still had to put a lot of code in the
+compilation command. This disturbs me. It is possible to compress the
+code further with a better entropy coder (e.g. an arithmetic coder), but
+decompression then takes up too much code. Maybe this would be a way to
+fit it all into the 1536 bytes, but I don’t have time to try it. Execution starts at Below is a description of the OC grammar. Terminals are in quotes, Well, that is enough ranting for now. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/dalbec/index.html Author: Why does the output end with 121? The output is mis-leading … why does it also print 2047? For a hint see https://web.archive.org/web/20000510191341/https://www.utm.edu/research/primes/prove2.html. … and then try to understand the source! :-) We (the judges) recommend that you take the time needed to understand
+how this program works. The source is small enough to make the effort
+reasonable, and complex enough to make it interesting. This program assumes that your terminal wraps lines automatically. If
+this is not the case, you may need to change the space in the “printf”
+format string to a newline character. An extra feature of this program is that it allows you (in most
+cases) to estimate the stack space available to programs on your system.
+Simply allow the program to run to completion. The stack space is
+roughly proportional to the last number printed. (On SunOS/cc, the proportionality constant is about 48 bytes.) On completion, the program produces a core file that may be used to
+refine this estimate. (Or you could try typing This program is obfuscated by: The use of easily-confused variable names. Using the implicit Substituting expressions such as The fact that The fact that This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/eldby/index.html Author: We recommend that you use the alt version to see what the entry
+looked like back in 1996. For the original version see the original code section. To quit send intr (typically ctrl-c). NOTE: to reset the sanity of your terminal after this program ends
+try This alternate version, which we recommend that you use in order to
+see what is happening with modern systems, and to not flash too quickly,
+which can be problematic for some people, can be configured to different
+speeds by way of the value used in This version is the original which has no sleep time in between
+updates. Use We were impressed by the author’s ability to render spheres in 3D in
+a very small chunk of code. This program shows flying spheres. The program eats CPU on lesser
+equipped systems. The program will run until termination. Terminal must
+be VT100 or better with 80 columns and 24 rows or more. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/gandalf/index.html Author: The current status of this entry is: For more detailed information see 1996 gandalf in bugs.md. As the script asks, care to guess why these execute differently? Only
+the compiler knows … ok maybe other things like the author, the judges
+and perhaps you too? BTW: it is perilous to ‘try’ the patience of Gandalf. Go
+ahead, ‘try’ it! :-) For misleading C pre-processor output, try: The program requires an ASCII system. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/huffman/index.html Author: The current status of this entry is: For more detailed information see 1996 huffman in bugs.md. If you are still confused and want to read a spoiler, check out the
+source and it will be clear as mud! And for a misleading hint, consider who won! :-) And if you really can’t see what is going on, here is an extra
+spoiler: This entry was very well received at the IOCCC BOF. This filter program is really not obfuscated code. It compiles
+cleanly with an ANSI C compiler and comes with user documentation that
+even a blind person could read. The program is a bidirectional filter with the output of the program
+suitable for its input. The output of this program, when used as input,
+undoes the original program filtering. This program accepts any alphanumeric text that has lines less than
+100 characters. The user is encouraged to use the program’s source as
+input to the executable. This program is best appreciated on a tactile monitor. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/jonth/index.html Author: NOTE: this entry requires The current status of this entry is: For more detailed information see 1996
+jonth in bugs.md. NOTE: the two boards will be on top of each other so you will have to
+drag one off the other so that you can properly play. NOTE: if there is no X service open this will crash. If this is the
+case you might try: These are supposed to happen. As is written in the The Jargon
+File: For extra credit, figure out how you can cheat by taking over a
+square already occupied by an opponent. This is multi-user tic-tac-toe for X Windows. You may give one or two
+X displays as arguments to this game. Sometimes on Solaris, X gets confused and this program core dumps.
+The solution: give two display arguments
+( If one (or both) windows look like a copy of the window(s) below, try
+ Have a This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/rcm/index.html Author: For more information try: For a good no-op try: Except for some silly requirements regarding input validation, CRC
+checking, and similar unimportant fluff, this program is a fully
+compliant RFC1951/RFC1952 (GNU Gzip) file
+uncompressor. Feed it a “The 184 characters worth of defines in the build file have been
+carefully offset by 184 redundant and unnecessary ‘ “Using only 216 characters out of a maximum of 256, the build file
+meets and actually exceeds specification.” “The program source is less than 3,100 characters in length and
+uncompresses the file emacs-19.34b.tar.gz
+in about 130 seconds on my HP 9000/735. The now obsolete source file
+`inflate.c’ from the GNU gzip source tree is 31,613 characters in length
+and uncompresses the emacs distribution file in slightly under 25
+seconds. Thus: which represents a better than 530% improvement in the ratio of
+source file size to execution time.” “The inflate algorithm requires that over 400 characters worth of
+constants and tables be defined. Which means the program itself had to
+be squeezed down to about 1,100 IOCCC countable bytes.” This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/schweikh1/index.html Author: To find the day that Easter falls on in the current year: Look at the source. There is something very odd going on here. Where
+does the real code come from if everything is a C pre-processor
+statement? Clearly this is either the Best Use or the Worst Abuse of the C
+Preprocessor that the judges have seen this year! This program is an implementation of an algorithm that calculates the
+date of the Sunday following the first full moon after the spring
+equinox. (Also known as “Easter”, defined this way by the Nicaean
+Concilium in 325 Anno Domini.) The algorithm is attributed to the famous
+mathematician Carl Friedrich
+Gauss [“Meyers Handbuch ueber das Weltall” ‘Handbook About Space’,
+Meyer, 5th Edition, 1973, p149] and is suitable for anni domini within
+the Gregorian
+Calendar, that is, from ad 1582 to ad 2199: The interesting Sunday is either: with the following exceptions: March 53 is invalid, so the result is April 22 1962. Apart from the calculation of the Easter date, the definition
+and calculation of which are obfuscations in their own right,
+obfuscation lurks in many places. Look at those macro identifiers. What
+can be more obvious than a program that explicitly mentions the
+grammatical constructs it is composed of? If you look at K&RII A.9.3
+you will find that a compound statement consists of an opening brace
+followed by a declaration list followed by a semicolon followed by a
+statement list followed by another semicolon and a closing brace. Nobody
+can learn that by heart so I gently remind the reader by defining a
+macro that expresses this clearly (line 25). This goes up to the
+definition of a translation unit. Unfortunately, due to the IOCCC’s size
+restrictions, I had to abbreviate some syntactic elements.
+ Try to be as precise as can be and no one will comprehend what you
+mean. “Say nothing and everybody will understand.” The The program is run without arguments. It prints all dates in
+order. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/schweikh2/index.html Author: The program accepts up to 4 parameters: The number of operators in the expression [default: 9] The value of the first operand [default: 1] The (possibly negative) increment to the next operand [default:
+1] The goal value or 0/0 [default: 42] What happens if you pass only three parameters like the below? The author also suggests: (and we do too) which works with The original program, with only slight obfuscations, may be found in
+hunni.c. The perl script, hunni.pl, obfuscates it appropriately. Try: This entry was another crowd pleaser at the IOCCC BOF. Note: the source must be viewed with tabstop 8. To appreciate the
+beauty have your eyes half closed. C is a free format language. It is therefore a question of style how
+variables, operators, declarations, functions and syntactic elements
+like braces and parentheses are grouped together. As a rule of thumb, I
+put spaces around operators, after opening braces and before closing
+braces. I have generalized this rule by putting whitespace after
+any non-white space character (with the exception of
+preprocessor directives). There are no recognizable keywords anymore.
+There are no recognizable string literals any more. The
+ Try to indent the source. The unbalanced parentheses confuse Solaris’
+indent to the max (although the result does compile): Looking at the indented source is even less fun, because the
+nice diamond pattern has been replaced by something that looks like,
+uhm, modem noise. Lint the source. It’s clean. How obfuscated… What’s the exit status? The program exits with The program is an expression evaluator for a limited class of
+expressions. Known operators are The program accepts up to 4 parameters: On ANSI/ISO C conformant systems (where If The diamond pattern can be continued without a break. For a nice
+printout try this on your Bourne compatible shell: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/schweikh3/index.html Author: WARNING: DO NOT RUN this program without reading this text
+down to the end! It may render your system unusable for a
+limited amount of time or force you to reboot using the Big Red Button!
+This is NOT a joke. You have been warned. The source fails to compile on compilers that recognize the inline
+keyword by default. For gcc, you may need to use See the file schweikh3.info for example
+output from various systems. But still it is a useful utility. To use try: and thanks for the virtual memories! :-) NOTE: On some systems such as SunOS, one may need to compile
+with: There are some layout obfuscations that hinder readability, like some
+(but not all) one character tokens in column 1. There are no
+ You have to select maximum ANSI C conformance of your compiler. The
+source fails to compile under a C++ compiler due to the `new’ identifier
+which is a C++ reserved word: The source fails to compile on compilers that recognize the inline
+keyword by default, e.g. gcc: The The source fails to compile on obsolete systems with obsolete memory
+models due to the identifier Does your indent cope with backslash/newline pairs in between
+keywords like in The indented source will exhibit different semantics when indenting
+changes the number of lines (due to using the And what about The program is POSIX conformant and lints without warning under
+Solaris’ Sunpro lint. Allocated memory is correctly freed on all
+possible execution paths. This program tests your operating system’s allocation honesty. It
+forks a child that will allocate as much memory as possible with byte
+granularity and then write to every 1024th byte, at the same time
+writing a status report on I distinguish three different behaviours: OS without memory overcommit: OS with memory overcommit: OS with pseudo memory overcommit: I had the pleasure and pain to find all three behaviours on the
+platforms I use regularly. The file schweikh3.info has output for
+Solaris, FreeBSD and Linux. The Linux case is interesting in that the
+behaviour changes when How can we distinguish the three different OS types from the table
+above? Obviously, type (1), no overcommit, is easy. For type (2), random kill, we need to fork a child that can be killed
+and whose exit status the parent collects and decodes. Here’s where
+POSIX enters the scene. Type (3), thrashing, was the hardest part. The first attempt was to
+measure the elapsed processor time it takes to write a single byte
+(using This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/westley/index.html Author: There is another version which is the original entry. See alternate version for details as to how to
+use and why it was made the alt version. The original version had a display problem in modern systems which
+somewhat affected the usability of the program. This alternate code, the
+original, is provided, to show the differences. Time and time again, Brian Westley seems to come up with a winner! We
+are amazed at how much is being done with only one relatively short
+line. We think you will as well if you take the time to understand
+it. This 1-line program allows various analog ASCII clocks to print out
+the time; the ASCII clock is built from the command line arguments, so
+many different types of clocks can be generated. Three different scripts
+are supplied to print out a grandfather clock, a mantle clock that runs
+backwards, and a linear-style clock. (they are clock1.sh, clock2.sh, and
+clock3.sh) The program makes the following (possibly non-portable)
+assumptions: Command line strings can be written to. The first three elements of the My sample scripts assume ASCII, though this is not inherent in
+the code, just my sample scripts. These assumptions are pretty reasonable. 2) can be eliminated but
+makes the code larger. The code is simple; the arguments passed are: The program merely takes the minute (0-59) and the hour (0-23)
+values, looks up the offsets in The The statement of the This value is in turn indexed into the Note that the hands move in a quantum fashion; 3:59 looks deceptively
+like 2:59, since the hour hand will be at the 3 position. It won’t move
+until both hands click over at 4:00. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/banks/index.html Author: You may redefine all the keys and the time step with predefined
+macros. The author provided the following able: There is another macro, If however you wish to change the above controls, see the header file
+keysym.h for the definitions of other characters
+that you might wish to use. The name of the macro in the header file is
+what you need to set the macros to, depending on what controls you wish
+to redefine. For instance, to set the throttle up and down to
+ because in the header file you can see that Note that the keysym.h file is not complete
+from X11; it’s just the more likely candidates (and some that are
+probably unlikely :-) ). The upper case letters would be For those who do not have a Page Up or Page Down key, see alternate code below. The difference from the
+alt build and the original entry is that the page up and page down keys
+are defined to a default but they are hard coded as doing otherwise
+would necessarily complicate the build instructions. Since you can use
+the original entry to redefine these this is not a problem and is purely
+a convenience .. if only for those who are okay with the preselected
+alternative keys. See the author’s remarks in scenery for more
+details on the scenery files. For a fun time after running the above command, hold down the up
+arrow and left arrow for about 10 seconds and see what happens. Or, if
+you wish to really use it in a non-silly way, see the author’s remarks
+for the real controls. Perhaps you can regain control? If you do not have access to a page up or page down key, for instance
+you’re using a Mac, you can use the alt code (though it actually uses
+the same code) that will redefine the keys to increase throttle and
+decrease throttle. This same method can be used with the original code
+but this sets up predefined keys in place of Page Up and Page Down. The keys were somewhat arbitrarily selected but it was decided to
+make them both on the left side of a QWERTY keyboard as one might have a
+harder time using the arrows at the same time as typing on the right
+side. As the Makefile allows you to configure the keys to use you may
+redefine the keys but with the alt build you cannot, as described
+earlier, redefine the page up and page down replacement keys. If you
+want to do that you should use the original entry as described in the to
+build section above. In the alt build it is To use the default settings for the alternate build: You may change the other keys as described in the build instructions,
+above, but this alt code can be seen as an alternative for those who
+don’t have or don’t want to use page up and page down. Use What can we say? It’s a flight sim done in 1536 bytes of real code.
+This one is a real marvel. When people say the size limits are too
+tight, well, we can just point them at this one. This program really
+pushes the envelope! The provided Makefile should work; you will need an X-ish system, and
+a Carl Banks linked to (on his old website) an interesting article
+about this entry, a flight simulator in just 1536 bytes, which can be
+found at https://web.archive.org/web/20040201120708/http://www.idg.co.nz/magazine/pcworld/oct99/code.htm. You have just stepped out of the real world and into the virtual. You
+are now sitting in the cockpit of a Piper Cherokee airplane, heading
+north, flying 1000 feet above ground level. Use the keyboard to fly the airplane. The arrow keys represent the
+control stick. Press the Up Arrow key to push the stick forward. Press
+the left arrow key to move the stick left, and so on. Press Enter to
+re-center the stick. Use Page Up and Page Down to increase and decrease
+the throttle, respectively. (The rudder is automatically coordinated
+with the turn rate, so rudder pedals are not represented.) On your display, you will see on the bottom left corner three
+instruments. The first is the airspeed indicator; it tells you how fast
+you’re going in knots. The second is the heading indicator, or compass.
+0 is north, 90 is east, 180 is south, 270 is west. The third instrument
+is the altimeter, which measures your height above ground level in
+feet. Simulator models a Piper
+Cherokee, which is a light, single-engine propeller driven
+airplane. The airplane is modeled as a six degree-of-freedom rigid body,
+accurately reflecting its dynamics (for normal flight conditions, at
+least). Fly through a virtual 3D world, while sitting at your X
+console. Loadable scenery files. Head-up display contains three instruments: a true airspeed
+indicator, a heading indicator (compass), and an altimeter. Flight controls may be mapped to any keys at compile time by
+redefining the macros in the Makefile. Nice if your keyboard doesn’t
+have arrow keys. (Or if you still use vi. :-) Time step size can be set at compile time. This is useful to
+reduce flicker on network X connections. (But be careful: step sizes
+longer than about 0.03 seconds tend to have numerical stability
+problems.) Airplane never stalls! Airplane never runs out of fuel! Fly underground! Fly through buildings! Each of the Here is a brief description of the scenery files: A horizon, nothing more. You will probably always want to input this
+piece of scenery. An alternate horizon; a little more mountainous. Scenery of downtown Pittsburgh. The downtown area is initially
+located to your right. Simple obstacle course. Try to fly over the buildings and under the
+bridges. Fly over the tombs of the ancient Pharaohs, in this (fictitious)
+Egyptian landscape. Follow a flowing river from the sky. A few examples of how to input scenery: You can simulate flying through a cloud bank as well: You will usually want at least a horizon, though. The format of scenery files is simple, by the way. They’re just a
+list of 3D coordinates, and the simulator simply draws line segments
+from point to point as listed in the scenery file. I’m sure you’ll be making your own scenery files very soon!!! Several options must be passed to the compiler to make the build
+work. The provided Makefile has the appropriate
+options set to default values. Use this section if you want to compile
+with different options. To map a key to a control, you must pass an option to the compiler in
+the format The possible controls you can map are described in the table
+below: Values for the possible keys can be found in the X Windows header
+file For example, to map Center Stick to the space-bar, the compile option
+would be To set the time step size, you must pass the following option to the
+compiler: Two things to keep in mind when selecting a time step. Time steps
+that are too large (more than about The best advice is to set time step size to your system timer
+resolution. Try a longer period if you’re getting too much flicker. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/bas1/index.html Author: If else, while in X Window System, or: The output is supposed to be a 3D maze, but it is somewhat more than
+that. If you’ve seen any of the Maurits Escher’s
+works, you’ll know what
+we’re talking about. When trying to run the program with command line arguments, be
+generous. “You’re in a twisty little maze of beams, all different.” For maximum portability, In addition, because postscript is rather verbose,
+ Be sure to view the source with something that can display characters
+ Because this is not the obfuscated postscript contest, the postscript
+does not contain any Try running This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/bas2/index.html Author: Can you determine the relationship between the input and the
+resulting numeric output? The program was not designed to process files with a certain octet
+value, what value is that? This entry points out a minor flaw in the IOCCC rules that has been
+around since 1992. It processes a certain octet value in a way that
+differs from a strict reading of one of the official IOCCC rules. What
+is the rule and what is the octet value? The main obfuscation is the way characters are recognized, which is
+done by matching the bit patterns. Minor obfuscations are: Useless layout. Useless variable names. Recursive This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/chaos/index.html Author: NOTE: Some systems do not implement This is the author’s first IOCCC entry. We thought the entry was a
+nice example of a compact collection of obfuscations. Can you figure out why, in some cases, it wants to read itself? The executable takes a single argument for the data file to use. If
+no argument is given, it will find a data file by itself, don’t worry
+about it… This is a simple ncurses 3D object viewer. The keys Memory My local flavor of lint doesn’t seem to like the fact that I never
+ If the compiler happens to generate the byte sequence “AlWuzEre” in
+the executable by chance, the program may be unable to locate the
+embedded string. As a result, running the program without an external
+data file may act in undefined ways. If the compiler doesn’t store If the incoming data is corrupt, the results are undefined. (Although
+dumping core is a popular result.) When a point passes behind the camera, it is still plotted. The
+object will “bounce” off the camera, but the result (some points in
+front, some reflected from the rear) looks really odd. And it sometimes
+hangs. So just don’t fly through objects. You’ll be happier. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/df/index.html Author: Everyone talks about how data hiding can produce clearer code; I am
+pleased to offer this charming refutation. The program is a simple game. A bit of observation reveals that the
+game has some data - but where? It’s unclear which of the contents of
+the program are used. Curiously, the program only works if its source is in the directory
+it’s run in. More curiously, the program would fail if the program’s
+name’s second letter wasn’t Modern design has come a long way since the unreadable,
+tightly-coupled systems we used to have. Extra credit questions: This program lets you guess English words. It displays an underscore
+for each letter in the word; guessing a letter that actually is in the
+word replaces the corresponding underscores with the letter itself. You
+can guess a letter simply by typing it in. If your C implementation
+requires it, you may have to hit Return before it is recognized. In this
+case, you can also type multiple guesses on the same line (completely
+solve it by entering The program offers a number of different words to guess,
+ The source should compile with any ANSI C compiler (I used
+CodeWarrior w/ ANSI strict). Using non-ANSI compilers that implement the
+ANSI features it uses will not work (unless they defined
+ The source passes lint without any complaint (if invoked with
+ Actually, the code not only is compliant with the ANSI
+specifications, but uses a near minimum subset of them. C keywords that
+were not used have been re(de)fined to avoid unnecessary introduction of
+new, unknown character patterns. The source also includes all ANSI
+headers it needs (after most of the functions have been used), and the
+declaration of Multiple defines are used (but not all of them define), and
+ The executable needs its source file present in the current directory
+or, depending on your system, in your path. The name of the source file
+is not hard-coded, In the original version which was sent in to the contest, there were
+some restrictions on the file name: Valid names would have been The following lines describe how this program works; if you don’t
+want to know it at this time, please skip them. If this entry would by
+some mistake win the contest, please do not rot13 this - I hate rot13
+spoilers since it is somewhat complicated on a Mac to reverse them.
+Anyone out there should have enough discipline and rot13 shouldn’t be
+required, really. After all, we are not children anymore :-) This paragraph is not part of the author’s remarks, but is a helpful
+gift from the judges; if you read too fast to stop yourself, this should
+give you enough time to stop, which you really need to do RIGHT NOW if
+you don’t want to read the spoilers, which really do spoil everything,
+we mean it. The source file needs to be present because the words are read from
+it. The wordlist is encoded within the source using a 24 entry sliding
+dictionary where lowercase letters are offsets into the dictionary,
+uppercase letters are new letters not yet in the dictionary, and all
+other characters are ignored. The words are spread over six lines in the
+source; decoding starts on a line after a tab and a whitespace have been
+found, and stops on a newline. The grin after the “Demonic Smiley”
+actually is one encoded letter while the string is completely ignored;
+and the “For extra credit”, explain why the words are sorted alphabetically
+(because I extracted them from a dictionary :-) ) The file name had to fulfill the restrictions mentioned above because
+ You probably discovered that the The main function (the guessing part) is between the last
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/dlowe/index.html Author: There is an alternate version available. See Alternate code below for more details. The current status of this entry is: For more detailed information see 1998
+dlowe in bugs.md. Why is there different output? Also try: The original entry was just a text based pootifier. This alternate
+version is that program. What’s the difference between this and Why could this this entry be considered a utility? Well because it is
+able to convert content-free web pages into useful web pages. To see why, try using an online version, modified for use as a CGI
+program: https://web.archive.org/web/20001025182142/http://pootpoot.com/poot/pootify?URL=http://www.microsoft.com We are sure that you will find that new web page to make a much more
+consistent level of quality. :-) A CGI script such as: can be used to pootify web pages. This has been added as pootify.cgi.sh which forbids
+ The pootify.sh script has also been added
+which is a modification to the above script which can be used to render
+html files locally with the added bonus that one can use
+ where the first one would show the text as rendered but without
+links, images etc. and the second one would write the html to
+ For an old example of it working as a CGI script see: This program is a text filter, it reads It is obfuscated in that the code is painful to look at and its
+purpose and mode of operation are not terribly obvious. More
+importantly, it is a tool for further obfuscation, in that it can take
+any text and render it unintelligible. Suggested uses: add to your This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/dloweneil/index.html Authors: There is an alternate version available that has a key configuration
+that will be more familiar to vi(m) users and also allows one to quit.
+See alternate code below. The current status of this entry is: For more detailed information see 1998 dloweneil in bugs.md. Pressing Pressing Pressing This version has it so that where in addition to Read the authors’ remarks below to find out how to play. We believe
+that your experience may mirror one of our experiences: The object of this game is to spell Only three controls: To quit, send a fatal signal to the process. The different letters move in different directions once dropped onto
+the board: The letters bounce off the top and sides of the board. They bounce in
+a ‘natural’ way, with the exception that The letters stop when they hit another letter or the bottom of the
+board. When you spell Letters can be used in multiple spellings of
+ Chain reactions are possible. You get one (1) point for each letter you drop onto the
+board. You get a bunch of points for spelling Several different coordinate systems are used. There’s the “real”
+X by Y system used for curses, the “inside the box” X by Y system used
+for moving things around and finding instances of The fact that Of course, the code is as hideous as possible, and spells
+ Love that modulus operator! Mmmm… There are some equations used which are really unnecessarily
+ugly, which served the dual purposes of compacting the code and making
+it trickier to understand. I’m thinking of the equations used to convert
+between coordinate systems when dropping pieces into the game
+board. Simple and silly ones: short, meaningless (and sometimes
+misleading (see The game itself is simple, but still weird and quite
+difficult. Seeding the random number generator (doh!). Something to detect when the game is over. Some kind of scoreboard. Sound. Some way of quitting gracefully. Good Luck! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/dorssel/index.html Author: Also try: How does the program decide which way to convert? What obsolescent feature are we talking about? (No, it’s not a C
+language feature.) The author suggests that you try to answer the following
+questions: Which character in the initializing string is totally
+irrelevant? Which two relevant characters in the initializing string may be
+exchanged without altering the behavior? Which characters in the initializing string are somewhat
+irrelevant, and to what values may they be changed without altering the
+behavior? Which characters may be used to enlarge the initializing string
+by one without altering the behavior ? Try doing what the last part of the last command in try.sh suggests. As in, do the following: and make the necessary adjustments. You might also want to read the dorssel.md
+file. This program converts ASCII to Morse code, and vice
+versa. The program reads in lines from standard input and writes its result
+to standard output. The direction of conversion is determined on a per
+line basis. Each line must consist of a maximum of 952 characters
+followed by a new line character and they must not contain any NUL
+characters. Otherwise, some characters may be lost in the
+conversion. Encoding to Morse code: The program knows the Morse codes for all
+Latin letters (a-z, case insensitive) and decimal digits (0-9). Any
+other characters are replaced by an ASCII space, Decoding from Morse code: Morse code should be typed as sequences
+of The program assumes both source and execution character sets to be
+ASCII. As far as I can tell, the program is conforming and does not
+invoke undefined behavior. Try: to see what variables, numbers, and functions are used. (Does a
+better job than most C beautifiers). is the same as This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/fanf/index.html Author: NOTE: this may take a while. Some systems may have problems building
+this entry because of the system resources it requires. Enter an expression on standard input. To try some we have
+selected: At a time the code in fanf.c was that of fanf.orig.c but to get this to compile in modern
+systems it had to be translated to what you now see. The intermediate
+steps can still be performed but they might be different from the past.
+This should be kept in mind as you read the below remarks. This program translates lambda expressions into combinator
+expressions. But you do not need to know Lambda Calculus to be impressed
+by this program! See the file fanf.lambda for more examples
+of lambda calculus source. Notice how large the code grows from the fanf.c
+into the final Look at the first stage of the C pre-processing which was done
+like: Skip to the bottom of What do you have to do to make this program work with an old non-ANSI
+C preprocessor? My program is a demonstration of some practical applications of
+theoretical computer science. The application it implements is a program
+for translating lambda expressions into combinator expressions. The syntax of lambda expressions recognised by the program is as
+follows: The basic atoms are variables which are single characters other
+than backslash or parentheses, e.g. For example, the identity function, called Another function of interest is The algorithm for translating lambda expressions into combinator
+expressions works as follows. There are three forms of lambda expression
+to consider: variables, applications, and abstractions. There are a further three cases to consider for the body of lambda
+expressions, where we need to do the magic that transforms away the
+variables. E.g. suppose we had combinator expressions for We can then check that this evaluates to the expected result: It is possible to perform a slightly more compact translation with a
+couple of simple optimisations. For example, note that
+ and Also, The program simply reads a lambda expression from the standard input,
+translates it into a combinator expression using the transformation and
+optimisations described above, and prints out the result. Combinator expressions are easier to evaluate than lambda expressions
+because there are no problems with variables. For example, if I naively
+evaluated the expression My program demonstrates this by being based on a combinator
+evaluation engine which is used to implement a language called
+ It is fairly well known that the lambda calculus (and hence SK
+combinators) can compute anything, but mere computation is no use if you
+cannot communicate with the world. This is why The The with a side-effect. The with a side-effect. One of the problems with non-strict languages is that it is hard to
+predict in advance in which order side-effects will occur. In my program
+I used a monadic I/O structure like that used by the programming
+language Haskell; this allows one to write programs that manipulate
+external state in a manner remarkably similar to imperative programming
+languages like C. An examination of my program should provide an
+illustration of how well this technique works in practice. (In
+particular, I used the CPS form of the I/O monad from page 6 of
+“Imperative Functional Programming”.) The so that it can be used to call a function with itself as an argument.
+For example, if I had the appropriate arithmetic operators defined, I
+could write a factorial function in the lambda calculus like this: I used them to help fit my program into the required space;
+unfortunately I couldn’t fit the version that fully optimises the lambda
+expressions it reads into the required space. The complete optimisation
+rules including the ones it doesn’t use are: Although The first pass of the compiler is implemented via the C preprocessor.
+It implements one optimisation, namely function in-lining.
+Unfortunately, this optimisation always increases object code size and
+execution time. The opposite optimisation, common sub-expression
+elimination (which would offer improvements in code size and execution
+time), has not been implemented. The output of this pass is a C program
+that may be compiled by a normal C compiler. The second pass is performed by the initialisation phase of the C
+program. It builds a data structure representing the abstract syntax
+tree of the program. The program is then executed by an interpreter. This operates by
+performing manipulations on the AST that correspond to the evaluation
+rules of the combinators that I described above. The first 54 lines of the program are mostly the interpreter; the
+next 8 lines are pass one of the compiler; the next nine declare the
+ The first pass of the compiler relies on some magic macros that
+expand in a mutually-overlapping and almost recursive way in order to
+perpetrate a complete change of syntax. Interestingly enough, if I
+hadn’t used the same identifier for more than one thing in various
+places in the program this transformation would work with old-style cpp
+as well and ANSI cpp. It expands the program from about 2.2KB to about
+740KB. The resulting code does some tricky stuff to build a data
+structure of the same form as the code itself. The interpreter is written in fairly straightforward C, although it
+is highly compressed. The C itself is written in a fairly functional
+style, in that every function consists of a single expression. In the
+tradition of functional programming languages it assumes that memory is
+infinite and so never frees anything. It also assumes that the C
+compiler implements the tail recursion optimisation, which is probably
+not true. I used these references in the course of writing this program and
+they explain some of the ideas behind it in more detail. Arthur Norman
+(one of the authors of the first paper) did a lot to enthuse me about
+this topic. Clarke, T. J. W., et al., 1980. SKIM - the S, K, I Reduction Machine.
+Proceedings of the 1980 ACM LISP Conference, pp. 128-135. Curry, H. B. and Feys, R., 1958. Combinatory Logic, Vol. 1.
+North-Holland. Gordon, M. J. C., 1988. Programming Language Theory and its
+Implementation. Prentice-Hall. Peterson, J, et al., 1997. Report on the Programming Language
+Haskell, version 1.4. Peyton Jones, S. L., 1987. The implementation of Functional
+Programming Languages, Chapters 2, 11, 12, 16. Prentice-Hall. Peyton Jones, S. L., and Wadler, P., 1992. Imperative Functional
+Programming. Proceedings of the ACM Symposium on the Principles of
+Programming Languages 1993, pp. 71-84. Turner, D. A., 1979. A new implementation technique for applicative
+languages. Software- Practice and Experience. Vol. 9, pp. 31-49. Turner, D. A., 1979. Another algorithm for bracket abstraction.
+Journal of Symbolic Logic. Vol. 44, no. 2, pp. 67-270. Wadler, P., 1990. Comprehending Monads. Proceedings of the ACM
+conference on Lisp and Functional Programming, 1990. Wadler, P., 1995. How to Declare an Imperative. Proceedings of the
+ACM International Logic Programming Symposium, 1995. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/schnitzi/index.html Author: The current status of this entry is: For more detailed information see 1998 schnitzi in bugs.md. where What happens if at the command line you don’t specify Why does this happen? This is a beautiful program. How can a program with no conditional
+(except for the fixes for modern systems) behavior at all have output
+which depends on anything? For hints on deciphering this, see below past the Author’s remarks;
+they’re a nice summary, but they leave the mystery intact. BTW: the author notes an incredible lipogram story called Gadsby
+which has no letter E in the story. He did not note this but it has over
+50000 (50 thousand) (!!) words without the letter E which is one of the
+most common letters! In literary circles, there is a poetic form called a “lipogram”,
+which is a poem in which a specific letter has been distinctly avoided.
+This principle can be applied in other ways. For instance, in this
+paragraph, the vowel which immediately follows The IOCCC has been no stranger to this concept. Several winning
+entries from years past have accomplished interesting feats while
+completely avoiding the use of certain C constructs thought to be
+essential (e.g. 1988/robison.c).
+If you have to ask why they would do it this way, then this contest just
+isn’t for you. In continuing with this fine tradition, this program suggests to the
+ANSI committee some new practical simplifications for the C language.
+For instance, it appears that CONDITIONAL BRANCHING isn’t really
+necessary. So, we can do away with Function parameters and return types just confuse people anyway, so
+get rid of them. Same with local variables. In fact, all you really need
+are assignment statements, and maybe one This style of programming is also ideal for systems with limited
+memory capacity, since the function call stack never goes beyond a depth
+of one. So what does it do? Give it an integer
+ The output will itself be a lipographic program, one which expects
+input of (in this case) five numbers and prints them out sorted. It
+sorts them, however, using only and then compile it. The big key to this program is figuring out what the names of the
+functions ought to be; a bit of research may allow you to guess at a few
+crucial ones. The only function ever called is So how does This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/schweikh1/index.html Author: There is an alternate version of this entry that will work with
+macOS. See the Alternate code section
+below. We recommend you look at it even if you don’t have a Mac, unless
+you want to figure it out yourself, as it includes some interesting
+details about the entry. As noted above this entry will not work as it stands for macOS and
+there are some important notes as well as a description of how the fixed
+version works (the details of which are relevant to the original entry
+that no longer works as well as the fixed version but are described in
+the context of the macOS adjustments). For details of what had to
+change, see macos.md. Unless you wish to figure
+it out yourself, we recommend that you read this even if you don’t have
+a Mac as it has some interesting details about the entry. Use Bonus exercise: modify the code to provide a different compiler. What does it do? It seems to print a list of system headers, perhaps
+with words after them. Curiously, if you look at the list of words
+defined in a given standard header, they are never printed directly
+after that header’s name. Aha! It’s a conformance test for the standard
+headers. This code is a wonder; it’s a wonder that it compiles. I wonder
+whether or not it should. The innovative realization that you can use
+special characters, such as I’ve included most of the author’s remarks; they’re fairly thorough.
+Do not read them if you want to figure this out yourself. “Amendment
+One” refers to “NA1”, the add-on to C89 which added some fairly crufty
+internationalization support. Some non-gcc compilers that were not fully ANSI standard did not
+compile this entry correctly. Using cc by default was not helpful most
+of the time on this entry, because the program had a hardcoded gcc
+invocation anyway. Anyone who uses egcs and has no plain gcc will need
+to frob the source anyway and can be expected to do the right thing with
+ Important! This program, if it compiles at all, is mis-compiled by
+many compilers due to compiler bugs. It could be the “least likely to
+compile and execute” in conjunction with preprocessor abuse. When run,
+it is likely to uncover bugs in your system headers. The program is run without arguments. If your compiler is buggy, the
+most likely result is no output and/or an exit status of 1. If Amendment One headers are missing you will see something like: Bug your vendor for an upgrade. The format of the info file is straightforward and described in the
+file itself. Just load it in your favorite editor. Edit the source at line 55 in this case. ISO C has a very strict idea of visibility of identifiers. All
+possible macros are explicitly enumerated. In a compliant implementation
+no other macros can be defined, because you could write strictly
+conforming programs that may fail to compile due to syntax errors:
+supposing that is expected to compile and meet the assertion. If it does not, your
+compiler compiles some other language than ISO C. Not only is the program’s purpose a thorough standard conformance
+test, the source itself is a beast and has uncovered bugs in many C
+compilers. I could not find a compiler rejecting this. However, if we’re
+torturing the preprocessor a little more, by using token pasting, at
+least one compiler falls over. is rejected by tcc version 4.1.2, the TenDRA compiler:
+ To be honest, I don’t know if the rules for pp-tokens and token
+pasting don’t forbid what I do (and thus tcc is correct in rejecting
+it). In this case, all other compilers I tried are buggy, or the
+Standard itself :-) This is supposed to output (I have written a bug report for gcc. Newer versions and egcs are
+ok.) The Ask your local guru if C allows the same case label in the same
+switch statement to appear more than once. Ask him/her to think real
+hard. The answer will be “no”. The true guru will cite a constraint in
+ISO 6.6.4.2. Then make fun of the guru’s answer by waving
+ Lots of integer constants and string literals come into the source
+via A few old obfuscations, like one character identifiers, not too many
+macros, a There’s more whitespace in the Standard than just space, tab and
+newline. In particular, there are vertical tab and form-feed that can be
+used in certain places (outside of preprocessing directives, i.e. they
+are not allowed from just after the While I’m at it, the rules state that only space, tab and newline are
+ignored for the count (plus ‘ To use, try: I have tried, as suggested in the guidelines, to let the code look
+like ordinary C code. Apart from a few long lines I think I left the
+indentation like I would in RL. You should however not try to use
+ From the goals: “To stress C compilers with unusual code.” That
+describes exactly my modest attempts… This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/schweikh2/index.html Author: or What is the difference there? Run the program with a small argument, like 5 or 10, several times.
+Are the results different? Why? At the time of judging, some non-gcc compilers that were not fully
+ANSI standard did not compile this entry correctly. Also at that time,
+some gcc and egcs implementations ran into a problem when building the
+entry. Doing: often produced an error of the form: because the line: turned into the line: (note, though, how that line is on line 11) which caused gcc to give
+to the assembler the following two lines: and the lone In some cases one had to compile using to trigger this error. With the proper text beyond the If your compiler had this bug, you could transform the line in the C
+program to inject assembly instructions in such a way that the program
+would compile. If you were able to do that, you could have tried adding assembly
+instructions so that it will compile, execute and do something
+interesting (or uninteresting, for that matter :-) ). If you succeeded in doing that (especially on FreeBSD, Linux or
+SunOS/Solaris), you could have emailed the author for a free pat on the
+back (and maybe you still can :-) ). Because of this bug, the code was changed to be instead: However in 2023 it was observed that it is gcc (at least
+some versions?) that has a problem with the compilation of the
+modified program, giving an internal compiler error: so the line: was changed to: and now it works with both clang and gcc. My entry is a The For example: Ever seen a ‘do for … while’ loop? I avoided Even if you know how the program works, you just can’t predict
+the output. Chained use of token pasting operators So you think you can’t assign to All strings (or characters) needed are crammed into
+ Use of a Identifiers reused with different capitalization:
+ A quote from Kernighan and Plauger, The Elements of
+Programming Style, 2nd Ed., page 21:
+ Don’t you love the aesthetics of symmetry:
+ Each bit obviously depends on the number of times the loop body is
+executed between two calls of the signal handler. But what determines
+this number? How about the randomness of the It is interesting to note that I’m not surprised. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/schweikh3/index.html Author: The author stated: An alternate version allows one to fix this; see alternate code below. If Maybe you will not need to buy another 10 GB disk to store them.
+:-) If you’re in this winning entry’s directory: Notice that the tool finds some files that are duplicates. If you run into the problem that the author described (above) you can
+redefine the size as described; this was done with the If you wish to change the size to say, 55555: or whatever you wish to redefine it to. This program is not as smart as to detect identity of JPEG files with
+the same picture but with different compression levels. On the other
+hand compression can make a thing look/sound/feel different so these
+probably aren’t duplicates anyway. :-) Some time after this entry won, the Internet Systems Consortium (ISC)
+added the samefile utility to its treasure of software gems! See the
+author’s page about the tool as well at http://www.schweikhardt.net/samefile. The source is expected to conform to IEEE Std 1003.1-1990 (“POSIX”).
+Thank God the IEEE does not standardize a coding style… This is best explained in the man page. The troff source for this man
+page can be found in the file samefile.1. To
+render try: Otherwise: In the first stage, all non-plain files are silently ignored
+(directories, devices, FIFOs, sockets, symbolic links) as well as files
+for which In the second stage all files having the same size are compared
+against each other. The rules of mathematical logic are applied to
+reduce work and output noise: if files The sum of the sizes in the first column is the amount of disk space
+you could gain by making all 6 files links to only one file or remove
+all but one of the files. To be precise, disk space is allocated in
+blocks - you will probably gain two blocks here, rather than 200 bytes.
+Note that it is not enough to just remove For everybody: What are the duplicates under my home directory? For the sysadmin folks: Report all duplicate files under /usr larger than 16k: For the ftp and WWW admins: How much space is wasted below our site’s
+/pub directory? If Are you an algorithms guru? If so you should know why the output
+appears sorted without any use of Rewrite (hah!) the program to use memory mapping of files instead of
+ It’s easy to write a script that takes When you run In the remote event that the input has more than This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1998/tomtorfs/index.html Author: where: If you don’t believe the program is correct, try and compare the
+output of the program with the value of CRCs computed by PKZIP or any
+other archiver that uses the CRC-32 algorithm. The program assumes No special build options required. Count the number of non-whitespace characters in the source file to
+find out what dark force drove me to write this ;-). First of all, if you run a C beautifier on the program (thereby of
+course losing the nice code shape I worked so hard on ;-) ) the code
+will become a bit more readable. The variable names are not very descriptive. They have the following
+meanings: The first The rest of the program “simply” calculates the CRC in
+ Ross N. Williams, whose CRC guide was very useful to me for writing
+this. You can find it in crc.txt. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/anderson/index.html Author: This small program might be a nice addition to a digital personal
+organizer; just in case you are stranded on a desert island and need to
+signal your distress to passing ships. The obfuscation in this program is truly masterful. The program is
+very cleverly obscured without the use of a single In 2023 due to annoying warnings triggered at different times,
+sometimes interspersed with the output of the program (this happens in
+macOS), many entries were changed to use This program is a simple filter that translates ASCII text into
+semaphore code. It reads from standard input and converts all
+alphanumeric characters to their corresponding semaphore codes.
+Consecutive whitespace is translated as a single ‘break’ code. Newlines
+also cause the next code to be output on a new line. All other
+characters are ignored. The codes themselves are written to standard
+output as a depiction of a person holding two flags, using only ASCII
+characters (semaphore smileys, if you will). For example, given the
+input “Hello, world!”, the output will be: The program is obfuscated without the use of the preprocessor or any
+special compilation parameters. In fact, the program doesn’t even bother
+using any keywords, save the single The preprocessor will provide no help in de-obfuscating this code,
+and a C beautifier won’t get you very far either. You just have to
+crunch through it. An ANSI C compiler will generate several warnings when it compiles
+this program, as none of the functions declare their return type, nor do
+they return anything. This was necessary to keep the program free of
+keywords. It’s valid in K&R C, and compiles in ANSI C. There are
+also warnings about conversion from This program is a great teaching tool for learning the semaphore
+code; and if you don’t have any flags handy you can just use two copies
+of the source file. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/bellard/index.html Author: This code is a nice compact example of a Modular Fast Fourier
+Transform. While its output is very specific, the internal FFT has a
+wide variety of uses. Can you modify this code to produce primes such as
+ NOTE: as bigger primes are found as time goes by this program no
+longer prints the biggest prime once noted by the author below. This program prints the biggest known prime number
+( The program uses >= 64 bit This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/bmeyer/index.html Author: In a video window (white text on black background): The script will suggest you compare the output of the program with
+images, prompting you to press any key to continue so that you may do
+so. Don’t even think of supplying different compression factors (the
+dashed argument) for compression and decompression! You’ve been
+warned. The author recommended on linux/x86, glibc 2.0, libc4/5: However many compilers use And on linux/x86, glibc 2.1: Compile with the maximum possible optimization on your system. If
+your system has 80-bit internal representation of floating point values
+(x86, some Motorola processors) and you want the compressed format to be
+portable across platforms, you need to set your FPU to use 64 bit mode.
+Read the author’s remarks below for more details. If you cannot work out how to get into 64 bit mode, you can try using
+ The Makefile defaults to This program is called And that’s exactly what this program does — feed it a .PGM file
+(either raw [i.e. P5] or ASCII [i.e. P2]) on stdin, and it will output a
+compressed version to stdout. Feed it a compressed file on stdin, and it
+will decompress it to stdout — as either raw or ASCII .PGM, depending on
+what format it was compressed from. For example: and then As it turns out, If you still have trouble, simply use a terminal or xterm with more
+than 80 columns, and tell will allow Still running out of space? Need to compress those images just a tad
+more? And maybe you can handle some loss due to the compression? If so,
+you can use will compress in a way that allows decompression with a maximum error
+of two. You can combine both types of arguments, i.e.: will compress with a maximum error of 3, using a 180 column terminal
+for the progress display, and: will decompress the result on such a terminal. But wait, there is more — you can also feed Unlike most compression program, Fortunately, just about all current FPUs can be put into IEEE 64 bit
+mode (or at least something close enough for So, if you are building on a machine that does not, by default, use
+IEEE 64 bit floating point doubles, you’ll have to define Most of the obfuscation of this program was driven by the desperate
+struggle to fit all of In short — running it through the preprocessor and the pretty-printer
+will give you something that looks slightly less like line noise and
+slightly more like a C program, but unless you are a true wizard, it is
+unlikely to gain you any insights into what is actually going on….1 The .PGM headers are not checked very thoroughly —
+ When decompressing a near-lossless encoded image, the maximum allowed
+error is required as a command line parameter. This should really be
+saved in the compressed file! There is a theoretical chance that you might get a division by zero
+error. You have a MUCH better chance of getting hit by lightning the
+very second you realize that you just won a few million in a lottery.
+But if it happens to you, don’t say I didn’t warn you! Instead, go out
+and buy a lightning rod and a lottery ticket ;-) At one point, a pointer to An exhaustive explanation of the algorithm used would go beyond the
+scope of an info file, and would also be quite difficult in pure ASCII,
+so the following is just a rough outline, and contains some
+compression-speak… The image is handled in scanline ordering.
+For each pixel, an expected value is calculated by creating a least
+squares predictor of order 12 based on all of the previously
+encoded/decoded pixels. However, the contribution of each pixel is
+weighted according to its Manhattan-distance
+from the current pixel, In a similar way, the prediction errors for all previous
+pixels are combined — a weighted average (with weight
+ The predicted value and sigma are then used as the parameters of a Student
+or t-distribution (which is similar to a normal
+distribution, but has more weight in the tails), providing a probability
+distribution for the current pixel. Next, the possible interval of values for the current pixel is
+halved, and through integration of the probability distribution, a
+probability is calculated for the pixel value being in the lower half.
+During encoding, the actual value is examined, and the result encoded
+using an arithmetic coder. During decoding, the arithmetic decoder
+provides the information which half the actual value is in. In both
+cases, the interval borders are adjusted accordingly, the arithmetic
+coder/decoder updated, and the interval halving repeated until the
+precise value has been en/decoded5. Lavabus was taken by the judge, Landon Curt
+Noll. Michael was provided by the author. Lenna is a 1972 Playboy centerfold (doesn’t show
+very much). The author’s Godchild and nephew. A bus that was trapped by lava from Kilauea volcano in
+Hawaii, US. Nobody was in the bus at the time, BTW. Photo date:
+1981. A November 1972 Playboy centerfold was scanned in long ago and has
+been used for image compression research since then. Playboy originally
+threatened to prosecute unauthorized use, but eventually granted that,
+having been in use for image compression testing for so long, it was now
+a useful benchmark. (Note: This picture doesn’t show very
+much.) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ Yes, this could be seen as a challenge….↩︎ Actually, the weight is Obviously, these least squares predictors are not
+calculated from scratch for each pixel. Some clever reuse of earlier
+results allows As anyone who has ever tried local least squares knows
+from bitter experience, there is a lot of numerical instability
+associated with them. So In the case of near-lossless coding, the interval is not
+necessarily halved, but rather split at a convenient point (the
+split points are chosen in such a way as to minimise the expected number
+of bits needed for coding). Also, the iteration ends as soon as the
+interval is small enough to guarantee decoding within the requested
+maximum error.↩︎ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/briddlebane/index.html Authors: For some fun every time you log in try running this from your
+ One could argue that this program was a “diseased dumpster of tripe”
+but I suspect that would only result in the judges being heckled as a
+“scum-encrusted congress of obscurity” (but only if it was in the early
+evening of Dec 22, 2000). Can you find out how it stores the insult strings? Can you then take
+an insult and figure out when it will be uttered? This program was broadcast from deep within the Zarbonic Cluster and
+received at 9:03pm on March 21st, 2000 by Moxen N. Briddlebane. The
+original author, as designated by other components of the transmission,
+refers to himself simply as “Lord Zarbon”, though offers no information
+in relation to the significance of that post. The sole purpose of this
+program appears to be to degrade and humiliate the people of this planet
+by calling them names. It takes no input, it only produces a single line
+of slanderous output. The program appears to be rather confused, internally. It is unclear
+whether or not “Lord Zarbon” truly understands the mechanics of
+programming. What is particularly disturbing is the curious method of
+insult-encoding employed by this program. Furthermore, it is ambiguous
+how said data is arranged and why it is necessary to resort to
+trigonometric functions to handle it. One of the real mysteries involves
+the numbers This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/dhyang/index.html Author: A beautiful combination of solving several different problems, but
+mostly, the single most impressive layout we’ve ever seen. Many programs
+have one interesting layout; this one has four. It may be informative to run the code through a “beautifier”, to
+study it, but the layout itself is where most of the interest lies. This one is dedicated to Saitou Hajime fans Instead of making one self reproducing program, what I made was a
+program that generates a set of mutually reproducing programs, all of
+them with cool layout! For your enjoyment: To interpret the output: the dhyang.c is an
+image of Saitou Hajime, which eventually generates three sources files
+that are images of “aku soku zan” (sin swift slay), Saitou’s motto
+;) For best viewing, set tab spaces to 8 characters, and set your
+terminal fonts to as close to square as possible. I hate to do this but
+you know, size… dhyang.c and all its output compiles with gcc
+if your OS uses ASCII character set. No file is included and all
+functions assume default This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/dlowe/index.html Author: The following bit of perl may help determine the values you need: … just in case the Makefile does not figure this out for you. The current status of this entry is: For more detailed information see 2000
+dlowe in bugs.md. When this entry was submitted the rules of the IOCCC did not prohibit
+the use of embedded language interpreters. The judges considered
+disqualifying this entry because of the use of perl, but on the other
+hand it qualifies as the Worst Abuse of the Rules. As a previous winner*
+David Lowe continues to inflict the highest quality “poot” on the
+Judges. The program also contains an undocumented command for Chad and Chongo
+(Landon). The judges’ remarks contain a clue to the hidden command
+:-). This is a Reverse
+Polish calculator, loosely based on the This program understands the following And the following arithmetic operators are supported: The precision and range are double, like it or not, except that the
+modulus operator actually returns Commands are read from We all know that Perl and other VHLLs (very high level languages) are
+particularly well-suited for (among other things) string handling, I/O,
+and powerful built-in data types, and (relatively) poorly suited for
+number crunching and other processor-intensive tasks - areas where C is
+strongest. This program takes this knowledge to its extreme conclusion,
+using each language for its strengths. Thus, it uses Perl to read and
+parse input, for output, and for the easy-to-use list primitive, and
+uses C for mathematical operations. Since the rules of this contest
+state that the program must be generated by an ANSI C compiler, of
+course, the outer Perl layer is wrapped with a thin layer of C. In case that wasn’t clear, in a nutshell: this program is C, calling
+embedded Perl (contained in a C string), which in turn calls back to C,
+which performs math on Perl data types and calls Perl functions for
+error reporting. Unfortunately, Perl is an evolving beast - that includes the
+embedding API and the XS API. The code was developed under
+ It is also important that Perl be installed cleanly and correctly.
+You may have problems linking if, for example, you have multiple
+overlapping versions of Perl installed (which might not be a problem for
+scripts, but causes problems with embedding the interpreter). More
+commonly, you may get non-fatal warnings from the linker, caused by
+slight mis-configurations of Perl on your system. Some compilers also complain that “third argument of
+ Larry Wall wrote the original Perl in 1986-87, the same two
+successive years he won the IOCCC. I hope this program helps you to
+realize that this was no fluke - that Perl and Obfuscation are as
+inseparable as, say, camels and humps. Reverse Polish notation is pretty strange, in and of
+itself. The layout of the program is three roughly symmetrical “stacks”
+of code. This layout is quite sensitive in places - my C indenter
+actually breaks the code by inserting spaces in certain places. Anyone who has ever programmed in Perl can attest to the fact
+that it is particularly well-suited to obfuscation; thus, the Perl is
+obfuscated. (Here’s my favorite legal Perl from this program:
+ I’ve eschewed traditional branch and loop structures such as
+ I’ve used some highly magical Perl incantations, such as symbolic
+references, the I’ve also deliberately used Perl syntax that is very much unlike
+C syntax: the The fact that all the Perl code is in double-quotes doesn’t lend
+any readability to the regular expressions and quoted strings
+therein. The points and ways in which C and Perl connect are
+really obscure. They’re also incredibly poorly documented, as
+they’re primarily used in machine-generated code. However, there’s a
+wealth of example code on CPAN
+(www.cpan.org). The Perl API functions are almost all macros, so you will
+probably find that preprocessor expansion will only make things worse.
+They also have helpful, verbose names like Figuring out how the mathematical C functions get called is a bit
+tricky. Note the lack of explicit switching based on command
+input. Because of the “interesting” way that commands are interpreted,
+all of the commands have synonyms. For example, if you find it easier to
+remember, . The first IOCCC entry with an “easter egg”?… My original intent was to write obfuscated C and crystal-clear Perl,
+to highlight my bending of the rules. Unfortunately, Perl really doesn’t
+lend itself to crystal-clear code… Well, the rules never state that you can’t embed another programming
+language, but on the other hand, knowing Perl probably isn’t high on the
+list of qualifications for judges… Oh dear, I guess your C beautifier
+won’t help too much, either ;) If you don’t change the rules, it’ll be embedded Ada next year! A. Isn’t this the obfuscated C contest? What’s this Perl
+ D. Hey, this program is 100% C, and does not exec an
+external Perl interpreter. It simply links against the Perl language
+library. The “Perl code” is just a C string constant. A. Perl isn’t portable enough, or ubiquitous enough. D. I’d argue that it is more portable than X. According to the Perl
+folks, it runs on the following platforms: Acorn, AIX, Amiga, AS/400,
+BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
+Guardian, HP-UX, IRIX, LinuxPPC, LynxOS, MacOS, MachTen, Minix, MPE/iX,
+MS-DOS, MVS, NetBSD, Netware, NextStep, OpenBSD, OpenLinux, ODT,
+OpenVMS, OS/2, OS390, OSR, PowerMAX, Psion, QNX, Redhat, Reliant UNIX,
+RISCOS, SCO, SGI, SINIX, Slackware, Solaris, Sun, SuSE, Tandem, Tru64,
+UNIX, U/WIN, Unixware, VMS, Win31, Win32, Windows 3.1, and Windows
+95/98/NT/2K. Granted, embeddable Perl isn’t quite so portable, but
+still… Also, Perl 5 is bundled with the following OS distributions: AIX
+4.3.3+, FreeBSD 3.0+, IRIX 6.4+, every Linux distribution, NetBSD,
+OpenBSD, and DEC Tru64 5.0+, again according to the Perl people. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/jarijyrki/index.html Authors: You will need X11 header files and libraries installed to build this
+program. You will need a system capable of displaying the results of X Window
+programs. Then click on cell Click on cell Hit Now try running: And observe that it matches what you had in the previous run! NOTE: changing the dimension parameters (see the authors’ remarks)
+renders existing spreadsheet files unusable. This entry is one of those that makes you wonder why some commercial
+software needs tens to hundreds of This program is an X-Windows based spreadsheet program. The main
+functions it supports are: Use the ESC key. Click the mouse or use the arrow keys. The currently selected cell is always in the edit state. Press any
+key to add a character at the end of the formula; press backspace to
+delete the last one. Finish the formula with Finish the formula with To start the spreadsheet program with an existing spreadsheet, for
+instance finance.sheet, use the following
+command line: The file finance.sheet has been provided
+as an example. This file contains a set of financial numbers and two
+graphical entities - a pie chart and a histogram - based on them. We
+recommend starting the use of the program from this file, as a way to
+study and learn the formula language supported by the program. To start the program with an empty sheet, use Alternatively, Normally the user obviously wants to edit the spreadsheet. After the
+spreadsheet program finishes, it outputs the edited spreadsheet to the
+standard output. Hence, when the spreadsheet window has come up, you’ve
+made your changes, and you press the ESC key the program finishes. To
+save the results in a file, the following typical command line would be
+used: On top of the window the Formula Area shows the formula (or text) of
+the currently selected cell. The program starts with The example spreadsheet, finance.sheet,
+provided with this program contains two sets of numbers in the visible
+area of the spreadsheet. The top set of numbers forms the
+product-by-product turnover breakdown of an imaginary company. Below it
+is the yearly development of the company profits. On the top right
+corner is a pie chart showing the turnover breakdown in graphical form,
+and on the bottom right corner is a histogram showing the yearly
+development. If you scroll the window you can see additional data from
+the spreadsheet. Use arrow keys to move left, right, up, and down among the cells. You
+may also click the mouse on a cell to cause it to be activated as the
+current one. Note that it is not possible to move around the formula; the formula
+can only be edited from its end by adding or removing characters. Going beyond the borders of the window results in scrolling the
+current view. It is not possible to go up from the first row or left
+from the first column; but it is possible to wrap back to start from the
+last row and last column. The spreadsheet formulas operate on a stack. Operands of an operation
+(e.g. plus) are first pushed to the stack and then the operation is
+performed. If a formula on a cell produces exactly one result
+then that is shown in the cell. Otherwise, the formula is interpreted as
+a string and shown as it is. An example of a simple formula, simply specifying a number is Another simple formula refers to a cell: This particular example formula referred to the first cell of the
+first row in the spreadsheet. Arithmetic operations require both
+arguments: More complex formulae can be constructed by combining these simple
+ones: This example calculates the sum of the cells The currently selected cell is always in a state where it can be
+edited. Press any key to add a character at the end of the formula;
+press backspace to delete the last character. Any resulting
+recalculations are immediately visible. (Note how much nicer this
+feature is as you get used to it, compared to the behaviour of certain
+commercial spreadsheet programs.) The program supports two types of graphical representations of the
+data in the cells: pie charts and histograms. The pie chart can consist
+of any number of slices, and is constructed by putting the pie amounts
+in stack and using the This example would draw a pie chart of four cells, The histograms are drawn in a similar manner, by using the
+ The program detects recursive reference attempts, references cells
+not containing a numerical value, attempts to define formulas with zero,
+two, or more results remaining on the stack, and syntax errors of
+formulas. Note that typically as the user types in a formula, it toggles
+between valid and invalid forms dynamically as all single character
+changes are immediately taken in account. This is not dangerous, just
+complete the formula and view the results. Errors are signalled by showing the formula on a cell instead of the
+numerical value supposedly returned by it. Division by zero results in an IEEE Inf number. This section explains the meaning and rationale for the compile time
+parameters: These definitions can be used to change the user interface of the
+program with respect to special keys. The first four define the movement
+operations and the latter two define the program termination and
+character deletion keys. Typical modifications to these parameters
+include changing character deletion to the key the user is most familiar
+with, which could also be This parameter defines the maximum dimensions of the stored and
+handled spreadsheet (but see section 4.4 for a warning about changing
+this without thinking about the consequences!). This parameter defines the maximum length of a formula in one cell.
+Note the warning in section 4.4. Defines the number of bytes in a spreadsheet file. The number is
+automatically adjusted when the spreadsheet size parameters are changed.
+Note the warning in section 4.4. These two parameters define the visual dimensions of a cell. Changing
+these may be necessary on your system if the default font sizes differ
+from those in the systems we’ve tested the program with. This is the x-indentation of text inside a cell. Changing this may be
+necessary to suit other font sizes and different X environments. This is the y-indentation of text inside a cell. Changing this may be
+necessary to suit other font sizes and different X environments. This parameter is the number of cell rows visible at one time. This parameter is one smaller than the number of cells columns
+visible at one time. These parameters are the window x and y sizes of the spreadsheet
+program window. With these definitions, they are automatically
+reflecting the at-one-time-visible cell row/column amounts. Hence, we
+recommend changing the It’s better to just read the code. But note the use of stack in the
+implementation of What does The given Makefile may have to be edited to insert correct library
+and include file path names. We’ve tested the program with a limited amount of X servers. It is
+possible that other systems use default font sizes or other parameters
+that cause the visual looks to be different or perhaps even unusable; if
+this happens, changing compile-time parameters explained in section 2.8
+might help. The size of the window as it comes up - a parameter as defined in
+compile-time - has been set suitable for a small laptop screen. Larger
+screens may benefit from setting these parameters higher. Smaller
+screens require changing the parameters so that all of the window
+becomes visible. The size of the read, manipulated, and stored spreadsheets is defined
+by a compile time parameter. However, changing this parameter is not
+entirely trivial. The following constraints apply: Horizontal (alphabet) dimension handling will always be A to Z
+regardless of the actual allocated memory area. Any change in the dimension parameter renders existing
+spreadsheet files unusable. The software relies on running on ASCII-based code system. Why?
+Because The use of single character (e.g. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/natori/index.html Author: An alt version exists for those in the southern hemisphere (or those
+who want to see what it would be in the southern hemisphere). See alternate version below. Also try modifying the code so that it will show another Moon phase
+based on input or else just by the code itself. Bonus points if you can
+make it show all~ The author noted that those in the southern hemisphere might want to
+change To run the alternate code that supports the southern hemisphere: What happens if you run it in the northern hemisphere? Are there any
+differences? Can you identify any Moon phases that result in the same output of
+both versions? Or are there any? Here is a nice compact program that changes with the phase of the
+Moon. Can you figure out how it does it? The ANSI-C committee, among their multiple misdeeds, broke perfectly
+fun C programs by making it intractable for them to declare their own
+non-traditional prototype for This program outputs a rough image of the moon in its current phase.
+The main obfuscation of this entry is its complicated double recursion
+(without any loop or conditional statement). People living in the southern hemisphere may want to change
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/primenum/index.html Author: The current status of this entry is: For more detailed information see 2000 primenum in bugs.md. NOTE: Don’t read the author remarks until you’re ready for the spoiler.
+Just stop and read the program; it won’t take long. Once you’ve figured
+out what it does, run it. It may surprise you. This entry won, not because the obfuscation is impenetrable, but
+because it successfully fooled half of the judges, including me. For 15 years, IOCCC winners have obfuscated programs using esoteric,
+difficult-to-interpret, confusing algorithms. This entry finally bucks
+that trend and obfuscates in the most “obvious” way possible: by
+painstakingly describing the algorithm in clear pseudocode. Even novice
+programmers will recognize that the program should find and print prime
+numbers up to a given number (as specified on the command line). But novice programmers especially know that mistakes are often made
+in translating pseudocode to real code, often resulting in programs with
+unexpected and confusing output. Clearly, the program contains several
+syntax “mistakes” (e.g. As a result of these “bugs”, the program does not calculate primes at
+all. Instead, the program reads input from where n is the same number (modulo 64). So, the prime number
+generator is actually a simple text encoder/decoder! Of course, don’t
+forget that argument, otherwise the “bugs” in the program will cause it
+to crash! The program attempts to mislead the reader into thinking that it
+generates prime numbers. It does this by: The program demonstrates a novel method of abusing the C
+preprocessor. Determining how the filter algorithm works is left as an exercise
+to the reader. OK, so running it through the preprocessor strips away the prime
+number front. But ye be warned: “not a11 variab1es1es are identica1”
+:-) Other features include Try also
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/rince/index.html Author: The current status of this entry is: For more detailed information see 2000
+rince in bugs.md. If This is supposed to happen. As is written in the The Jargon
+File: This will run the program several times with different parameters to
+show different types of things. See the author’s remarks for more
+details. This program may have you going around in circles :-) Try running it
+first before reading the author’s remarks below. The judges verified the correctness of output for recent dates
+through visual observation. The simplest way to run it is with no arguments. Just type: You will need to have access to X windows, although it doesn’t
+require desperately high resolution and there are no known limitations
+on colour depth. The display will change slowly over time, although it may take 10
+minutes or more to be visible. For those that cannot wait that long the
+program has a built in time machine. Indeed the program knows the speed
+of light, which is used to ensure that we see the “live” pictures.
+Simply specify the fraction of a day to skip forward for each screen
+refresh. I suggest: To display the output (still guessing?) for a given date, specify two
+arguments. The first argument is as before and the second argument is a
+Julian day number (given as a fractional component). E.g.: A Julian day is defined to be the number of days since January 1st in
+the year This program plots the positions of the four Galilean moons
+of Jupiter, as seen
+from Earth. It doesn’t
+correct for your location on Earth, but I assure you that the parallax is
+minimal! The moons are labelled with Roman numerals from Amazingly, all it takes is a pair of binoculars to see the Galilean
+moons, so the results can be experimentally checked. (Note that at
+present, the best views of Jupiter are over the autumn/winter.) The positions of the moons should be correct for binoculars, but
+possibly not if you have a telescope or if you are in the southern
+hemisphere. In that case I suggest that to get the correct image you
+look at the screen from inside the monitor whilst standing on your head.
+In case of confusion, please consult the following chart (*): (*) Not to scale. Galileo discovered the moons in January 1610. https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm
+states the following: Thus we can plot Galileo’s discoveries using the following three
+plots: However we can go one better by seeing what Galileo would have seen
+if it wasn’t cloudy on the 9th. Try: to see what he was missing out on. I wonder what he’d have made of
+that! Galileo discovered the fourth moon a few days later. I’ve tried typing these dates into two Java based Jovian moon
+plotters, but both I tried had problems dealing with dates earlier than
+1900. More professional software, such as the SkyMap gets these
+values correct and this compares well with the above description and
+with this IOCCC entry. The year 4713BC was chosen by Joseph
+Justus Scaliger in the 16th Century, so clearly this program has a
+long history :-) A more complete description of the origins of Julian
+Days can be found at https://web.archive.org/web/20001206152200/http://aa.usno.navy.mil/AA/faq/docs/millennium.html. This program assumes: The ASCII character set is used. That an enormous comet hasn’t changed the course of Jupiter (or
+Earth!). That the date has not been specified as the gap between the Julian and Gregorian
+calendar. That the There is a year 2000BC problem :-) More specifically, the plots for dates that far back are too
+inaccurate to be of realistic use. Comparisons against SkyMap Pro show that
+there is a good similarity (but not much more) up to about
+500BC. The code definitely is not portable - it will produce incorrect
+results if run from the surface of Mars. In addition to the normal obfuscations, I feel that the code contains
+some less common tricks. Taken through the standard rounds listed in the
+guidelines, the code attempts to pass
+these as follows: Look at the original source With luck, pure casual inspection should not reveal much except that
+the program contains the X Windows logo (a big clue) and contains a
+date. This date may give a clue to a few people that this is an
+astronomical program. Unfortunately I was stretched for space which meant that the large
+string constant could not be split up using a “partA” “partB” method
+which clearly limits the code layout. However the space saved by using a
+single long string constant is more than outweighed by the ability to
+further obfuscate. convert ANSI trigraphs to ASCII These are not used. C pre-process the source ignoring C pre-process the source ignoring This does a good job of expanding out the code, but it does not
+clarify things greatly. The use of Additionally, the use of Run it through a C beautifier. GNU Examine the algorithm. The algorithm operates on two levels. The main visible level is by
+taking a large string and breaking this down into a series of opcodes
+(which I have termed J-code). These are then executed. To get to the real method of how it works, you need to decode the
+opcode string (which deliberately contains as many Sensible people amongst you will simply refer to the referenced book
+:-) Lint it. I no longer have lint, although I do have access to Purify. I’m happy
+to say that purify does not detect any memory errors or memory
+leaks. See below for compilation warnings. Compile it. I’m sorry to say that there are several warnings issued by the
+compiler. Firstly, the return type for The 6th argument of Note that I make use of In addition to the above, the program has the following useful(?)
+obfuscations: The algorithm requires many floating point numbers (about 50).
+These are encoded as ASCII. The J-code algorithm has opcodes designed to be space saving.
+They are all one byte, but many are also considered as whitespace by the
+rules. This algorithm forms part of the same string that the floating
+point constants are embedded within. What does the The J-code language is both stack based and variable based. This
+“uncleanliness” is not ideal from a computer science angle, but when has
+cleanliness been considered as good in IOCCC? :-) Association of unconnected data by implied function usage. E.g.
+use of As we already have a dependency on ASCII this has been abused
+further. Specifically some integer constants are specified as ASCII and
+some ASCII constants are integers. This hides the true meaning for the
+values. Red herrings: there are a couple of pieces of code whose
+appearance is just there to mislead the infirm of mind. I’ve only tried
+to include such examples in places where at first glance the code
+appears to be executed. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/robison/index.html Author: The program plays almost always reasonably, but does not always
+detect illegal moves. Try “9 1” as your first move, then “13 2”. Also it
+tends to think for quite a while in the beginning of a game. It is also
+smart enough to give up by making a losing move at the end of a game
+when its position is hopeless. Unfortunately, due to the contest rules, we’re unable to grant the
+author a patent he applied for. :-) Highly Compressed Program for Playing Hygienic Checkers The present invention generally relates to checkers. Within the field of Checkers, the problem
+of finding a hygienic opponent is difficult, as good opponents are
+peculiar to the tavern habitat of cracker-barrels, pot-belly stoves,
+tobacco, and spittoons. The present invention plays Checkers without
+spitting. FIG. 1 shows a numbering of positions. FIG. 2 shows a numbering of directions. FIG. 3 shows a sample board. FIG. 4 shows a method in accordance with the present invention. Operator plays Black ( A player loses if they cannot make a legal move. Said loss is
+trivially true if player loses all of his/her pieces. The present
+invention announces said loser. FIG. 4 shows a C program in accordance with the present invention.
+Control flow is straightforward: control enters routine
+ The disclosure here describes a particular embodiment of the present
+invention, and other embodiments within the spirit of this disclosure
+are possible, as well as consumption of spirits while playing. I claim, by letters patently absurd: A method for playing checkers on a computer-based system, where
+said method’s source code fits into 1536 countable bytes of source code,
+where a byte is countable if The method of claim 1, further comprising a method of alpha-beta
+pruning that exploits the zero-sum nature of the game to unify alpha and
+beta cuts. The method of claim 1, further comprising the step of formatting
+the source code with short lines, in order to impress the manager with
+high productivity, when measured in lines of code. The method of claim 3, further comprising the step for telling
+the skeptical manager that this is the well-known technique of “linear
+programming”. The method of claim 1, where The method of claim 1, further comprising a method where A method for a computer-based system that uses a single shared
+code sequence to either sum a plurality of bits in an N-bit word or
+reverses them, in lg(N) time, depending upon a parameter. [See attached listing.] This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/schneiderwent/index.html Author: What’s the difference? Very nice play by the rules and portable text obfuscation. This far
+surpasses old tricks like adding or subtracting 1 from every character
+in a C string. Translating the messages into your language of preference while
+keeping the program portable between different encodings (Chinese,
+Japanese, Russian - anyone?) may be an entertaining task. This entry displays the current time to the console, for example: it’s just after ten ’til 6 in the evening FWIW, none of the compilers with which this entry was tested issued
+any warnings or errors in compiling the source for this entry. No doubt
+lint will complain about the goto statements. The schneiderwent.data file consists
+of the values used by multiple table lookups. This is simply good
+program design, separating these values from the source code allows
+changing the behavior of the application without recompiling. Having learned COBOL at an early age, the Obfuscation in this entry consists of: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/thadgavin/index.html Authors: NOTE: if you don’t have curses or SDL1 installed both modes will fail
+to compile. In that case see the FAQ 3.8 - How do
+I compile an IOCCC winner that requires SDL1 or SDL2? and FAQ 3.9 - How do I compile an IOCCC winner that
+requires (n)curses? for more information. We recommend that you use the alternate code so you can see what this
+entry looked like back in 2000 (with a configurable speed). See the original code section for the original
+entry. You can press ‘q’ at any time to exit. If you have SDL1 installed: Whereas the curses version has an early exit the SDL version does
+not. You will have to kill it yourself. You might also wish to reconfigure the speed at which the programs
+run. The code calls To change the SDL one to something like and to change the curses one to Then use the program(s) in the same way. The different macros is because the curses version is already much
+slower and so it’s better to not tie the two values together. You may of
+course redefine both in the same command. WARNING: if you are sensitive to rapid movement or if you want to see
+better what is going on then please use the alternate code as described
+above. If you wish to see the original entry see below. NOTE: in curses mode you might want to type If you have SDL1 installed: This entry is a nice play by the rules. It can use curses, if the SDL
+graphic library is not present, and is quite good at that, but the
+colors used in graphic mode (16 bit depth) are unfortunately less than
+dazzling. We could not test this entry in DOS mode. Compile using DJGPP as follows: In gcc you might get the following warning: In Microsoft Visual Studio you may get warnings as follows: But don’t worry, this is completely normal. At least 3 minutes taken 3 times a day when tired. Do not exceed 3 times recommended dose. May cause sickness,
+dizziness, nausea. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/tomx/index.html Author: There is an alternate version that compiles mkentry.c. See alternate
+code. This alternate code is based on the author’s remarks with a slight
+fix so that it will do what it once did, compile and run mkentry.c. You can use it in a similar way as tomx.c, both executing the source file and using it as
+a Makefile and running the code ends up running
+ Polyglots have come and gone, but this was the first one we’d seen
+where one language used another to perform its tasks. An
+interesting approach. Admittedly, it’s not all that obfuscated - but
+there’s more to it than you might think, since you have to make sure
+that your changes don’t change the shell code or the Makefile. This program works as a C source file, a Makefile and also as a shell
+( Probably, this is the first entry ever to fully satisfy Rule #1
+(“Your entry must be a complete program”) in the strictest sense;-) A glance at the source itself will tell you that most of the
+Obfuscation is NOT in the C code per se, but in the comments to the C
+code. (But sadly, I could not find an “International Obfuscated C
+COMMENT contest”. So I HAD to send this entry here to the IOCCC
+itself). Of the 3 languages in the source, the least obfuscated is C (But
+again, there was NO obfuscated make/shscript contest) (Does this hint
+for a rule in IOCCC-2001 that the major obfuscation should be in C and
+not elsewhere???. Mmmmm…). Extending Argument #2… Obfuscation done in the C code (comments?)
+creates obfuscated code for the other 2 languages. This opens new
+possibilities to be explored in depth in future
+ LOOKS like a Makefile, WORKS like a shell script and COMPILES
+like a C program. Does something useful (See Notes #1 and #2 below). Ain’t that useful? By extending this program’s idea, It is possible to do some very
+interesting things like generating C code on execution by adding
+additional code in make/sh (open up a loop????). This opens the
+possibilities of generating & compiling some (obfuscated?) C code.
+(Maybe should try this if this program fails at IOCCC 2000) Changing the Interesting things to do: try Be careful about the tabs in the source code. Removing them or
+converting tabs to spaces can be disastrous. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/anonymous/index.html Author: The programs that this program is supposed to act on, anonymous.ten.c and anonymous.bed.c, compiled with
+ The current status of this entry is: For more detailed information see 2001 anonymous in bugs.md. NOTE: if the 32-bit version cannot be compiled the script will at
+least compile anonymous.ten as a 64-bit
+program (or whatever your system is set to) and run it directly. What happens if the x86 program has already been modified by this
+program? The judges’ remarks below might give you a hint! What happens if you try it on another file like anonymous.c? Can you recompile it okay? What if
+you run it on In the case you you wish to manually compile the extra programs as
+64-bit code you may do so. Using the entry on these binaries will very
+likely crash the program or do something terribly wrong like
+slaughtering all the elves of Imladris! :-) so
+please don’t do that :-( The author suggested that this might somewhat destroy the
+binaries this touches but after the fix of 2023 this was not observed
+(yet?). It does indeed modify the files (though not all files are
+modified: can you figure out why that is?) but using them after did not
+result in any problems. It could be that it’s no longer known exactly
+what is supposed to happen and possibly that the modification might not
+be entirely correct for that reason though it does appear to be
+correct. It appears that the corruption happens only if the modification fails
+in the middle of doing so so that might be why it hasn’t been
+observed. Is emulation the sincerest form of flattery? This small program does
+quite a lot of bit twiddling. This program is an optimizing dynamic binary translator, allowing you
+to run x86 programs on any machine (x86 or otherwise). I have included a simple 10
+Green Bottles program (try
+ The program Note that the translator screws around with the binary you run on it
+and might corrupt the binary to some extent and in so doing
+might leave any program you run on it unusable. The build script should give an example command to compile the
+program. Basic Block
+Cache:
+Rather than translating each instruction individually the dynamic binary
+translator generates a translation for an entire basic block of subject
+code. Having translated a block once, the target code generated will be
+stored for the duration that the program is running, so as a program
+runs its performance will improve, as it hits cached blocks. This can be
+clearly observed in the example program, anonymous.ten which must be compiled as a
+32-bit ELF binary. The program runs dynamically
+linked ELF
+binaries, and when the subject program attempts to make a call to a
+standard library,
+the translator attempts to make an appropriate call to the native system
+libraries on the target machine. This involves mangling between
+different calling conventions, etc. There are various problems raised when attempting to run little endian x86 code on a big endian
+chip, such as a PPC.
+These problems are dealt with in a manner that is entirely transparent
+to the user. By default the build script should compile the program with a set of
+switches such that while compiling the program it generates one error
+(which I feel is useful advice). The program should generate no further
+compiler errors while it is running (yes, the program can generate
+compiler errors while it is running). If you do not wish to see this
+error, or if the program generates any further error when compiled using
+your C compiler please remove the The build script contains a The most obvious part of the obfuscation is probably the mess of
+ Buried under all this, and the fact that the entire program is just a
+call to There is also quite a nice trick where I wave a magic wand, and a
+chunk of code which should only be run when the program is run for the
+first time (setting the PC / IP to
+point at Due to space limitations only a handful of instructions are
+supported; these instructions which are supported are supported in
+somewhat non-conventional ways: chunks of the architecture (e.g. flags)
+are just ignored, the ELF loader does
+not really load the ELF
+binary, the target library
+linking can only pass up to 3 parameters to the target library
+function, etc. In short, please consider this a full disclaimer for any bug that may
+turn up - yes the program is unsafe, but it’s pretty cool anyway. Despite all this, the translator is not exclusively limited to
+running the anonymous.ten program. Other
+trivial x86 programs may run on the translator
+- and I have successfully run a wide range of “Hello World” programs,
+including one of last year’s IOCCC winners, tomx. The fact that the program makes calls to Enjoy and thanks! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/bellard/index.html Author: The current status of this entry is: For more detailed information see 2001 bellard in bugs.md. You can use it by typing: or by giving the C source to its standard input. An alternate syntax is to use it as a script interpreter: you can put
+ binary operators, in decreasing precedence order: Parenthesis are supported. Unary operators: Pointer indirection ( Function calls are supported with standard
+i386 calling convention. Function pointers are
+supported with explicit cast. Functions can be used before
+being declared. Types: only signed integer ( Any function or variable from the libc can be used because
+ Instructions: blocks ( Identifiers are parsed the same way as C. Local variables are
+handled, but there is no local name space (not a problem if different
+names are used for local and global variables). Numbers can be entered in decimal, hexadecimal ( C Strings and C character constants are supported. Only
+ C Comments can be used (but no C++ comments). No error is displayed if an incorrect program is given. Memory: the code, data, and symbol sizes are limited to 100KB (it
+can be changed in the source code). No special effort was needed because obfuscation is almost
+unavoidable for such a program :-) It was successfully compiled with gcc version 2.95.2. You get some
+warnings because old K&R prototypes are used, some casts are
+implicit and some functions are used before being defined.
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/cheong/index.html Author: Be sure to give an even number of digits in the argument. Add a
+leading 0 if needed. The source code is nice, compact, and self documenting as all good
+programs should be! :-) Compile normally and run with one argument, an integer with 2n
+digits. Program will return the integer part of its square root
+(n-digits). For example, Deviation from these instructions will cause undefined results.
+:-) This program runs normally on any ANSI C compiler and is ASCII
+dependent. Strict compiling gives just one unavoidable warning: The main obfuscation is the algorithm used to calculate square roots,
+sometimes known as the longhand method. The basic algorithm is itself
+obfuscated in that it only uses subtraction to calculate square roots.
+For a detailed explanation, check Google or see Jack Crenshaw’s article
+at https://web.archive.org/web/20011215124349/http://www.embedded.com/98/9802fe2.htm. This program uses an even more obscured version which includes the
+following: Thanks goes out to Bobby Rohde for numerous suggestions on how to
+shorten the program. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/coupard/index.html Author: If you have access to If you do not, first install sox. If you use macOS you
+might install it from MacPorts or
+Homebrew. Then you can try: You may need to run this a few times to understand exactly what is
+being said. You might even need to look somewhere on your desktop, your
+arm or the wall for confirmation. Past years’ IOCCC entries do many marvellous things in small
+packages, such as console utilities, games, math, languages or even X
+applications. But they all have one thing in common (despite being hard
+to read obviously): when they interact with the user, they only
+display things, i.e. they display either text or drawings. So, for a change, this program titillates the sense of hearing
+instead of sight: this program is a self-contained speech synthesizer
+that tells the current time through the computer’s sound card - in just
+under 2 Kb of source code ! In the 2001 IOCCC rules and guidelines documents, there is no
+mention of what is or isn’t acceptable regarding audio I/O, but it is
+mentioned that hardware-specific and/or non-portable programs are not
+welcome. So, in order to do audio and satisfy those requirements, the
+format required by To listen to what the program says directly, invoke The program then speaks out something like The time is HH hours MM minutes SS seconds in military time (24 hours). Of course, you need to have permissions
+to write to If you want to convert the audio output of the program into another
+audio format, you can pipe it to SoX for example
+( converts the output of the program into a 44.1KHz stereo .WAV file
+and saves it into The output format of the program is 8KHz, unsigned 8-bit samples. NOTE: the program’s return code is meaningless. The quality of the sound produced by the program is cross between a
+yogurt-pot-and-string
+telephone and a bad gramophone, i.e. the
+S/N ratio is very low and the signal’s top frequency is very low as
+well. This is because the audio is stored internally at a sampling rate
+of 4KHz (the Nyquist
+frequency is only 2KHz) with only 4-bit samples (adding 24db of
+quantization noise to an already poor signal). In short, you might have to listen twice to understand what the
+program is saying. 2048 bytes including the sound generation program
+doesn’t leave much room for audio quality ;-) Only 9 phonemes are used to generate the speech. Beside the limited
+number of words the program has to generate (66 words), the low sound
+quality is actually exploited to take liberties with certain consonants
+(for example, Internally, a table is used to generate most of the words, and
+composite words such as “thirty-five” are made up by the C code
+externally. Even at 4KHz / 4 bits, the weight of all the phoneme samples and the
+word-to-phonemes table put together is over 1600 bytes, which is well
+over 2048 bytes when encoded in a C string made of printable characters.
+Therefore, a compression method was needed that’s both efficient and
+with a decompressor that is implementable in the shortest amount of code
+possible. GSM compression is very good, but needs large psychoacoustic
+tables to regenerate the original signal. Raw FFT spectral compression
+is efficient too, but the decompression code can’t be made small
+enough. The best compression compromise was found using a simple Huffman
+compressor, and encoding the compressed data by blocks of 13 bits in
+pairs of printable ASCII characters: the raw data is compressed to 8465
+bits, and the resulting C string is therefore about 1300 characters,
+which leaves just enough room for the decompressor with a hard-coded
+Huffman tree, and the code that plays the phonemes in the right
+order. The program should build with When linting the program with This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/ctk/index.html Author: There is an alternate version with vi(m) key movements. See alternate code below. This alternate version adds to the movement keys No matter how careful you are, this guy eventually crashes. Most
+people can make at least one successful road trip without crashing. This is, of course, another of the retro games. This is a game based on an Apple II Print Shop
+Companion Easter
+egg named ‘DRIVER’, in which the goal is to drive as fast as you can
+down a long twisty highway without running off the road. Use
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/dgbeards/index.html Author: There is an alternate version based on the author’s remarks. See alternate code below for more details. The current status of this entry is: For more detailed information see 2001 dgbeards in bugs.md. The author provided a way to speed it up a bit and also how to make
+it so it doesn’t crash on losing. The idea that it crashes on losing was
+too good to lose but this alternate version has the former change. If
+you wish to remove this you can look at the author’s remarks and make
+the change. See if you can figure out how to make the computer always lose (‘win’
+:-) ). It’s a very simple thing to do. Read the author’s remarks for
+clues. This game crashes if it loses. This is supposed to happen. As is written in the The Jargon
+File: This is probably the worst AI we’ve ever seen. So, then, why did the
+entry win? Because it’s trying to lose. This is also one of the first chess games we’ve seen. Of particular interest is the author’s decision that the program
+should crash if it loses. I’ve played chess with a lot of people like
+that, and I appreciate the realism. BTW: if your goal is to lose and you do does that mean you win? :-)
+What does winning mean in a game you’re supposed to lose at? A: It lets the user play two player or single player games of suicide chess.
+Suicide Chess (also known as Losing Chess) is a variant of normal chess.
+It is played on the same board and uses the same pieces. Here is a list
+of the differences: The object of the game is to get to a position where you have no
+legal moves. This is usually accomplished by losing all of your pieces.
+Sometimes, the game can end when you still have some pawns on the board,
+but they are blocked and cannot move. The general rule is if a player
+has no legal moves, the game is over. The winner is the player with
+fewer pieces on the board. This is almost always the same player that
+had no moves, but not always. In suicide chess, piece captures are compulsory. If a player can
+capture an opponent’s piece, he is required to do so. If he can capture
+more than one of the opponent’s pieces or can capture one piece with
+more than one of his own pieces, he can choose which capture to
+play. The king is not significant. There is no concept of check and the
+king can be captured. Because of rule 3, pawns are allowed to promote to a
+king. Castling is not allowed. A: The program is fairly straightforward. When you start the program,
+it displays the opening position for a game of suicide chess and waits
+for user input. Commands are as follows: Moves are represented by the long algebraic notation for the move.
+For those not familiar with long algebraic notation, a move consists of
+a square to move from followed by a square to move to. Squares are
+denoted by a letter and a number. The letter specifies the column or
+file of the square and the number specifies the row rank. Files are
+named from left to right by the letters You can also specify a command line argument of a single digit to
+change the search depth of the program. If no argument is specified, it
+defaults to a depth of 3. A: Yes. The first of the limitations is that you can only play legal
+moves according to the rules of suicide chess. En passant captures are
+not recognized. They are rarely encountered in suicide chess and when
+they do happen, they usually do not change the outcome of the game. As
+mentioned above, castling is not allowed either. It also does not detect the end of the game. It can see sure wins or
+losses several moves ahead, but does not announce the end of a game or
+the winner. Given the existing code it is easy to do this, but it was
+deemed unnecessary fluff. A: Playing strength is a relative term. Relative to other computer
+programs that play suicide chess, it is about the bottom. There is one
+freeware program in existence called Suicide chess is a very tactical game. Most humans who do not have
+any experience in suicide chess will lose to this program. The Free Internet Chess Server is a free
+online chess server that supports suicide chess. This server keeps track
+of ratings. The human ratings for suicide chess range from 1000 to about
+2400. This program would probably be rated somewhere around 1700-1900.
+It is better than most players, but will get destroyed by experienced
+human opponents. This program searches to a fixed depth of 3 ply. Because
+it does not search very deep, it performs very poorly in quiet strategic
+positions. In such positions, it will often just shuffle pieces around
+aimlessly until a tactical exchange presents itself. A small amount of randomness has been added to make the program a
+more interesting opponent. To avoid a call to A: Here are several reasons: First, without preprocessing, the code is not easy to read. The
+preprocessor is used to compress the code and obfuscate it. The main
+obstacle to entering this program is the source code size limit. This is
+the reason that the preprocessor was used so liberally. It is one of the
+best ways to compress C source code. Second, when possible, variables in the program were made global.
+Their names are not descriptive and they are used for a variety of
+purposes throughout the program. Because of this, it is difficult to
+determine exactly what the code does even after preprocessing and
+beautifying the code. Third, all function names are a single character and are obviously
+not descriptive of they’re actual purpose. Again this serves the dual
+purpose of compression and obfuscation. Fourth, most string variables have been encoded. This encoding serves
+to obfuscate the program as well as reduce the number of countable
+characters and get the program under the size limit of this year’s
+IOCCC. There are some places where other simple encoding methods are
+used to hide the real purpose of strings. These layers of obscurity
+cannot be penetrated by just preprocessing and beautifying the
+program. Fifth, various small obfuscations have been used in places all over
+the program. Short circuit evaluation is used as a substitute for
+ Last, if you have succeeded in wading through the previous layers of
+obfuscation, you are confronted by the fact that the game that it
+implements is an obscure game. Casual inspection of the program might
+lead one to believe that it is an implementation of classic chess, but
+this is not so. A: When compiled with The The The other warnings are there because it would require more code to
+eliminate them and that can’t be done given the size limit. A: What better way to admit defeat? The author thought this was
+appropriate sportsmanship for a program of this genre and can think of
+no worse job than trying to find an elusive bug in an intentionally
+obfuscated program. [Judge’s note: This was followed by a description of the bug, and the
+comment:] Note, if this program wins, the author thinks it would be good to
+leave this information out of the remarks and encourage others to try
+and figure it out for themselves. [Should you be too lazy (or time-efficient or affected by ‘real life’
+:-) ) to figure it out yourself, here’s the author’s fix.] This bug can be fixed in a number of ways, but there is a way that
+adds only one byte to the source code. In the statement
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/herrmann1/index.html Author: The current status of this entry is: For more detailed information see 2001 herrmann1 in bugs.md. NOTE: this entry seems to rely on older versions of gcc for the
+compilation stage and as such if you wish to see that part like it was
+designed you will need an older compiler perhaps gcc 2.95. -or- There are some clear hints in the source code as to the purpose of
+this program. Perhaps the only way to figure out what is going on is to
+look at the differences between the runs of the C preprocessor! Computer
+Science students should recognize what is going on. Many cool things have been done with the preprocessor,
+e.g. calculation of prime numbers or the Tower of Hanoi. However, up to
+now, no one proved that the preprocessor is Turing complete, and I
+wondered why. Well, the answer is simply that the preprocessor is
+not Turing complete, at least not if the program is
+preprocessed only once. This is true even if the program is allowed to
+include itself. (The reason being that for a given program, the
+preprocessor has only a finite number of states, plus a stack consisting
+of the places which the file has been included from. This is only a
+push-down automaton.) Well, this entry is a Turing machine implemented in the
+preprocessor; so of course, it has to be preprocessed several times.
+Here are the main features: Easy to program: Write your own Turing programs in a nice
+syntax. Easy to debug: (some) errors in the Turing machine program will
+be reported nicely. (That’s something which is not often seen in IOCCC
+programs.) Ultra-fast: The resulting C program will print the output in time
+ And best of all: During the preprocessing, watch the animated
+Turing machine running over the tape and doing its work in your
+terminal! The info files and watch the animated Turing machine multiply 8 by two (in unary
+representation). Here’s a screen shot during compilation: (As on real videos, you’ll see a bit of “white noise” at the
+beginning and at the end.;-) After compilation has terminated, type
+ Final tape: (Note that the last frame of the animation is not the final
+result.) In the previous example, the Turing machine started on the default
+tape of the program (The If you just type: and run the program, you’ll get a usage message (and the return code
+will be 2). Note: To get a really nice animation, you’ll need a terminal which is
+able to scroll fast enough. Now, let’s assume you want to write a program which adds 1 to a
+number in unary representation. (That is, a row of I’s is expected, and
+one more I is appended to the row.) Let’s call it
+ Some explanations: - The tape alphabet is always O and I. - The
+states can be anything starting with “st”. “start” and “stop” are the
+start and stop states, respectively. - To define a state, use two lines:
+one for each letter on the tape. You may omit one of the lines if the
+Turing machine will never enter the state reading that letter. (In the
+example, the line defining Now, the program can be used with But what happens if no tape is provided? Up to now, the Turing
+machine would start on an empty tape (that is, a tape filled with
+ to your program. When writing long programs, the most common errors are to forget to
+define a state or to misspell one. Let’s assume you forgot the line Remove it and type The output will be Undefined state start. Tape: and the return code will be 1. As you can see, the Turing machine
+moved over the Note that other kinds of errors can cause compilation to fail. If
+this happens, the build script will write the error message of gcc into
+a file called In principle, the build script simply runs the preprocessor over and
+over again, until nothing changes anymore; then, the program is
+compiled. After each preprocessing step, the script outputs the
+beginning of the program; this is where the animation takes place
+(except in the first and last few steps). However, there’s a technical problem to overcome: Some compilers
+(including gcc) insert a lot of white space during the preprocessing.
+This is bad for two reasons. First, the animated picture won’t look
+right. And second, after some time, the file will grow too big for your
+hard disk. (The amount of white space grows exponentially.) So after
+each preprocessing, the first thing the build script does is remove all
+the unnecessary white space using (gcc would even insert The arguments passed to the build script are passed on to gcc
+with a It would be enough to pass the During the preprocessing, intermediate files
+ Also, a file The program is compressed. In the first three preprocessing
+passes, it uncompresses itself and initializes the “variables”. So if
+you want to understand how it works, the best thing is to pre-process it
+three times and then look at it again. (However, I wouldn’t have wasted
+three passes if they weren’t needed anyway to initialize the tape in
+certain cases. Find out why.) The first problem I had to solve when writing this program was to
+write a preprocessor program which outputs itself. Of course, each
+program which doesn’t contain any preprocessor directives is such a
+program, but that’s not what I needed. In fact, to do this, the program
+has to include itself, but even then, it’s not easy. The next problem to solve was how to pass results of a
+calculation of one preprocessing to the next one. This is done by
+outputting What’s a useful way to store information, especially the content
+of the tape? Of course, a There are many other interesting things to look at, e.g. the way
+to access the information in the user-provided program, the way a
+non-defined state is detected, the way the picture is produced, etc. If
+you want a real challenge, try to understand what the line
+ Due to the fact that our alphabet has only 53 ;-) letters, I had
+to use many variables more than once. I couldn’t refrain from doing a little bit of nasty stuff
+like Of course, it is a bit more subtle, and even useful. The layout of the source code…, well, let’s call it the “modern
+art of programming” - a mixture of program-like indenting and modern
+art. There are even some comments… It works with many versions of gcc. I tested it with versions
+2.7.2.1, 2.8.1, 2.95.2, and ecgs-2.91.66. However, an old version of gcc
+produced “internal compiler errors” (obviously not my fault). The only warnings I get tell me that I’m undefining
+ Different versions of For Mac-Users: It works with the C compiler of CodeWarrior (an
+old version). This compiler even leaves out all that unnecessary white
+space, so that no clean-up is needed. (It would be useful to write a
+kind of script which does the equivalent to the build script, so that
+one does not have to choose “preprocess” from the menu over and over
+again. I leave this as an exercise to the experienced Mac
+programmer.) In the build script, I passed the to the sed parameters. Or, if your add instead. First, I had The build script probably needs a bash to run in. So perhaps you
+have to add On SunOS, I had to remove the This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/herrmann2/index.html Author: If you use vi(m) you can see a pattern in herrmann2.cup and
+[herrmann2.ioccc][(herrmann2.ioccc]) by say: and For additional fun in herrmann2.cup
+try: and in herrmann2.ioccc try: Be careful when staring at the source code - your eyes might cross,
+but if you concentrate on your focus you will find illumination! You probably know those “magic eye” 3D pictures - pictures looking
+like random noise, but when you look “through” the paper, you either get
+a three dimensional picture or a headache. With this program, you can
+create your own 3D pictures in ASCII art. And yes, the program itself is
+such a 3D picture. Create a file which describes the desired 3D picture. The file
+must be a block of lowercase letters the size of the desired picture.
+The letters specify the depth of the corresponding pixel: Pipe your picture into the program. The output will be your 3D
+picture, constructed of random characters (with ASCII code between 32
+and 126). For example, type Due to the way these 3D pictures work, the left part of the
+picture won’t look really 3D, so don’t put things too much on the left.
+The reason is that for each letter in the source file, a character for
+the right eye is printed. The 3D effect appears when the left eye sees
+the same character more to the left. This is of course impossible on the
+left border of the picture. Don’t use too different depths and don’t use the depths very
+close to the paper (beginning of the alphabet). This would make it more
+difficult to see the picture. When passing an argument, don’t use a too short one; the
+repeating pattern which arises from the repetition of the argument could
+interfere with the repeating pattern which creates the 3D
+effect. The program is able to handle all common kinds of line breaks:
+Unix, DOS and Mac. To get an output with a certain kind of line breaks,
+simply use the same kind of line breaks in the input file. As the source code is a 3D picture itself, the easiest way to get
+it (if you lost it or if you don’t have it already) is to use the
+program itself on the right picture and with the right
+argument: If I had submitted the program last year, I would have said that
+it has exactly the maximum allowed length: 1536 characters. Now let’s
+say it’s a way of protesting against the inflation in program
+length. The size of the source 3D picture has been chosen carefully: as
+big as possible, but small enough to be viewed without problems on
+normal-sized terminals. The layout is of a completely new kind. And it describes what the
+program does more precisely than any comment could. I don’t think there has ever been an IOCCC program with so severe
+layout constraints. Once the 3D picture has been fixed, only a sixth of
+the characters can be chosen freely! (457 of 1840, to be exact.) In
+contrast, in palindrome programs, for example, half of the characters
+can be chosen freely. I did not cheat by using comments or If you don’t believe the constraints are hard, try to write just
+one single line which satisfies them. (To be able to make one function
+call, for example, you have to fill an entire line with stuff doing
+mostly nothing.) Just in case this is not enough: Yes, the code itself is
+obfuscated: It’s (almost) only one big expression, with deep nesting of
+ The fact that the main loop of the program calls
+ When still in doubt about how to judge this program,
+type and let the result inspire you. ;-) I fear that gcc is the only compiler for which this program
+works. Due to the severe restrictions, I was forced to use declarations
+of Also, a lot of warnings are produced - most of them “data
+definition has no type or storage class”, but also some “parameter names
+(without types) in function declaration” and “assignment from
+incompatible pointer type”. I wasn’t able to get rid of them. At least, it probably works with all sufficiently recent versions
+of gcc. I tested it with versions 2.7.2.1, 2.8.1, 2.95.2, and
+ecgs-2.91.66. Of course I couldn’t put This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/jason/index.html Author: You are in a maze of twisty little passages, all alike. The really amazing part of this is that it’s a text adventure, and
+there’s not a single word in the source that isn’t a C keyword or
+function name, being used as such. The interface isn’t very tolerant of errors, but you can’t really
+expect that from something this small. Of particular interest: Go ahead, run it through the preprocessor.
+You still won’t see the words that are used in the game. If you run it through a beautifier you might cause a crash as most of
+the whitespace is significant. Also, if you attempt to change one
+character identifiers to longer names expect problems. Even swapping the
+ TED Shroyer came up with the idea that made it possible to hide all
+the text. Thanks, TED. You won. :) This program is a rather nostalgic little labyrinth game. Start out
+by typing “ The maze is randomly generated each time you play. The algorithm
+ensures that you start at least 6 hops away from the exit. All passages
+are two-way. (There is a trick, well-known among Adventure
+game fans, to keeping one’s bearings in games like this. Unless you know
+the trick, it can be very difficult to find your way around. Try it out
+first; I’ll give away the secret at the bottom of this document.) The goal is to collect 8 treasures (plus the lamp) and escape into
+the sunlight - or moonlight, as the case may be. After a few minutes,
+the lamp runs out of oil, and things become perilous. If you manage to escape, you score 50 points for your hide, 50 points
+per item, and bonus points for speed. Why I think this program is obfuscated: 70% more Where are all the messages? The game is downright chatty for only
+having two string literals ( There is exactly one loop in the program, a Microsoft Visual C++ won’t even compile this program, even though
+it is plain ANSI C (innocent look) and limits itself to the
+most standard and portable of the standard library facilities. Most of the whitespace is significant, so attempts to beautify it
+can easily lead to segmentation faults. Attempts to replace the one-character identifiers with longer,
+more meaningful names will likewise cause problems. In fact, simply
+changing all the When all warnings are enabled, some compilers express the desire to
+see a few more parentheses. I respectfully submit that there are plenty
+of parentheses in the program (370 in all.) Besides, any more would put
+me over the size limit. The program is formatted as a poem, to make it more readable. I find
+the plaintive chorus “B? B?” particularly poignant. Also, smiley faces
+are formatted flush left. (If you don’t find the game entertaining, see
+if you can find in the source code.) The trick, of course, is to drop items in empty rooms to mark them.
+That way you usually know if you’re in a room you’ve seen before. It
+greatly aids mapping. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/kev/index.html Author: There is another version which lets you use the arrow keys rather
+than the more awkward The current status of this entry is: For more detailed information see 2001
+kev in bugs.md. NOTE: each player’s paddle is at the bottom and the opponent at the
+top. If you need to change the speed you can reconfigure it like (say for
+over a network and not the same host): If you wish to change the port you can do so like: Of course if you want a port < 1024 you’ll need to be root so
+don’t do that. And if you know what you’re doing you can redefine the call to the
+ If you have and then the other, the client system: This might look nicer than just the terminal itself. This version allows you to use arrow keys on the keyboard rather than
+the more awkward You can reconfigure the macros described above in the same way. Use What happens if you use both, one in one terminal and the other in
+another terminal? If you have and then the other, the client system: Continuing with this year’s “retro game” theme, this is another old
+game; arguably, one of the oldest. Requires a functioning network, and
+curses. The graphics aren’t the impressive part; the graphics and network
+are. How many games come out at $50 and still require you to wait for a
+patch to come out before you can play multiplayer? This one works out of
+the box. NETWORK PONG! This program is a two-player networked version of the eighties arcade
+classic, Pong. It uses
+standard TCP sockets to communicate over the net, and
+ Run the server first without any command line arguments, i.e. Then run the client with a single command line argument which is the
+name of the machine running the server, e.g. Make sure that the terminals on both ends are the same size. Also,
+the TCP port number (by default 5455) specified in the Makefile mustn’t be blocked by a firewall. Here’s a good quick example to see it in action on your own machine,
+assuming you have Your paddle is the one at the bottom of the screen, your opponent is
+at the top. To move your paddle left, hold down The current score is shown on the left side of the halfway line. Your
+score is the lower number, your opponents score is the upper number.
+Your score is the number of times your opponent has missed the ball. You can control the speed of the ball by the motion of your paddle
+when the ball hits it. If your paddle is still, then the ball just
+bounces normally off it. If your paddle is moving in the same direction
+as the ball, then the ball’s speed in that direction will increase. If
+your paddle is moving in the opposite direction to the ball, then the
+ball’s speed in that direction will decrease (or if the ball is going
+slowly enough, it’ll turn around). You might want to increase your keyboard repeat rate before playing.
+On the Linux console try Look below in the Building section for info on how to speed up or
+slow down the game (useful if you increase or decrease the terminal
+size). Just run The TCP port to use for network communications is specified by the
+ The program’s broad structure is fairly straightforward, but
+individual tasks are rarely done in a straightforward manner. ;) Identifier names have mostly been chosen to resemble paddles and
+balls, and to generally decrease readability. The source has been cleverly formatted to resemble one of the paddles
+from the game, rotated 90 degrees. ;) (The “source paddle” has
+approximately the same aspect ratio as the game at 80 columns wide,
+which is 1:10.) Finally, the number of “non-whitespace characters” (as defined by the
+rules) in the file is exactly 2048, which I think is rather unexpectedly
+cool. :) There are 3 warnings when I compile with gcc 2.95.3
+( I don’t like the curses and/or termcaps/terminfos on IRIX and Solaris
+(the only two non-Linux systems I have access to). Despite calling
+ Sometimes when If the specified port can’t be bound or connected to, the program
+segfaults. If your terminal is too wide (we’re talking gigantic here - over 500
+characters wide) then the program can segfault. It’s also possible to
+crash the program a player scores over a billion points (1e9). Maybe you
+can consider that the goal… ;) If you run the client and server on different architectures, both
+architectures need to have the same character systems (i.e. don’t try
+mixing ASCII and EBCDIC). It is independent of endianness though. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/ollinger/index.html Author: Try the above command in a large window, say 200 chars wide and 100
+high (200x100) with a tiny font. Do get lost in the program’s line of thought! :-) What do you see? On the left, you will see an enumeration of all
+successive primes from 2 to
+the parameter you gave to the program. On the right part, you can see
+the sieve used to find these primes. The big diagonals from right to
+left are used to erase composed numbers. When no diagonal crosses a
+number, then the left cell take value 1 and the number is prime. The parallel version of this algorithm works in real time
+ Let’s just quote the FAQ: Q: Are there types of entries that are submitted so frequently that
+the judges get tired of them? A: Yes, there are types of entries that show up over and over again.
+The guidelines say: I think this is enough motivation for trying to submit a program
+which uses some complex state machine/table to generate small primes and
+print them. This program simply prints the space-time diagram of some particular
+cellular automaton. The automaton is a 9-state automaton by Ivan
+Korec in 1998. It is an optimization of an old automaton for
+recognizing primes designed by Fischer in 1965. The table of the automaton is encoded into the string The main loop simply iterates this transition function on each
+cell. “The rest is silence” (Hamlet, V.2) Enjoy! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/rosten/index.html Author: The current status of this entry is: For more detailed information see 2001
+rosten in bugs.md. WARNING: this will mess with your mouse and can make it hard to quit
+the program. Use at your own risk. NOTE: number is floating point. For some abuse, try: Friction can be your friend if it does not rub you (or your mouse
+cursor) in the wrong way. :-) This program is designed primarily to make your X windows interface
+more obfuscated. Try doing something mouse driven (such as using a mouse
+driven editor on this program) whilst it is running. If you’re not sure
+what it does, looking at the code should give a fair idea. It also has a [cat] man page if you want to install it as a
+‘utility’. It only takes one optional option: the greasiness factor. This is the
+number that the speed is divided by on each iteration. The default is
+1.03. A setting of 1 - no friction - is fun as is 0.99. Being an X program, it recognises the The program is very portable, even to non X architectures. All that
+is required is a large desk and some good grease. It is really rather surprising that code like this should not only be
+portable, but compile with almost no warnings on most of the compilers
+tested. It’s a kind of shame that none of the compilers do anything like
+this: The code is best viewed with tab stops every 8
+spaces. The mouse gets stuck completely if you give it an option of less than
+1 and leave it for too long. This is quite annoying if it didn’t leave
+the terminal it was run from in focus. It gets very jerky if the processor is being used. There are better
+time functions than It deflects slightly when it gets very slow. It annoys other people if you run it on their display too often.
+Maybe I should make future versions print funny jokes to keep the humor
+fresh. It’s pretty ropey over a 56K modem. It’s even ropier over a 56K modem and tunneled through 3 ssh
+links. Pages and pages and pages of things, with GCC at any rate. It suggests loads of It reckons I have not used some of the values I have computed. I
+would never do a thing like that: I just haven’t used them in the way
+it’s used to. The MIPS compiler suggests an but its suggestions would break my program. It also reckons that
+ Giving the With all warnings enabled, the DEC compiler, oddly enough finds some
+problems with its own include files, but none with my program. The DEC compiler of this version:
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/schweikh/index.html Author: The current status of this entry is: For more detailed information see 2001 schweikh in bugs.md. This program will very likely crash or do something else if you do
+not give it two args. Note also that the glob pattern must match the whole string. See the
+author’s comments for details and a workaround. There’s also no way to escape meta characters. This is supposed to happen. As is written in the The Jargon
+File: Do you get the pattern here? This one-liner program is a glob pattern matcher. It understands the
+glob characters Run it with two args, the string and the glob pattern. The exit
+status is 0 (shell true) when the pattern matches, 1 otherwise. The glob
+pattern must match the whole string, so you may want to use
+ You can use it for your shell scripting needs similar to a silent
+grep (and without There is no way to escape the meta characters. Dammit Jim, I’m a
+one-liner, not a regexp lib. All obfuscation is obviously in the recursive The recursion wonderfully and magically takes care of iteration and
+backtracking. I could tell you how it works but then I would have to
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/westley/index.html Author: There are two additional programs based on the author’s remarks and
+the original version, provided as alternate code as it might be less
+portable. See sorted code, punch card code and alternate code below. The current status of this entry is: For more detailed information see 2001 westley in bugs.md. The author stated that one can sort (ignoring leading blanks
+i.e. This is compiled by default; use The author also stated that if you just sort the code you’ll get the
+with An alternate version of this entry, westley.alt.c, is provided. This alternate code
+might be less portable. Use Try copying the source to a new file and changing around the order of
+the lines. Does it produce the exact same output? By changing the order of the source, figure out in how many different
+ways this program can transform input to output. This assortment of obfuscated lines takes position-independent
+code to a new level! :-) We find it amazing that with just 28 lines of code (not counting
+comments and blank lines) there are Punch cards,
+or Hollerith cards, were becoming obsolete just as C was becoming more
+popular*; this is rather unfortunate, because C has an advantage over
+many other languages when it comes to punch cards - C programs can be
+written to be “drop proof”. Consider the following C program: This program will compile and run no matter what order the lines are
+in. If you punch it on cards (one line of code per card, naturally) and
+drop them, you don’t need to put them in any particular order**; it will
+always produce You can also use global variables: It would be trivial to write an entire C program that is “drop proof”
+using the above techniques; surprisingly, it’s possible to write a
+program that will always compile but behave differently depending on the
+line order: This program will print out If you enter the above program on punch cards, throw them up in the
+air, gather them up, and run it, you will get a number from 0 to 15
+printed out. Now that’s a random number generator… Of course, there are drawbacks to C programming on punch cards; an
+80-character line limit can be restricting, and (to be maximally
+portable) you need to use trigraphs for the characters
+ My C program entry does the following: Reads in lines. Rearranges the lines, or not. Reverses the order of the lines, or not. Prints out the lines as either text or EBCDIC punch
+cards. The code, as written, scrambles the input and prints it out as normal
+text, so you can simulate ‘dropping’ the cards. You can repeatedly
+scramble the code to get all 12 variants (but the scrambling isn’t very
+random; it’s just a bubble sort with a random number, so some variants
+are more common than others). You can also just swap the arguments in
+the calls to If you sort the lines, you will get the version that just prints out
+the input as punch cards (you will need to display at least 82 columns
+of text, or clip the last few chars by piping it through
+ For a nice test pattern, try If you want to analyze the program, sorting the lines while ignoring
+leading blanks works best ( This program should work on EBCDIC computers. It assumes that the
+ I’ve used the With 28 lines of code (not counting the blank lines or the comment),
+there are technically This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/williams/index.html Author: The current status of this entry is: For more detailed information see 2001 williams in bugs.md. A strange game. The
+only winning move is not to play. No, really; you can’t actually
+win. :) The formatting really wants a wide screen; if you can’t read it that
+way, it’s the standard “three triangles around a circular” logo for
+nukes. This is a pretty straightforward game. What this program does: It plays Missile
+Command, complete with MIRVs, smart bombs, extra cities, and
+scoring. Command line arguments and input files are ignored. To play, just point and click where you want your ABMs to
+explode. The score is 10 points for each missile which is destroyed before it
+reaches the ground, -1 point for each ABM used, and 100 bonus points for
+each city left at the end of a level. The game ends when you lose all your cities, although you will have
+to wait until the level finishes raining down to see your final
+score. The main obfuscation technique is the need to compress the code to
+fit all the functionality within the size limits. I could not have
+included smart bombs without the rule excluding On the other hand, I did waste a few characters in order to include
+some rather obfuscated math in the program. It uses fixed-point
+arithmetic, resulting in the overuse of bitwise shift operators. Another
+example is This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/anonymous/index.html Author: Now open the output using your favourite pgm viewer.
+If you don’t have a NOTE: technically the text is supposed to be in all lower case but
+the above still works for demonstration purposes. Did you know that in the first edition of The Hobbit Gollum was
+willing to give up the ring? It was not the Ruling Ring, the One Ring,
+the Ring of Power or anything like that: it was simply a literary device
+that could make one invisible. When Bilbo won the famous riddle game
+Gollum went to fetch the Ring - not to kill and eat Bilbo but to give it
+to him! But Bilbo had already found it just like in the later editions.
+Gollum profusely apologised and begged for forgiveness. Bilbo told him
+never mind because he would have had it anyway. But he’d let him off on
+one condition: that he show him the way out. It was at this point that
+Bilbo slipped the ring on and Gollum saw him vanish and understood that
+he already found it. But there was no call of thief and no hatred of
+Bilbo. If you want to read the first edition they reprinted it some years
+back: p.s. Frodo lives! BTW: if you haven’t read The Lord of
+the Rings what are you waiting for? :-) You’ll find out the source
+of the text above though you’ll see that there are some circumflexes
+missing! That’s okay though due to I/O of the entry and in earlier
+drafts sometimes the û with an umlaut had no umlaut but H after the
+ Ash nazg durbatulûk, ash nazg gimbatul, ash nazg thrakatulûk, agh
+burzum-ishi krimpatul. which when translated from Black Speech
+means: One Ring
+to rule them all, One Ring to find
+them, This program takes a single command line argument, transcribes the
+argument text into Tolkien’s Elvish letters, and writes the
+transcription to standard output as a portable
+graymap (PGM) file. The specific transcription mode is the Black Speech
+(Tengwar
+mode), as used in the inscription on the One Ring. The
+program handles the following digraphs: Punctuation marks other than commas and periods are ignored, as are
+whitespace characters. In addition, the argument text must be entirely
+in lower case. The following command thus writes a rendering of the Ring
+inscription to the file The source code assumes the ASCII character set; also, due to space
+constraints, the program uses rather inefficient algorithms, so it may
+waste a lot of time and space even when rendering moderately long
+strings. The code contains a vector font which was derived by toying with Harri Perälä’s Tengwar Cursive font.
+Currently, only the glyphs used in the Ring
+inscription are included in the font. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/arachnid/index.html Author: There is an alt version for rogue players, vi(m) users and Dvorak
+typist (i.e. those who need and then try: Navigation is through the use of the If you don’t like the Use The fun part comes when you realize that the maze scrolls. The
+overall visual effect is quite pleasing (at least on some displays),
+and, well, it’s a lot of fun. This program accepts ASCII formatted mazes as input, and renders them
+on screen for the user to explore, complete with Line Of Sight - you
+cannot see parts of the maze your avatar (the The maze files will be interpreted with spaces Feed the program its own source for a default maze. Running it with
+no command line parameters will do this. In a nice symmetry, the
+character constant You can explore the maze using the
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/burley/index.html Author: NOTE: We FORCE the use of -O0 even if someone overrides it because
+this entry will not work with it enabled. NOTE: you need to input a number first. See judges’ remarks below for
+information on how to play. This is a draw
+poker program. You start with $100. Input alternates between your
+bet and which cards to keep. Example: The payout is according to “Vegas rules”: The program allows you to go into debt. However I’m sure you would
+never control-C to kill the program just because you got behind, right?
+On the other hand the program never willingly exits, so you have to
+leave even when you are ahead. :-) Can you figure out a winning betting “strategy”? Then can you modify
+the program so this “strategy” no longer works? Notice the clever use of NOTE: the author talks about how it is a single statement. This might
+not be strictly true in 2023 for the fixes for it to work so you can
+look at the original file burley.orig.c to
+see what is meant. This program plays draw poker. What is unusual about it is that it is
+written as a single statement – count the semicolons! (OK, there are
+really three statements if you count the variable declarations.) To keep
+things simple, I have avoided the C preprocessor and tricky statements
+such as This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/gavare/index.html Author: There are three alternate versions; see alternate code below for more details. The alt code, gavare.alt.c, allows you to
+change the size of the image as well as the anti-alias setting, when
+compiling. The author also provided on their web page for
+the entry an unobfuscated version that was used during development,
+which we have included in the file gavare.r3.c. Finally, there’s a version, gavare.alt2.c
+that sets binary mode on To build the configurable and unobfuscated versions: To change the default size from 1024x768 try: You might also wish to change the anti-alias setting: This is not possible with the author’s version but it is with the alt
+versions (Windows - see below - and otherwise). As the Windows version will not compile on most viewers’ systems we
+do not build it with Use For users of systems that distinguish between text and binary mode
+(you know who you are), add a library call that specifies binary mode
+for A freely distributable command-line version of Microsoft Visual C
+exhibits an optimizer bug when compiling this entry. Disable
+ The judges were able to figure out how to control position (in all 3
+coordinates), size, and color (to some extent) of the balls. It is possible to write some kinds of programs in C without using
+reserved words. For very short and trivial programs, it usually isn’t
+very hard to write a variant using no reserved words, but with this
+program I want to show that also non-trivial programs can be written
+this way. This IOCCC entry contains no reserved words (I don’t count
+ The program is a small ray-tracer.
+The first line of the source code may be modified if you want the
+resulting image to be of some other resolution than the predefined. The
+ The ppm image can then be viewed using an image viewer of your own
+choice. (Running the ray-tracer may take several minutes, even on fast
+machines, so be patient.) I am very much aware about the fact that I’m breaking the guidelines.
+For example, the word Another reason for writing code without using reserved words is that
+many text editors will make all reserved words turn BOLD when printed on
+paper. Since I care for the global environment, we shouldn’t waste any
+more laser toner, or ink, than necessary. Everyone should write C code
+with no reserved words, and our world will be a better place. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/gavin/index.html Author: There is an alternate version for those who wish to use QEMU rather
+than having to reboot and rely on having a floppy drive (if you even
+remember what those are :-) ) etc. See alternate code below. The current status of this entry is: For more detailed information see 2004
+gavin in bugs.md. To enjoy the results (on a Linux/x86 machine) with a floppy drive
+(remember those? We do!): Make a floppy with an ext2 filesystem ( NOTE: If the version of your lilo is not 21.4, use the appropriate
+boot.b file. NOTE: If your floppy drive is not Boot from the floppy on an x86 machine with a PS/2 keyboard and
+mouse. Move the window away from the corner. Scroll up and down the file with up-arrow and down-arrow. You can have several shell windows: Press and hold any key. This version’s main difference is that the macro The use is mostly the same as Over the years, we’ve seen a program that immediately dumps core if
+executed on the “wrong” architectures (1984/mullender) and a program that
+dumps core after a while (2001/bellard). This entry will
+happily compile and execute on most any architecture - the trick is that
+the result, to be useful, must be produced (and can only be enjoyed) on
+a particular architecture. We have not decided yet whether to disallow
+this for future contests. If you do not want to mess with a floppy and you use GRUB, see gavin.md. You can put additional text files in If you do not want to bother rebooting your computer at all, see http://bellard.org for QEMU
+(Fabrice Bellard is an IOCCC
+2001 winner), but your experience will be limited; use the alternate code instead. You’ll have to move
+the mouse to trigger the initial screen update. The judges were able to write a few more programs to run in this OS.
+What are the limitations for such programs? What can you do and what can you not do in such programs? The program called This is a 32-bit multitasking operating system for x86 computers,
+with GUI and filesystem, support for loading and executing user
+applications in ELF binary format, with PS/2 mouse and keyboard drivers,
+and VESA graphics. And a command shell. And an application - a simple
+text-file viewer. The OS has ended up as a traditional monolith with one entry point
+for syscalls, with apps treated as cooperative-multitasking tasks that
+can be sent different messages (e.g. ‘initialize’, ‘key hit’, ‘render to
+buffer’) through their main entry point, and which will return control
+to the OS after having performed the necessary work. Applications are
+passed a pointer to their task structure, which is partially defined by
+the OS, and partially for the application’s own use. The program compiles into a tool to build a kernel image, so having
+built the program, the Makefile will run it,
+redirecting the output into a file called For further usage information see gavin.md. The filenames Known issues are really too plentiful to list. If the mouse pointer goes off the left hand side of the screen it
+will reappear on the right, and vice-versa. If it goes off the top or
+bottom, it will go and corrupt some memory. The file system is kinda optimistic about matching names, so, for
+example if you type the command The ELF
+binaries are not loaded at the correct address, and their entry
+point must be the start address of the text segment. The keyboard driver can cope with the basic alpha-numeric keys, but
+gets confused by fancy things like In the text-file viewer, The x86 is bootstrapped into 32bit mode in 6 instructions, with 4
+more to set up data/stack segments and a stack-pointer to allow C code
+to be run. On top of this there are also about a dozen instructions to
+switch the video card into graphics mode. All in all, a relatively tiny
+number of instructions next to the size of the C program. Also, the
+string is mostly composed of data - a Linux-esque kernel header for the
+bootloader, protected mode descriptor tables, keyboard maps, etc. (I
+should also mention that it contains mini functions to perform an x86
+ Porting to another architecture should be relatively easy* - the
+string simply needs be replaced with one containing data & code
+suitable for the new target platform. Accesses to data in the string are
+made relative to the define This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/hibachi/index.html Author: Then use your web browser to visit
+ NOTE: you must be in the This entry violates the guidelines
+in so many ways! We are not exactly sure how many organisations will be
+upset with this entry, but we are considering starting an IOCCC
+standards body just to reign in the likes of Mr Howe. This entry also has the dubious honour of being the only one to have
+been submitted with its own configure
+script. NOTE: the author states there is a tarball There is a Or once To build just the executable: For Cygwin, FreeBSD, Linux (newer), Mac OS X: For Linux (older): For SunOS: Since some systems place socket and network functions into other
+libraries, a GNU
+autoconf configure
+script has been provided to figure out the necessary link libraries, to
+verify all the necessary headers and functions are present, and setup
+the To start the server on the default port (8008): To test the server: To stop the server: Supports virtual hosts. Supports all MIME types. Supports Common
+Gateway Interface (CGI) scripts and programs. Supports multiple index.htm, index.html, index.php, index.pl, index.sh, index.rb,
+index.py Supports subset of RFC 2616 HTTP/1.1 methods:
+ Simple & straight forward configuration using environment
+variables. Portability across Unix-like environments, such as: Cygwin,
+FreeBSD, Linux, SunOS. Known to work with Lynx, Mozilla, Opera, and Internet Explorer
+web browsers. Is a dedicated process-forking server that does not use inetd. Is secure against relative path file
+snooping. Is secure against directory searches. CGI script execution managed through Unix file
+permissions. ~155 lines of source, 1940 bytes long by IOCCC 2004 rules, ~6KB
+compiled & stripped for FreeBSD. Superior & smaller than micro_httpd from http://www.acme.com/. And has a really cool tongue-in-cheek animated logo too. This code is properly indented using the One True Brace
+style. Commented spoiler available. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/hoyle/index.html Author: The obfuscation functions at several levels. Note the clever use of
+use of This application graphs polynomials on a standard Cartesian
+coordinate system. Polynomials of the form
+ For example, to graph Note that: will produce the same graph, since the This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/jdalbec/index.html Author: There is an alternate version that allows one to control the number
+of numbers to print on a line. See alternate
+code below. The current status of this entry is: For more detailed information see 2004 jdalbec in bugs.md. This version lets you control how many numbers to show on a line
+before adding a newline as it can be harder to see when there are a lot
+of numbers. For lines that don’t end up having too many line breaks it
+also makes it easier to see which line it is on. The macro though it might be odd to have 47 numbers on a line as it would
+defeat the purpose. :-) Or if you prefer some prime, golden irony: Use We still aren’t sure whether or not this is a useful program, but
+it’s the first atomic fission we’ve seen in the IOCCC. It’s elementary! See http://mathworld.wolfram.com/LookandSaySequence.html and
+http://mathworld.wolfram.com/CosmologicalTheorem.html
+and the references listed there. Go read the web pages and come back. This program implements the look-and-say
+sequence (one of the above listed links) with the added feature that
+each “decay product” is automatically split into its constituent
+“elements” separated by spaces. Furthermore, arguments passed to the
+program are treated as separate elements for the purpose of computing
+further decay products. (Compare the output of The common elements are listed in CosmologicalTheorem.html.
+The non-primordial
+transuranic
+elements are the isotopes of Neptunium and Plutonium. Isotopes
+of a given element differ
+only in the last digit. Four common elements could also be written as
+isotopes of these two elements: The build file runs jdalbec.c through the C
+preprocessor to generate I don’t think I’m abusing the Makefile since
+I’m only using 147 characters including white space and the
+ Since buffer overflows are a common security problem these days I
+have stolen the idea of using a “safe” buffer API from
+ The program was tested on: AMD K6/MMX 266MHz, Debian GNU/Linux
+testing “Sarge”, gcc 3.3.2 Intel 486DX 33MHz, Red Hat Linux 7.3, gcc
+2.96 PowerPC Macintosh G4 Quicksilver, Mac OS X 10.3.2, gcc 3.3 PowerPC
+Macintosh G4 Quicksilver, Mac OS X 10.1.5, cc 2.95.2 PowerPC Macintosh
+Performa 5200CD, Mac OS 8.6, CodeWarrior 11 Sun SPARC Ultra 10, Solaris
+8, gcc 3.2 Compiling on Mac OS 8.6 requires some degree of manual intervention
+because Mac OS 8.6 doesn’t have shell scripting or even a normal command
+prompt. The Compiling on Mac OS X 10.1.5 requires changing Arguments matching Note: you may want to be sure you have a limit on stack size before
+trying this. I ran it on Debian GNU/Linux and discovered that I did not
+have a limit on stack size. Fortunately the OS killed the process after
+a while. This is consistent with the output of 1996/schweikh3 which reports
+ Arguments matching Arguments matching The program has exactly 2004 IOCCC countable bytes. It’s tailor-made
+for this competition! Although there are no comments, the program still manages to be
+self-documenting in an obscure fashion (periodic table of the
+(non-primordial) elements, “OBFUSCATED C”). The program is obfuscated: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/kopczynski/index.html Author: NOTE: We FORCE the use of -O0 even if someone overrides it because
+this entry will not work with it enabled. What happens if you feed the program source to the program? Can you
+figure out why? The judges modified the program to print its result. The original
+program returned the result as an exit code which is what the alternate
+version does. What is in a line? A lot when you obfuscate the way Eryk Kopczynski
+did it. This small one line program is an outstanding technical work of
+art as well as one of the better one-liner programs that we have seen in
+years! Compile and run without arguments. As input, give it an ASCII
+graphics figure 8, 9, 10, or 11 made of pound signs and spaces, of any
+size, shape, or orientation (that’s right, an upside down 9 is still 9
+:-) ). There is one restriction: the only line not containing “#”
+characters must be the last. The program will print what it thinks you’ve entered. If you enter
+anything that does not resemble 8, 9, 10, or 11, the result is seemingly
+arbitrary. Actually it is not pseudo-random; can you find a pattern when
+it does not resemble 8, 9, 10 or 11? Here is a related puzzle: how to continue the sequence: With certain arguments, you can alter the exit value / output. Can
+you figure out how and why? The program proves it is not as hard to recognize numbers. The
+current one liner version should correctly recognize all numbers from 8
+to 11. (Unless you give it some very hard cases. For example, it cannot
+recognize negatives, zeros which have dots or slashes inside them,
+digits should be separated, and numbers should be “complete”.) This program returns the number as its exit status. (In most shells,
+you can see the exit status of the last command with
+ NOTE: The judges altered the primary version to output a
+number. On the input, give numbers formed as a sequences of empty spaces and
+ The line is 131 bytes long (in 1986, 165 bytes was OK, and the
+size limit has grown from 1986…). I have decided that it is better for this program to return the
+number, not to print it, but if you think otherwise, the change would
+cost 6 chars (plus a warning). Change I achieved some additional tightness by It only requires two’s complement arithmetics, as far as I know. The
+maximum length of an input line is This program works by calculating the Euler
+characteristics of input, plus 9. It is the number of digits
+(i.e. separated We know that Euler
+characteristics is the number of “vertexes” minus the number of “edges” plus the number of “faces” substitute all possible “values” of Note now it is simple and obfuscated enough to be used as a “magic
+trick”. I make a 16-character array; when indexed by 4-bit value which
+represents the 2x2 squares, it will return a number to add/subtract
+ We convert lines of input to bitmaps ( Since we always return the number from 8 to 11, we can calculate
+modulo 4. Instead of Since the rule found in (3) did not produce any funny messages, I
+changed it until it did. (The They can be mixed, of course! NOTE: item 8 was removed by the judges so as to not spoil the
+challenge of figuring how arguments can be used to alter the exit
+value. The variable names are confusing. Finally, the program tries to be as concise as possible. Some
+obfuscation comes from this. For additional obfuscation and conciseness,
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/newbern/index.html Author: The program is formatted using the same font glyphs as the example
+data file. This is a configurable The program can also act as a Morse encoder, unarguably. It also has double-super-secret encryption capabilities. Decryption
+is left as an exercise for the reader. The program assumes an ASCII operating environment. The program is best viewed with tab-stops set to 8. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/omoikane/index.html Author: For extra credit, spot the checksum in the source file itself. What
+makes this one particularly interesting is that the checksum, strictly
+speaking, isn’t being computed at all. Rather, the file is modified to
+have the desired checksum! This does, we suppose, solve the problem that
+inserting a checksum would change the file’s checksum; if you have to
+change it, you might as well change it! This program was submitted under the name All three arguments may reference the same file. All files is assumed
+to be of ASCII character set. Any file larger than 8 bytes is valid. Upper limit on file size is
+limited by memory. If input file can’t be loaded for any reason, The layout file contains a map of where One way to create the layout file is to make a copy of the original
+file, replace where you want Example file/layout: And Note that the original file by itself is a valid layout file, since
+ If layout file can’t be used for any reason, If Chances of success and how long it takes to run to completion is
+completely dominated by the layout file design. In general,
+ That said, each run is randomized with respect to system time, so
+it’s not always certain whether For reference, Inserting a checksum in the file you are computing the checksum of
+isn’t quite trivial, since changing the file content would change the
+final checksum value. To insert the checksum, The compensation bytes are very easy to compute for binary files with
+enough consecutive scratch areas, but for text files with
+non-consecutive areas and limited degrees of freedom, For computers a few years old, this is probably still too slow to be
+acceptable… but at the speed the IOCCC judges run the contest these
+days, I am sure you have enough patience for it Code is formatted to the shape of “ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/schnitzi/index.html Author: NOTE: if you’re one of those who don’t know how to exit
+ This exemplifies the meaning of Visual Editor, but we don’t think
+that any benchmarking sites are going to use this to tout the
+performance of the latest hardware! If you’ve ever pasted a large chunk of text into an editor (such as
+ It’s not the editor’s fault. The editor is just acting just as if you
+typed exactly what you’re pasting. (Of course, you could blame the
+editor for being modal in the first place, but that’s a discussion for
+another time.) It occurred to me that you could get interesting results by pasting a
+carefully designed string into the editor. In fact, if the pasted string
+contains cursor navigation commands, you can go back and overwrite
+things that were already inserted earlier in string, anywhere on the
+screen. Can you see where this is going? The program takes input from The output, written to It’s easiest to place the input in a file, so you can redirect it to
+ The first line is specified thusly: The first parameter, Following the first line parameters, you may have up to nine
+different sprites, each up 50 by 50 in size, and with up to four
+different ‘views’ of that object, which are cycled through with each
+successive frame. Each sprite begins with a line of parameters of the
+following form: where: Each such parameter line will be followed by Input is terminated by end of file. Duh. Two samples input files are included; one a nice pastoral park scene,
+the other a bit of scrolling text. Try one of these methods to get the animation to run: Then, open the output file, select the text, and copy it to your
+system pasteboard/cut/selection buffer and paste it into vi. The paste
+is NOT the vi paste command, but rather an action you take within your
+operating system. On a Windows machine running vi via Cygwin,
+“Edit|Paste” is a right-click menu option on the top window bar. I would like to remind the Pixar Animation Studios that I retain
+royalties on this technique. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/sds/index.html Author: The current status of this entry is: For more detailed information see 2004
+sds in bugs.md. Why not use the program to hide another program in the program? It
+must have seemed reasonable at the time. The ability to hide a message in plain text is quite charming,
+really. We must admit to a bit of uncertainty about where you’d find
+such messages, or how useful they’d be. Or, of course, whether all those
+horribly badly formatted emails spammers send might contain secret
+messages. Annoyingly, it’s a little too obvious that SOMETHING has been
+done to a message for us to hide one in the remarks. :) Steganography is
+the term for the family of techniques used for hiding information within
+other information. Today, it has many real world uses, particularly for
+digital watermarking. This program uses a steganographic technique to hide information in
+any text file. The specific technique used is aimed at writers of
+obfuscated programs for the IOCCC, as the hidden information is encoded
+in the whitespace in the source file. As we know, there are up to an
+additional 2048 characters of whitespace available to entrants to the
+IOCCC, so it turns out that this is an ideal place to hide things. The program as provided is the steganographic decoder. Rather than
+provide a separate encoding program, you should not be surprised to
+learn that I opted to steganographically hide the encoder inside the
+decoder. Try it out. Compile the program, then type You should see the encoder program displayed. Now save it, like: Then compile The encoder expects to get a filename as an argument. This filename
+is the name of the file containing the information to be hidden. It
+expects the file in which to hide the information to be on the standard
+input, and will output the results on the standard output. You can use it like this (assuming you have a file called
+remarks): Then to decode: C programs are mostly unaffected by adding steganographic content,
+but it is possible in certain circumstances for whitespace to be changed
+inside strings where it should be left alone. Plain text files are good
+candidates for hiding information in, but the added spacing may render
+the text somewhat difficult to read. This program is obfuscated in a number of ways: The program (and the encoder program) should compile on any
+reasonable compiler. In particular, they are known to compile under GNU
+C. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/vik1/index.html Author: Can you figure out how to cheat? Daniel Vik has presented a tour de force feature rich X11-based
+racing game that fit within the contest size limits. Take a glance at
+the feature list he provided below. Amazing! The author posted a video of this on YouTube: https://www.youtube.com/watch?v=xTseqWCtAUA. Happy touring on the road and in the code! This program is a complete car race game with a lot of nice
+features: Drive on a road in a 3D landscape with hills and curves. Mountains in the horizon. A sun in the sky when driving during the day. Dark sky and reduced visibility when driving at night. Snow when driving in the winter. Slippery road when driving in the winter. When driving off the road, the car slows down to a halt. Three different race tracks that takes about one minute to
+complete. Speedometer. Computer driven opponent cars. Collision detection when driving into other cars. Lap time measurement. The best lap time is stored as reference. Compile the source code and link X libraries if necessary. The
+program takes three options which have to be typed in a specific order
+as described below. Here are a few examples: Note that the order in which the argument characters are entered is
+important. It is for example not possible to type
+ The space key accelerates the car. Releasing the space key slowly
+reduces the speed. The left and right arrow keys are used to steer the
+car. The main obfuscation is the fact that the program is extremely
+compact. There are a few things I didn’t want to do, e.g. define
+ The program uses a lot of variables. In fact, all letters
+ The constants are chosen very carefully and they have multiple
+purposes, e.g. a constant can be both the length of the track and a
+color. Most of the code is kept inside five The program frequently uses the There are no compiler warnings when compiling with The program only compiles and runs on X based systems. The program requires a display with 24 bit color depth. It also
+assumes that the byte order of the colors are as on my Linux PC. That
+is, The colors are represented by a 32 bit value where the bytes (from
+high to low) are This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2004/vik2/index.html Author: The fun thing about CPP abuses is
+that, in most cases, running the preprocessor on
+them doesn’t help you decipher the obfuscated code. That’s assuming your
+preprocessor can take it at all. It’s been a while since the last pre-processor
+killer won the IOCCC. I thought it was time to relive hour long compile
+times so I made a program that does (almost) all computation in the
+pre-processor. The program even causes I’ve got I actually had to write my own pre-processor to
+verify that the program was doing the right thing… Since it takes a very long time to compile the program, there is a
+symbol that can be defined to shorten the compile time and avoid
+compiler errors. The program implements an 11-bit ALU in
+the pre-processor.
+The ALU has two registers,
+ The ALU has six instructions: Internally the ALU
+implements a one bit adder with a carry in and carry out. This adder is
+the core of the ALU. The All calculations are made using only The application that uses the pre-processor ALU is a
+prime number
+generator. The application uses the same pre-processor directives.
+Needed variables are stored in memory represented by one defined or
+undefined symbol per bit. When doing arithmetics, the variables are
+loaded into the The choice of application may be a bit unfortunate since we’ve
+already seen a winning entry calculating prime numbers in
+the pre-processor.
+There is a big difference though. The 1988/applin entry uses pre- processor
+arithmetic (in a very nice way though). This program only defines and
+undefines symbols in a well defined ;) way and doesn’t do any
+pre-processor arithmetics. The reason why I chose to do a prime number
+application is that the algorithm can be written to do a lot of
+calculations without a lot of nesting (GNU First, do a first pre-processing of the initial definitions. The
+ Then use Finally compile the pre-processed file Then run the program to reveal all prime numbers up to 32 (if you
+used I wasn’t able to compile the full program which calculates prime numbers up
+to 1024 using GNU Well, since 98.5% of the program is preprocessor
+directives, the main obfuscation is the use of preprocessor
+directives. Doing arithmetics without actually using any arithmetic operations
+makes the program quite hard to follow. In order to actually do the calculations, the program includes itself
+a lot. The symbol names are made as short as possible to meet the space
+limits. This of course adds to the obfuscation (even though the program
+is quite obfuscated with longer, readable macro names. Finally, I made the 1.5% C code a bit harder to read by breaking all
+lines after three characters. The program has 1029 lines which makes it the longest entry (so
+far). Even though the pre-processed and indented output is easier to read,
+it is quite hard to find the code in it. The size of the pre-processed
+file is several Mb when using GNU In order to fit the program within the space limits, I had to define
+the The table below contains some interesting statistics about the
+compilation of the program. The intermediate file size is the size of
+the output file of the This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/aidan/index.html Author: There is an alternate version based on the author’s remarks. See alternate code. where This code is formatted differently and is not the approach used by
+the author which is slower, inelegant and not as obscure, as the author
+put it. Use Are you puzzled about puzzles? This entry might puzzle you more while
+it puzzles out some puzzles: all in a puzzling way! NOTE: the tarball named by the author was removed after the files
+were extracted into the directory instead. These files were added to the
+list. This program can solve a type of logic puzzle known as a Sudoku, and also
+generate new ones. Yes, the test suite really is 5 times larger than the actual program.
+You did say this was a parody of the software
+development process… test.perl expects the
+ Judges’ note: this was done. This program comes with NO WARRANTY, not even that it’ll do what I
+say it should. Any misfortunes that occur as a result of using this are
+not my fault. Go find some unpopular multinational to sue instead. This program is not copyrighted and is entirely my work. Distribute
+or modify it as you wish, though please give me credit. (If you know, feel free to skip this section. Get more details from
+the wikipedia
+entry) A sudoku is a type of logic puzzle. You are given a grid of 9x9
+boxes, some of which contain digits. This is divided into a 3x3 set up,
+e.g. (from the Wikipedia article - fairly easy): You have to fill in the remaining boxes so that each row, column, and
+smaller box contains all of the digits 1-9. That’s all the information I
+needed to figure out how to solve them, but there’s a useful tutorial on
+http://www.sudoku.org.uk/, which is roughly affiliated
+with the Daily Telegraph, a
+UK newspaper. Now, with modern computers this can be solved using
+brute force, e.g.: Judges’ note: this was added as aidan.alt.c. That isn’t the approach I’ve used; it’s slow (particularly in
+worst-case or nearly so scenarios), inelegant, and not a good starting
+point for sudoku generation. It’s also much too easy to understand ;-)
+Instead, I’ve written a program which solves them in much the same way
+as I do, only a lot faster (and hopefully more reliably). Oh, and if you think that example sudoku is too easy, try this one
+(which my program generated): Be warned - it’s evil! (I certainly haven’t been able to solve it by
+hand. The brute-force program given above, or, if using gcc, try: Note that this requires Perl 5 (I use 5.8.5, earlier versions
+untested) and is somewhat slow (should take under a minute on a fairly
+modern PC - try appending Input should be the numbers of each row in turn. Empty spaces can be
+represented as a full stop ( Output consists of the problem, then the solution, then a message of
+success/failure. Output is a blank grid, then the solution, then the problem. There’s
+no control over the difficulty. Sorry. However, all generated sudokus
+should have exactly one solution - if one doesn’t, that’s a bug. Fast enough. Solving and generating are practically instant on my
+1Ghz Duron. Of course, there could be some cases which take longer… More precisely - 400 random sudokus are generated and solved in about
+45 seconds in tests on my PC (1Ghz Duron, gcc 3.4.1, None known - hopefully I’ve worked out all the major ones. Nothing
+has come up in testing since the last bug fix, but what does that
+mean? Tested on: RETEST Borland C 4.5, 16-bit DOS .exe (small memory
+model) I don’t count the fact that it first prints a blank grid whenever
+asked to generate a sudoku as a bug - just a minor quirk. The fix is
+slightly awkward and would make the program slightly longer, so I
+haven’t bothered - it’s not important. No control over the difficulty of generated sudokus - they vary
+from easy to hair-tugging near-impossibility. Solver beware. Seeing as
+apparently one program took six
+years, I’m in no hurry. Some sort of curses-based UI to let you solve interactively might
+be cool, but I don’t feel like learning curses just for this. Besides, I
+spent enough of the time swearing as it is. If you mistype a sudoku (e.g. from a paper/magazine) - and you
+will - it can’t help you figure out where the mistake is,
+sadly. Dependant on ASCII, requires that an Also requires that Apparently, a few can’t (ANSI C specifically doesn’t require that
+this works, though it usually does). Unfortunately, I didn’t discover
+this issue until too late. (It was mentioned in the notes for people
+modifying GCC in the “beware of obscure compiler limitations” section,
+so I’m figuring it’s quite unusual.) Some when compiled with
+ Borland C also spots some code in expressions which has no effect,
+and some uses of Let’s see now: So basically, just what you’d normally expect in an IOCCC entry. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/anon/index.html Author: NOTE: there is an alternate version for vi(m) like movements. See alternate version below. If your terminal has
+problems with the This will compile anon.c as The current status of this entry is: For more detailed information see 2005
+anon in bugs.md. After a very large number of moves this program will deliberately
+force itself to destroy its runtime stack. This is the author’s way to
+prevent you from being frustrated (which might happen as it likes to
+create unsolvable puzzles just to hook you) and spending too much time
+playing. :-) This is supposed to happen. As is written in the The Jargon
+File: If you want to see this in action you can easily do this: What happens if you specify a larger board? For instance: If you specify more than three args the program might also crash or
+do something strange. This might also happen if you specify excessively
+large board dimensions. Try The alternate version uses To compile the version without Use Taking the 4x4 board with 15 tiles to a whole new level, this entry
+takes this puzzle to a whole new dimension! While you puzzle out this
+puzzle, we invite you to take a good LONG look how and WHY
+ Remember Sam Loyd’s Fifteen Puzzle? It
+consists of a 4x4 board with 15 tiles numbered 1 to 15, and an empty
+spot. The goal of the game is to slide the tiles around without lifting
+them off the board, so that they become sorted. Well, that was then. This program is the 21st century version of the
+Fifteen Puzzle: not only does it allow arbitrary board sizes, it also
+supports 3D boards! The tiles are numbered from 1 to N, where N
+is one less the number of spaces on the board, and the goal is to
+rearrange them so that they appear sorted in the order they appear on
+the screen. The program takes 2 or 3 arguments, specifying the dimensions of the
+board. For example, to play the original version of the Fifteen
+Puzzle: To play with a 3D board, do something like this: WARNING: do NOT run the program with more than 3 command-line
+arguments. This will trigger a bug that will cause it to crash or do
+something strange. :-) Also, resist the temptation to create very large puzzles. The program
+does not attempt to resize your terminal for you, and will produce
+confusing output. It may also crash on you if you insist on running it
+with excessively large board dimensions. :-) (10x10x10 is considered a
+safe upper limit.) The empty space on the board is represented by a space filled with
+ To quit the game: Note that, for example, sliding the tile above the current empty spot
+downwards will fill up the empty spot, and create a new empty spot above
+where the current empty spot was. Hence, you could think of the movement
+keys in terms of how they effectively “move” the empty spot: NOTE: as a measure of alleviating
+counter-productivity due to addiction to this game, particularly for
+those hardcore gamers who insist on solving a 10x10x10 puzzle during
+work hours, and also to give an upper bound to user frustration when the
+program generates an unsolvable puzzle (which it does roughly half the
+time, just to hook you), the program will, after a very large number of
+moves (which is system-specific) terminate itself by forcefully
+destroying its own runtime stack. This will result in a core dump and/or
+an abnormal termination message; but this is a feature, not a bug!
+:-) This program complies with ANSI/C99. It uses ANSI terminal control
+sequences, and so requires a terminal that understands ANSI sequences,
+such as VT100 or xterm. Some compilers may emit lots of warnings about how things ought to be
+parenthesized (e.g. The program also uses The game requires lots of space on the runtime stack space due to
+deep recursion, among other things. :-) See spoilers below for more notes about portability. Clearly, the author is very, very confused. Although he has broken up
+the file into sections labelled with helpful headings, and although he
+has left ample whitespace between all those In fact, the closer you look at this code, the more you realize
+something is horribly wrong with it. For example, why is it that the
+first statement in But wait… why aren’t any statements terminated by semicolons? Why is
+there only ONE semicolon in the entire program?! Why is the author
+opening nested blocks by such strange things as And that Let’s see if it all makes sense after we run it through CPP… Uh oh. The result looks like the diseased imagination of a mind more
+confused than the one who wrote the original code. Unfortunately, unless
+you’re a Lisp expert, it is probably easier to understand the program in
+its original form. (And even then.) But that’s just so, so wrong… The entire program consists of a single expression, returned from
+ The entire program consists of a single boolean expression returned
+from But this is not all. It is comprehensible that the program can achieve branching and
+looping using only boolean expressions and recursion. But HOW does the
+program STORE DATA??? There are no variables of any kind in the program
+except for the two arguments to One might be tempted to think that this program would be highly
+non-portable because of such insane hacks. However, it has been tested
+and proven to work on the following architectures: It probably will also compile and work on many (all?) other *nix
+platforms as well. How does it achieve this incredible feat? Read the following only if you give up figuring it out :-) The program (ab)uses an implicit assumption underlying practically
+all architectures, and that is that parameters to C functions are
+implicit local variables allocated on the runtime stack. This runtime
+stack is a contiguous section of memory, and therefore, after
+ (Theoretically, the runtime stack doesn’t have to be
+contiguous… but all current architectures that are worth consideration
+make this assumption. I submit that this implies this program is 100%
+portable, even though theoretically it shouldn’t even work in the first
+place.) :-) There are two types of architectures the program must handle: those
+that allocate the stack top-down, and those that allocate the stack
+bottom-up. The program correctly detects this at runtime, and adjusts
+itself accordingly. :-) (It is a simple matter of testing if the address
+of To avoid having to handle issues of [*] After the stack is deemed to have grown deep enough to be a
+sufficiently [**] for “Memory Allocated by Stack Smashing” :-) Note that from this point on, all bets are off as to what the
+contents of the runtime stack are below the current recursive call to
+ In spite of the frightening appearance, it is probably easiest to
+understand the code in its original form. (Don’t even try running
+ Most of the Why are However, it is possible to implement a is equivalent to: Note the “wrong” indentation in the former: the author prefers to
+write it that way, since the analogy to the usual In spite of all appearances, Finally, for those who give up deciphering this horribly confused
+code, here are the mappings of various locations of the
+ (CAVEAT: not all of these mappings ended up in the
+final version of the program, mainly due to size limitations which
+entailed the trimming off of a lot of neat features in the game. It is
+left as an exercise for the reader to figure out which of these are
+actually used.) Note that Note that some of the manually-implemented states (those not
+implemented by The original intention was to include a parity-checking routine in
+the game so that it will always generate a solvable game. However, size
+limits necessitated the removal of this code. And besides, the game is
+more addictive when it’s sometimes unsolvable. Especially when it taunts
+the user with a smiley. :-) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/boutines/index.html Author: You will need an SVG viewer.
+Look here to find some SVG
+Viewer Implementations. The following will create an After running the above commands, use ImageMagick’s
+ and then open it with your preferred graphics viewer or editor. If you have a program that opens SVG files then
+you could open the Can you explain the author’s remark “[generated files] are not as
+scalable as their name suggests”? In memory of my father Pierre Boutines-Vignard. My program works as follows: A list of 2D points in the unit square. A Voronoi
+diagram of the set as an SVG stream. This will possibly save a compressed SVG file and may be useful: Input consists of a list of floating points values separated by
+whitespaces (ranging preferably in Strictly speaking, you have to provide a set of
+points. If there are duplicates in the list, there is no guarantee on
+the one to be shown (in addition their labels will overlap) in the
+resulting colored Voronoi
+diagram. This program might have been a lot shorter, but nearly impractical
+even for medium sized datasets. On the other hand it could have been a
+lot faster, but hard to qualify under the IOCCC size limit. So guess
+what I did? A compromise favoring innermost obfuscation, sacrificing
+sometimes speed and other tedious factors. Therefore this entry is limited to points and won’t even be suitable for more than a few thousand;
+although generated files did pass the W3C SVG
+Validator, and are highly compressible, they are not as scalable as
+their name suggests… For serious applications about Voronoi
+diagrams, see Qhull, CGAL and the like but you may still
+encounter large output volumes (and have to handle some sort of clipping
+in order to represent properly infinite regions of the diagram in SVG). Beware, compilation may report warnings about precision loss, linting
+may be a disaster, but the code should remain portable, and the output
+accurate enough for most devices (including many inkjet printers). If
+you ever miss precision on a particular dataset or peripheral, you may
+want to dive in and let NOTE: bad inputs will be sanctioned by the production of the 42nd Mersenne prime
+(i.e. 2^25964951 -1); memory will be kept. I’m quite divided on the subject because I wrote: Be sure to check the antepenultimate line of code. Cell colors are chosen randomly (with a questionable rejection
+scheme). It might have been useful to input them along with sites
+coordinates, turning the application into a puzzling graphics
+engine. The points are implicitly numbered in the order they were entered
+(starting at one). This can be overridden however, via a simple XSL
+transformation. The site radius is hardcoded in the code, I still wonder why I did
+not design it as a function of the underlying cell’s area (which can be
+averaged for free) or at least a command line parameter. Same with the
+char set, the viewport and potentially every SVG
+property. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/chia/index.html Author: Have you had your morning cup of Java? You might want a second cup
+before parsing this entry. And give your C pre-processor a triple shot
+as it tries to handle parameters for “stringification”. Two things inspired this entry. First, there were the C programs
+which were As chance would have it, I was writing some Java
+code at that time, and one of my net friends was also working on someone
+else’s Java code. We both hated Java; indeed, I hated Java so much that
+I was tired of hating it. Then I remembered my earlier idea: “Of course!
+Why not write C code that looks like Java? And poke fun at Java while
+I’m at it? All ye behold, as I turn anger into action! PH34R MII!!!!!!!”
+And so, this entry was born. :-) Besides carrying a revolutionary message in the comments, this entry
+also draws a spiffy little Koch snowflake
+fractal on the screen, with the help of ANSI escape
+sequences. The code requires a preprocessor that can stomach all kinds of
+nonsense that are passed as parameters to macros for stringification.
+GNU cpp
+handles such things just fine, but certain broken preprocessors may
+decide to freak out when they see macro parameters that don’t look like
+C tokens. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/giljade/index.html Author: NOTE: We FORCE the use of -O0 even if someone overrides it because
+this entry will not work with it enabled. The current status of this entry is: For more detailed information see 2005 giljade in bugs.md. Open an xterm with 78 lines. Press This entry takes editorial in how it deals with its output. After
+using If you really understand expressions, then understand this: … and understand why it is found in the source code. Just run the executable with no command line args and look at the
+output. In order to properly enjoy it you will need two good old
+programs: The program solves (very very fast) a sliding block puzzle. There are
+many variants of such puzzles which are usually made from wood or
+plastic pieces. The start position can be recognized by looking at the
+program itself. The goal is to move the big piece (2 by 2) to the center
+top, which takes 179 steps in the shortest move sequence. Notice that the step count used by the program is longer than the
+traditional step count for such puzzles, as normally if the same piece
+is moved twice in a row it is counted as only one step, but here it is
+counted as two. The printout of the solution however is in a rather unorthodox form,
+as can be easily discerned. As you have probably suspected each of the
+steps in the solution printout is a C program which compiles to result
+in - surprise surprise! - the original (well almost). Actually, This program is smarter than merely printing ITSELF in 180
+different layouts. It is self-improving, in that the programs it prints
+have three advantages over the original: Their layout is more precise (Notice the annoying Their binary output does not rely on the source file being in the
+same directory, and will not dump core if it doesn’t (like the original
+does). :) They have much more comments (Not very helpful ones
+though). In addition as we all know bugs can creep up on us in the most
+unexpected of places, and checking that indeed the output is composed of
+180 legal C programs by hand can be quite tedious, hence the program
+also include a self- test mode. Just run it with the output file as
+command line argument. It will then try to compile each of the programs
+(printing the line number where the program starts). It will stop where
+any compilation fails and the culprit program would be in the file
+ Notice that the self-test does not try to run the result of the
+compilations but this can easily be done. Try it and diff the output of
+any of the 180 results with the original output. Of course all 180
+programs also include the self-test mode. Because it says so, and twice is better than once! All the usual suspects i.e. The board representation is efficiently compressed hence
+obfuscated, and the algorithm that is used to generate possible moves is
+extremely efficient. In fact it can compute several moves in parallel on one processor!
+Moreover only the most efficient bitwise logical operations, shift,and
+subtraction by one is used. No inefficient conditional tests and jumps
+are needed in that part of the program. The single expression I’m most proud of, and would have submitted
+to the category of ‘best obfuscated short expression’ if there was one
+is: Can you figure out what it does (very efficiently) and how it fits in
+the scheme of things? IMHO the program is easier to understand before running cpp on
+it. It is also shorter that way to be sure. It even takes care to obfuscate the comments in the output
+programs. Having the output programs a bit different than the original is
+more interesting. I have written an earlier version of the program about half a
+year ago and when returning to it now I had to sweat quite a lot to
+understand the f***ing mess I’ve made. Some As mentioned earlier if you try to run the original program without
+its source in the working directory it will dump core. The program relies heavily on the ASCII coding system (have I seen
+this comment before ?). It also implicitly assumes that
+ What use are the Why do I use Why not write What is Use the program to solve for a different starting position. It is not
+that difficult. Notice however that if there are more than two empty
+spaces the outputs would not compile as the layout would not be
+sufficient to contain the program. Use the program to solve for board size different than
+ Just try to change the program, and use the self test to see what
+happens … This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/jetro/index.html Author: This entry requires SDL to be installed. See the FAQ for information on how to install
+it if you haven’t already. If you have SDL installed: We have seen entries with SDL graphics in the past, now it’s time for
+SDL sound. This entry can even be run on a computer without a sound card
+with an appropriate setting of an environment variable - for that you’ll
+have to dig into the SDL documentation. Can you figure out how the notes are encoded and program a different
+melody? To compile the entry you need SDL library, which is used only for
+audio output. To run the entry make sure you have audio output
+available. The entry plays 22KHz 16 bit mono music with a small
+softsynth. When the music plays, you can stop the application by
+pressing enter, as the code will just wait with one call to
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/klausler/index.html Author: To reduce the size of the source, include other people’s data. That
+is what Peter suggests when he describes how to generate a critical
+header file. In other words: make use of other words! :-) Rules might have to be changed! A useful tool to help one appear extra smart and witty when IRCing, or
+even to just be highly annoying. Finds best anagrams for word or phrase given as program arguments.
+Use only lower-case letters in these arguments. Output is sorted firstly
+in ascending order of word count (fewer words are better) and secondly
+in descending order of word length. Pipe the output into
+ Some history and explanation: When I noticed the call for entries in
+this year’s IOCCC, I submitted two of them. I worked on the first one
+very hard to obfuscate it beautifully, using a goofy algorithm,
+wonderful two’s-complement arithmetic tricks, and cute formatting. It
+was a glorious work so lovely as to make even strong men weep in
+admiration… but it didn’t win anything. On the other hand, this crappy
+little other program, which was only mildly obfuscated from its original
+hacked form, took home an award! I’m embarrassed to admit that I don’t even know which specific rule
+this entry has abused. It’s just yet another anagram generator and it
+was written very late one night. And now I honestly do not know how it
+works, so please don’t ask. Upon reviewing the program after its
+unexpected honor, I guess that it’s remarkable only for its complete
+lack of macros, sneaky naming, This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/mikeash/index.html Author: The current status of this entry is: For more detailed information see 2005 mikeash in bugs.md. NOTE: the author stated that they tested this under i386 machines but
+this works under 64-bit (x86_64, arm64) machines too. Having problems speaking code? Do you LISP?
+Parenthetically speaking, this entry takes advantage of C99 features,
+while speaking parenthetically. Best of all, it self-reproduces! John McCarthy might not have imagined it quite like this! :-) This program is a self-reproducing program, which is on the IOCCC’s
+list of discouraged program types. Worse, it’s a self-reproducing
+program written in Common Lisp. What’s
+this doing as an entry to the IOCCC? Start over: this program, when compiled with a C99 compiler, is an
+interpreter for an extremely limited and highly broken subset of Common Lisp. It requires C99 because of Try: You should see This evaluates the expression The program can also be run in an interactive mode, by simply
+executing Aside from being required to put spaces between tokens and closing
+parentheses, there are other limitations on the dialect of Common Lisp that
+this program understands: The only built-in functions are Only one variable is available. This variable is called
+ Only the first letter of a function name is significant. For
+example, The Character constants are limited to The The The arithmetic functions take exactly two parameters. All tokens must be separated from a following A lot of other things. Notably, the language which this program
+interprets is nowhere near Turing-complete. Basically, the LISP
+interpreter is good for some basic math operations, and for running
+itself. To do the latter, try this: The program can also be run from an implementation of common lisp. To do
+this, run the common lisp compiler and then type the following
+command: The source code of mikeash.c will be
+printed. The program comes in at just under 2k of significant characters.
+However, this size is exaggerated, because it contains a complete copy
+of itself for the self-reproducing LISP
+program, making it twice the size. This doubling effect made it
+something of a challenge to fit inside the IOCCC’s size limit. This code should be highly portable. It was tested under Mac OS X and
+Linux on i386, but it should run elsewhere. It requires ASCII due to
+hardcoding various character constants. Other than this requirement, it
+should run anywhere there’s a conforming C99 compiler and a standard C
+library. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/mynx/index.html Author: There is an alternate version that scans for (ONLY scans)
+the string The current status of this entry is: For more detailed information see 2005
+mynx in bugs.md. You can specify a port by appending to the domain Obviously this will not work with The alternate code is a starting point that scans for
+ Use but again unless you have a clever workaround or hack to the problem,
+this sadly won’t work. This little I was rather impressed by last year’s mini webserver. So much so that
+it inspired me to try my hand at writing the client side complement. A typical build command would be: While some others like to be a little different: I even managed to figure out a basic configure script, given last
+year’s example, which is kinda of useful when you consider how many OSes
+put all the network functions in a variety of places. So a simpler build
+command sequence would be: After which, the rest of the documentation can be read by saying: Manifest: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/persano/index.html Author: There is an alternate version of this entry which should work for
+Windows by setting binary mode on Open the GIF file
+with a viewer capable of displaying animated GIFs and watch closely at
+the bottom of the picture (you may need to use gifsicle - a great tool to
+manipulate animated GIFs - to slow down the animation and to compress
+the GIFs generated by the entry). This (untested as we have no Windows system) version uses the Windows
+API functions Use Follow the same instructions, using different tools if necessary, as
+the above try section. If your system is one of those that distinguish between text and
+binary streams, you must know what to do to switch the standard output
+into binary mode (e.g., adding a line to the source code or specifying a
+linker option). What needs to be done to fix the problem? Solving the author’s exercises below may or may not help. At the time of judging, the approximation of π used in the program could
+not be found on https://mathworld.wolfram.com. knot writes animated GIF images of rendered torus knots to
+standard output. A Sample usage: writes a non-animated GIF (a single frame) stream of a rendered
+trefoil knot to the file writes a GIF stream with a rendering of Solomon’s Seal
+knot to standard output; since the number of frames is not
+specified, an animation with 40 frames will be written. Please view the code with 8-character tabs! The program writes fully valid GIF 89 streams. It is suggested that the output be viewed with a program capable of
+displaying animated GIFs, such as almost any graphical HTTP browser. Due to code size constraints, full LZW
+compression was not implemented 3. In fact, the output
+images are even somewhat expanded, thanks to GIF overhead. The GIF format supports only a limited number of bits per pixel, so
+the program uses ordered dithering to emulate full RGB output. The program was tested on Linux, with gcc 3.1; Cygwin, with gcc 3.3;
+and Solaris/SPARC, with Sun’s C compiler. The only major portability issue should be reliance on ASCII. It should also be mentioned that the program won’t work on systems
+that distinguish between text and binary streams; however, since hardly
+anyone uses such systems in this day and age, this is a minor issue. 4 (1 point) The surface is composed of many small polygons. Try to
+make it smoother by increasing the number of polygons. (2 points) Figure out how to change the radius of the tube cross
+section. (5 points) Locate the famous transcendental constant π in the code. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ You can call such a transformation an “ambient isotopy”
+if you want to impress people at parties.↩︎ Also known as the “unknot”, which sounds slightly less
+impressive than “ambient isotopy”.↩︎ Unfortunately (for the author), the convenient excuse
+that LZW compression was not implemented in order to avoid the Unisys
+patent can no longer be used.↩︎ ;)↩︎ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/sykes/index.html Author: The current status of this entry is: For more detailed information see 2005
+sykes in bugs.md. For those who fondly remember their first PET, this entry
+will start you down memory lane … starting with We encourage you to try and grok the obfuscated expression on line
+56, after the C pre-processor gets finished with it! We downloaded the ROM contents to use
+the emulator in PET mode as
+follows: We then created: For your convenience, we have added the above mentioned files to this
+entry directory. They were used to form the This program is not only a complete Motorola
+6502 processor emulator, but also an
+emulation of the Commodore PET
+2001. This is the second version of the same entry, but this one takes care
+to not include any possibly copyrighted items in the info files, to be
+sure to not infringe the rules. Compile the program, then test the 6502
+emulation like
+this: A basic test is done for each instruction and addressing mode, all
+tests should pass. At the end of the tests, it loops forever - break out
+with control-C. Cast your mind back to 1977… a little company called Commodore
+introduced the PET, the Personal
+Electronic Transactor. The machine was
+a hit, and history
+was made. Now you can relive those wonderful times with this PET emulator! Make sure you have a terminal
+window of 40x25 chars or bigger, and then run the emulator like
+this: You should see the startup message. Try typing in some BASIC - for instance: There is an optional numeric parameter, which controls the speed. For
+a slower cursor blink, try and for faster The default is 4. The control keys are as follows: Supplied also is a short demo program written in BASIC. Try typing Many other old programs will run in this emulator too. Files with a
+ You can save programs too - try You also might try typing this to see an ancient Easter
+egg: The program is basically a 6502
+emulator, and it
+does NOT need the Commodore ROM to work. Supplied as a demonstration is a compiled-for-6502
+version a chess program (heh, I found a use for a previous losing entry
+:) ). Try: It works as you would expect (it plays very badly). There’s no
+castling or en-passant, and to win you must actually take the opponent’s
+king. You can write your own programs too, any 6502 assembler
+should work. The emulator
+loads the supplied file at The screen memory begins at The 6502
+emulator receives
+an interrupt 60 times a second or so, you may want to disable interrupts
+(with the In 6502
+emulation mode the
+special PET
+character codes are not used and the screen understands normal ASCII. Lastly, before emulation starts, the
+low byte from a Most of the program comprises the 6502
+emulator.
+ Much of the obfuscation comes from the need to squeeze in the 6502
+emulation as well
+as faking enough of the PET hardware for
+it to work. If the supplied file is exactly 16384 bytes, the emulator assumes it is
+a PET ROM, and goes into
+PET emulation mode. Otherwise some PET specific features are skipped
+during normal 6502
+emulation. The main processing all happens in a heroic expression containing no
+less than 64 ternary operators (after The addressing mode is decoded in a similar expression starting on line
+53. The machine emulated is an older 40 column PET, so 80 column
+programs will not show correctly. There is no emulation of PET graphics
+characters. The parameter controls the speed of the 60Hz “jiffy clock”, and not
+the processor speed. This means many games may run too fast to be usable
+- it really depends on the speed of your machine. Although the PET emulator can do
+ The PET
+hardware emulation
+is not at all complete - features such as the hardware timers are
+completely missing. Some programs will not run correctly. The 6502
+emulation does not
+include the seldom used decimal mode, or any of the “undocumented”
+instructions. I think it is great fun to run the PET emulation and mess
+around with Microsoft BASIC. However, this
+obviously needs the ROM file to work. My
+program is original and completely free of any copyright, but, of
+course, the What does this do? Have fun! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/timwi/index.html Author: Unlike most BF
+interpreters that we have been receiving for the last few years, this
+one, in our opinion, is the most obfuscated albeit the most discourteous
+to the language it interprets. A simple 3-character fix will make it
+slightly less so. Quite a few BF programs found on the Net expect byte-based memory,
+quite a few exceed the capacity of this interpreter, but there are many
+that work. Some small quines work,
+some don’t. Why? This is an interpreter for the programming language BrainFuck (BF). Input must be provided in the following format: First a sequence of
+integers separated by whitespace (this will be the input to the BF
+program), then a You must not pass any command-line arguments. Supports the complete set of 8 BF instructions
+( Supports the use of alternative characters for some of those
+instructions. Use this to obfuscate your BF programs! For a challenge, figure out what this obfuscated BF program does: It takes two integers as input and outputs one integer. Ignores all whitespace (newlines, spaces and tabs) in the input
+program. Since the program, naturally, uses You are limited to 3125 input integers and 3125 instructions. If you
+exceed one of these limits, the behaviour is undefined. Some of the superficial obfuscations are pretty obvious: I’m using
+ However, the more subtle obfuscations relate to the way the program
+works. After applying the pre-processing, you will see a lot of
+ The program will first read in all the input integers, but it will
+begin execution immediately and only read program instructions as they
+are needed. Yet there is no global variable storing how far it has read!
+Perhaps the hardest thing to figure out is how it finds the matching
+square brackets. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/toledo/index.html Author: Two alternate versions of this entry, toledo2.c and toledo3.c are
+provided. To compile the alternate versions: Use Use Challenge yourself with your ability to look 5, 6 or more moves
+ahead. Challenge your knowledge of C operator precedence. The following
+is the move analysis via recursion while it executes moves. All while
+playing by the rules of C and Chess within a single function! When this entry was submitted the code was a recursive call to
+ This is a chess
+program, it can work in two modes: two-players, and one player (always
+white) against the machine. To get the first mode, run the program
+without arguments: The other mode is accessible running the program with one argument
+(5-ply
+analysis): Two arguments for 6-ply
+analysis: And each successive argument will analyze one ply more.
+There is no ply limit, but beyond 7 ply is very slow, try it at your own
+risk and computing time. When it is your turn, you can enter your move, for example, as
+ One special case is when you are doing promotion, you must enter the
+move with an extra letter indicating the desired piece. For example Note that the program requires the piece letter; it will not select
+automatically a queen, so don’t be surprised if it doesn’t accept your
+move. The computer will check for checkmate and stalemate. Also, after each
+machine move, it will show the score of the position: a higher number is
+better for the computer, i.e. worse for you. None. This is a good example of a chess program reduced to the essential.
+In order to get it into the contest limits, I used short but slow and
+unintelligible algorithms. The interface accounts for only a fraction of the code, the core does
+multiples functions: it is called recursively to analyze and evaluate
+each ply,
+does alpha-beta
+pruning, move generation, machine playing, check detection, illegal
+move verification and does moves after they are verified. It also sets a standard on ultra-mini-chess programs. The player and
+the computer can do all legal chess moves. Other features are: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/vik/index.html Author: An amazing use of the X libraries with twisty code passages, all
+different. One risks running in code path circles as This entry is a Wolfenstein style
+graphics
+engine where a user can navigate in a 3D world.
+The maze has walls with
+bitmap
+textures. The application contains a default world with textures,
+but the power of the engine is exposed through user configured maps. User defined worlds
+support up to 26 different wall textures that can even be animated. One
+example of a user defined world is submitted with the entry. This program is a complete 3D engine with Compile the source code and link in X libraries if necessary.
+The program takes three options which have to be typed in a specific
+order as described below. where: Start the engine using a built in labyrinth and texture bitmaps: Start the engine and loads the labyrinth defined in the file maze.map: Start the engine using maze.map in a window
+that is 400 pixels wide: Note that the Use the cursor keys to navigate through the labyrinth. A maze consists of a map file and texture bitmap files. The map file
+is an ASCII text file where lower case letters represent walls. The
+letter tells the engine what bitmap texture file to use. The
+ The engine loads the map, and creates walls. When a character in the
+range So to load the map above, the files The program is obfuscated in several ways: There are no compiler warnings when compiling with The program only compiles and runs on X based
+systems. The program does not run that smooth under Cygwin. It seems to be a
+priority issue with Cygwin and it can easily be solved by increasing the
+priority of the application a little bit. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2005/vince/index.html Author: Before building, make sure that you have the OpenGL development
+libraries installed. When running this in the program’s window try hitting space a few
+times and see what happens! The vince.alt.c code of the submission will
+run on SGI IRIX and also has the recursive To compile this alternate version: Use Try it just like This beauteous entry makes use of visual NOTE: when hitting space bar make sure that the program window is in
+focus! Challenge: Try modifying the texture to something of your own
+design. The executable needs to read in its own source code in order to
+run. As long as the source is in the same directory as the executable it
+should be able to find it… The program requires the OpenGL library. The program abuses severely the whitespace and OpenGL. It works (slowly) with Mesa. 16bpp graphics capability (but might work at other
+depths) The original source needs to be in the same directory as the
+executable, and the source’s name should be the same as the executable
+but with I was annoyed after the last IOCCC because I slaved away on a clever
+text based game only to find all of the game winners used X11. X11 isn’t
+standard C! So to one up them, I decided to use OpenGL. It’s standard, and most
+Unix-like systems these days have either accelerated graphics or else
+software rendering. It was a challenge getting the source code below the 2k limit. OpenGL
+has way too many ‘ Therefore, much of the obfuscation comes secondary to just reducing
+the code size to fit under the limit while still having some semblance
+of a demo. There are some interesting abuses scattered about. Try hitting the space bar when the program is running. Try modifying the texture to your own custom design… Many thanks to John Clemens for testing this on various machines for
+me. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/birken/index.html Author: The current status of this entry is: For more detailed information see 2006
+birken in bugs.md. etc. Q: EDAMAME? A: Electronic Design Automation - Mechanical Abstract Machine
+Emulator What is TOFU? It’s not a veggie friendly food, nor it is Verilog or VHDL It is not even Pascal! NOTE: On some systems, It may not be the most readable hardware description language, but it
+is one of the easiest 55 page long manuals to learn. :-) For a small but non-trivial design, try implementing a Linear Feedback Shift
+Register And for those who are still confused, see http://en.wikipedia.org/wiki/Edamame and http://en.wikipedia.org/wiki/Tofu. If man is capable of creating tofu hot dogs (simulated
+meat), then why not tofu circuitry
+(simulated circuits)? This program is my tribute to the early computer
+pioneers like Konrad
+Zuse. It’s an educational tool designed to introduce students to
+digital circuit theory using technology that was considered state of the
+art in the 1940s! To enable you to fully understand the capabilities of
+this circuit simulator, I have included a 55 page manual (info.pdf) in the info portion of the entry
+submission. The primary obfuscation is the data structure chosen for parsing the
+input file and for executing the simulation. Oh man… coding that data
+structure gave me such a bad headache. But, I figure, who needs more
+than a pair anyway? Subtle obfuscations abound. Bonus points go out to
+the one who discovers the hidden program within the source. Note that the shape of the source is a wave, not a waveform. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/borsanyi/index.html Author: The current status of this entry is: For more detailed information see 2006 borsanyi in bugs.md. This entry uses a very user-friendly representation of the font it
+uses (with a few exceptions). Check out the source and see yourself!
+:-) The resulting GIF file is likely to puzzle optical character
+recognition tools. The amount of imagination necessary to recognise the
+ Most spam robots collect email addresses from the web sites of
+innocent people, like you. Conference organizers cannot disclose the
+participant’s address to prevent malicious users from grabbing them. One
+solution is to write as This program creates a GIF image file from the address given in the
+command line. To avoid complications with patent issues the LZW
+compression feature is not used. A typical email address is stored
+in less than 1-2 kilobytes. The address cannot be longer than 42 characters, and may consist of
+the characters: The program is (like email addresses are) case insensitive. Multicore support is a must in present-day applications. This entry
+supports up to 25 cores. The odd names in the bottom part of the program
+do have a meaning, they are not there just for obfuscation. The
+preprocessor is used to keep the program small, in fact, everything is a
+macro. Are you familiar with the GIF format? Studying this program will
+give you a (very) little insight. After analyzing the source code, try to answer these questions: The program uses POSIX threads (using the linker flag
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/grothe/index.html Author: … and then put on your “electronic ears”. You may find using a
+tunable scanning electronic ear helps. There are other text files you may wish to try: Most of the time, interference is annoying. This entry is the
+exception that proves the rule. What is a bug to some is a feature to
+this entry. :-) The program draws patterns on the screen that can be picked up by a
+shortwave
+radio. It emulates the frequencies for an old fashion touch tone
+phone, so old songs can be played by hitting
+ To be able to run the program you need to determine the following
+parameters: If you have Example from my laptops: Even if the user gets a setting off, the sound will usually be able
+to be heard on AM at a
+multiple of the original frequency. The core idea of using a machine to play music on AM radio goes all
+the way back to the Altair computers
+and Timex Sinclair
+ZX-81s. Olympics Fanfare - from Twinkle Twinkle Little Star - from Generic Arabian Tune - from Others can be found by doing a search for “touch tone phone
+songs”. Some numbers expressed in Octal, some in hex and some in decimal:
+“A foolish consistency is the hobgoblin of little minds” - Ralph Waldo
+Emerson. Funky scoping, looking at the nanosleep section and
+ Algorithm is very weird, uses lack of figuring out your use of commas in various places, confuses most C code beautifiers
+sometimes making the beautified code harder to read use of uses does sound using only X11 libs, no other libs
+required. demonstrates tempest emissions in a fun/easy way. follows good programming practices of actually setting exit codes
+and giving usage when run with incorrect parameters. Tempest for Eliza - Basis
+for Algorithms. Tempest
+AM - Another early program in this field. See here
+for a bit more information on the program (search for
+ The paper Soft Tempest:
+Hidden Data Transmission Using Electromagnetic Emanations by Markus
+G. Kuhn’s and Ross J. Anderson’s. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/hamre/index.html Author: An irrationally coded source presents rational things! A rational person might want to attempt the irrational task of
+supporting a new operator by way of an existing macro in the source. And
+can you determine which macro this is and understand the purpose of its
+arguments? This is a calculator for rational
+numbers. Believe it or not, that is a useful tool to have around,
+and I haven’t found a useful version, much less an obfuscated one. It is rather feature complete as rational calculators go. The
+supported operators are: If you do not supply an argument, the calculator will crash. Other
+arguments are ignored. Supplying more arguments may further limit the
+number of nested operators supported. Remember that By default, only 31 nested levels of operators are supported. The code is well documented, even with an example. In fact this
+documentation accounts for 100% of the source. Personally I find
+preprocessing or re-indenting the program counterproductive when it
+comes to understanding the source. The preprocessed source becomes
+rather verbose. IOCCC entries are often loaded with all kinds of hard-coded numbers.
+I have restricted myself to mostly use sensible numbers
+( This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/meyer/index.html Author: For your first input try: where NOTE: if you do not input three different ‘words’ it will block. You
+can input more text to fulfil the program’s requirements. NOTE: if your move is invalid it will prompt you again but not show
+the board. This entry turns a newspaper solitaire puzzle into a competition with
+the computer to be the last one moving. The object of this source code is to determine the object of this source code! :-) I wanted submit a fully object-oriented entry to show that
+object-orientated code: But I just totally failed. No, I didn’t fail in showing any of the
+points above. Before I even had the chance to prove any of these claims,
+(1) already brought me to my knees. The code got so bloated up, that I
+missed the size limit by a few hundred bytes. Therefore, I broke the
+only rule in this contest, I think you shouldn’t break in any case: Rule
+Nr 2, The size of … The degree of claim (2) actually depends on the compiler. As I
+manually translated it from a generic object-oriented
+programming language to C, it didn’t just end up unreadable, but awfully
+messed up, i.e. obfuscated. As it is already (pre)translated to C, you could also call it an
+object- disoriented program. Comparing this program to a potential object-oriented implementation,
+it is obvious, that object-oriented code isn’t ‘ might do something similar as But this program reveals that it doesn’t. Even worse, this program
+only reveals the tip of the iceberg, what kind of black magic is
+involved in a simple declaration of an object. A few things you can explore about object-orientation in this program
+include: It is left as an exercise to the reader to find a corresponding
+implementation in a popular object-oriented programming language. It is a sudoku
+based game. The goal of the game is to be able to do the last valid
+‘move’. On your turn you have to set a free cell to a value between 1 to 9
+without breaking the following rule. Any number must be unique in
+its: Expected input for your move: where The game can be aborted with The one who can do the last move wins the game. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/monge/index.html Author: Make sure you have the SDL1 (not SDL2!) development environment
+installed. There is alternate version that lets you redefine the width and
+height and number of iterations to use. See Alternate code below. The current status of this entry is: For more detailed information see 2006
+monge in bugs.md. Incorrect formulas will ungracefully crash the program. This is supposed to happen. As is written in the The Jargon
+File: This alternate code lets you specify the width and height of the
+image as well as the number of iterations to perform. To use the default values, the same as monge.c,
+just do: But if you wish to actually make use of it you will want to redefine
+one or more of the variables If you wish to keep the dimensions the same but change the iterations
+to 512: If you specify a value less than 1 for any of these it sets it back
+to the default. The value 1 was selected arbitrarily and such a small
+number as 1 will not do anything useful but as long as it’s at least 1
+it’ll not be redefined. Does not try taking care of overflows but such
+large values would be impractical anyway. Use For those who are familiar with the previous IOCCC winners, this program is best described
+as “1994/tvr meets 2001/bellard”. Here you have
+mouse-manipulated fractals AND generated binary code, all in one
+package. A more appropriate award could have been “Best abuse of the rules”,
+because on a non-x86-based architecture this program is, quite
+predictably, a dud. At the time of judging we were too mesmerized by the graphics to
+realize it; and, after all, this entry does take a special effort to
+work on both Keep clicking with left or right button to zoom in or
+out. Use the number pad Enjoy, unless you’re more interested in trying to understand how
+it works. :) This is a fractal generator that supports custom formulas and real
+time zoom. The program needs to be run with two arguments, the first
+being a semicolon separated list of assignments to do once per pixel,
+and the second a semicolon separated list of assignments and conditions
+that will be executed (and conditions checked) for each iteration (up to
+the maximum). Using the left and right mouse buttons you will be able to
+zoom in and out (a la XaoS), the zooming
+algorithm is a bit slower than Formulas can use all All the constant numbers will be interpreted as real double values.
+Each expression must be an assignment ( Supported operations and functions are: Here are a few examples of fractals you can draw: This program will only work on x86 (with an x87 FPU) or x86_64
+machines, but it requires the SDL library. Another system requirement is the However I was able to compile and make work the program under Linux
+(Debian/x86 and openSUSE/x86_64) and under Cygwin/x86. A friend of mine
+was able to make it work under macOS too. If you want you can change the window width and height, or the
+default number of iterations (that one can be tweaked at runtime,
+anyway) by changing the definitions of Sure, I don’t want to deprive you of the pleasure of digging into the
+infernal mess created by my corrupted mind (writing this remark I
+noticed that I was ending sentences with ‘;’ instead of with ‘.’, and I
+worried for my sanity), but just in case… I used many obfuscation techniques, including a few ones that are
+different from the tricks used in most common IOCCC program (more ‘high
+level’, in the sense that they require an understanding of how all the
+program works to be worked out). This program is a formula parser that outputs machine code that
+calculates the formula and check the given conditions. The machine code
+targets the x87 stack based FPU, and it
+is almost identical for x86 and x86_64 (except for the comparison
+instructions, that have to be generated differently). The program keeps
+track of the FPU stack (the FPU has a cyclic stack of 8 registers) and
+will automatically swap to and from the main memory when required (i.e.,
+adds instructions to the generated machine code to take care of this
+issue). The formulas are parsed recursively and machine code for the inner
+iteration loop is also generated. After generating the machine code, a big event loop creates (or zooms
+into) the fractal executing the generated code when needed, and then
+waits for input events. The zooming algorithm works by remembering for each pixel the
+floating point offset to where the value was actually calculated. When
+zooming, the best match is searched, and if the offset is too big
+( This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/night/index.html Author: There is an alternate version that supports arrow keys. See the alternate code section below. This version allows you to use arrow keys instead of the more awkward
+ Use You’d never guess, from looking at the code, that there is a genetic
+algorithm involved. Somewhere. But what does it do? Well, it might
+take you a while to navigate the results, let alone the code. Don’t worry; this is not a self-reproducing program, as you might at
+first guess from the layout. I would never be so foolhardy as to submit
+an entry on an overused theme! Oh, wait a second… it is a maze-generating program. Oops! This program solves an optimization problem, namely, generating a
+challenging maze. It uses a very simple genetic algorithm: a maze
+layout’s DNA is
+represented as a 32-bit integer, and mutations consist of flipping three
+different bits. The algorithm is simple in that it doesn’t employ sexual
+reproduction, only mutations, and it has a population size of 1. So much
+for diversity! This particular optimization problem, I believe, has a unique
+maximum: there is but one maze out of Should you take my word for it that the maze it generates requires as
+many moves as I say it does? The answer is yes. But if you’re not
+convinced, you can try to solve it yourself. The goal is to traverse
+from the upper-left to the upper-right and out the top, where the number
+of moves remaining is printed. Use the arrow keys for suckers
+( Finally, in the world of DNA, the medium is truly the message.
+There’s a short message encoded in here that will only appear when you
+complete the optimal maze in the required 64 moves. These depend on your compiler, and they were all intentionally added
+for obfuscation purposes. No, really! My compiler warns of nulls in a string literal, and the redefinition
+of the macro With one compiler, compilation took about two minutes. The representation of the maze layout in a 32-bit integer type is
+pretty opaque. As a hint, the optimum layout’s DNA is, in base 4,
+ The recursive function The maze-solving function Four-letter alphabets are confusing. I don’t know how ribosomes manage. Overloaded symbols, such as Who needs Who needs For that matter, who needs fixed-iteration-count Keypad support was removed to save space. To restore, modify the
+following two macros to: Code on! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/sloane/index.html Author: We recommend the alt version so that you can see what this looked
+like back in 2006. If you wish to see the original faster version see original code below. The alternate version, which we recommend that you use in order to
+see what is happening with modern systems, and to not flash too quickly,
+which can be problematic for some people, can be configured to different
+speeds by way of the value used in If you wish to make it like the original, as if the below Original code was being used, you can do: Should you wish to see the original you may do so with the original
+code, sloane.c. WARNING: if you are easily overstimulated with fast movement or have
+photosensitivity please be careful running this version and instead see
+the above! NOTE: again as above, to see what is going on, we recommend that you
+instead use the alternate code which we described in the To build and try sections
+above. Looks almost good enough to eat, dunnit? I suppose you could argue
+that, at first blush, this looks like a self-reproducing program. This program doesn’t require any special build options, other than
+that it uses You will almost certainly get a compiler warning because I declared a
+bunch of global You will need some kind of VT100-ish emulation; so while this
+compiles and runs OK in Windows, you will need PuTTYcyg or something
+like that. The shape of the source gives a hint about its output: it’s a little
+animation of a shaded donut rotating over an infinite checkerboard. Like
+many IOCCC entries, it is thus self-documenting. I wanted to create something as “pure” as I could - meaning that the
+entire source code is shaped into a work of art, without being prefixed
+by any The donut isn’t raytraced. It’s much simpler than that. There are three main pieces to this program: the donut, the
+checkerboard, and the ASCII logo. The first two are programmed in a
+straightforward way (with z-buffering even!),
+but the mathematics for drawing them is “optimized”. The ASCII logo has
+been shrunk into the smallest I could make it by any means
+necessary. The logo can actually be compressed much better (ironically, by doing
+something simpler), but I didn’t discover this until well after
+submitting. In increasing order of difficulty: Can you change the shading of the donut and
+checkerboard? Can you change the movement rates of the donut, the checkerboard,
+and the scrolling logo? Can you change the inner/outer radii of the donut? The
+height/scaling of the checkerboard? How is the “IOCCC 2006” logo encoded? Can you put something else
+in its place? Can you find a smaller encoding? This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/stewart/index.html Author: where NOTE: you cannot specify a different width from height; it’s one
+number. NOTE: Now open the images in your favourite graphics viewer or a web
+browser. Note the interesting choice of using a The program should be run with the following where: The program will spit out an XBM image on standard
+out. Minimal checking is done on the arguments mainly that there are 3.
+Wrong arguments will cause the program to bomb out. The program compiles without warning with
+ The program was tested on Linux on a x86 and NetBSD on an alpha. Only
+gcc was tested for compilers (4.0.3 and 3.3.3). In looking through past winners, there seem to be only 2 (92 and 94)
+that generated fractals. Both of those were Julia fractals from
+the Mandelbrot
+set. Those do make for some pretty pictures. I figured it would be
+nice to add some more fractals to the IOCCC, since one hasn’t won since
+1994. Instead of something that has already won I figured I would go with
+another kind of fractal, those from the Iterated
+Function System (IFS). The format of the input file is as follows: This file describe an IFS. One of the most well known would be the Sierpinski
+Gasket: or the fern: etc… Included in my submission will be a tarball of some IFS files,
+including one that attempts (not very well) to mimic the IOCCC logo (I
+figure it can’t hurt to attempt to suck up, right?). I would try to explain how to create an IFS file but I am not smart
+enough to condense it down to something that is coherent. Basically the break down is: The The The main obfuscation is using a The other main obfuscation being that it generates an
+ Since I formatted it as a “normal” program I did inject something
+that on first glance will looks like a possible bug. (When you run it
+through a C-beautifier this will be removed.) I decided not to use The input file is used to make the program flexible and to allow it
+to generate many different The use of many magic numbers. I figured if I get yelled about them
+in a review they must be bad, right? The use of decimal numbers where one would expect hex. Octal numbers
+where one would expect decimal. Shifts instead of divides. Using xbm as the output format. This might confuse someone who
+doesn’t have an X background. It happens to be easy but is probably a
+very bad choice from a file size standpoint. 1024x1024 image is 641k in
+size. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/sykes1/index.html Author: The current status of this entry is: For more detailed information see 2006
+sykes1 in bugs.md. Next point your browser to the file: Refresh your browser. If you have all day :-) and wish to find out how fast your machine
+can solve the maximum: This was done on a Rocky Linux 9.2 server with
+ and done with macOS Sonoma with the Max M1 chip: Read the sykes1.html page source. Now then
+read the C source. Confused? :-) If it’s not clear try: For extra credit, understand what happens when you give this entry an
+negative number argument, and why. See the author’s remarks for how to make your own shapes as well. This cube shaped program solves the fiendishly difficult “Bedlam
+Cube”. If you did not get one for Christmas, there is an article about these
+puzzles in wikipedia. Some instructions on how to make your own cube are in the included
+file bedlam-cubes.pdf. Finally, you can watch it being solved at https://www.youtube.com/watch?v=a8s1AcYMLBc. Actually the cube is very hard to do by hand by just trying to fit it
+together. I have not known anyone to solve it in this way - you would
+need to be very lucky indeed to stumble across a solution. Compile the program, then test that it works: Shortly you should see the first solution pop out on your screen. It
+shows you how to build the cube piece by piece, rendered in glorious 3D
+ASCII. ASCII art is all very well, but you also have a web browser, right?
+Well, just open the file sykes1.html. This
+html file is just a copy of sykes1.c, which
+helpfully contains an html document that should make the browser display
+for you a nice animated GIF, showing you how to build the cube. Rendered
+in glorious 3D color. Want to see another solution? Try: The program will discard solutions up to the number, and output
+numbered solution. Refresh your browser window to see the new
+solution. Try some more - there are exactly If you have a fast machine you might try the last solution: On my machine this takes about half an hour to run. The implementation is an optimized recursive algorithm that tries to
+fit the pieces into the cube one by one. The cube pieces are defined
+near the start of the program: Each piece is a bitmap, and represents a 3x3x3 cube. For instance the first piece is The other pieces are defined similarly. Most of the rest require more
+than one layer, such as piece 3 ( Imagine the two layers on top of each other, and you should see this
+shape: The program is in fact a general solver - you can change the shape of
+the pieces, and provided that a solution is possible, it will be
+found. For example, if you modify line 13 of the source like this, the
+program will solve for a different piece set: And of course you can make your own. After the pieces are defined, the first thing the program does it to
+fit them into a 4x4 cube. It collects every possible placing of each of
+the pieces. Once those placings are ready, the program recursively checks each
+combination thereof. In order to complete in a reasonable time, care is taken to eliminate
+any branches that cannot result in a solution. This is done by checking
+after each placing if all the remaining pieces can be placed somewhere,
+and that all the free space in the cube can be filled by at least one
+viable placing. Also if a piece is found to only have one possible
+placing, it is placed immediately without invoking a recursive function
+call. Once the solution is found, the ASCII and GIF representations are
+generated. Care must be taken to render cubes in the right order such
+that pieces further back are occluded by those in front. In the ASCII output care must be taken with drawing the edges of each
+ The whole program has just one function - If you pick a number higher than If you pick a number higher than I recommend compiling with the most aggressive optimization options
+your compiler supports. I find The program relies on The program is known to compile and run under gcc and Intel cc, as
+well as PellesC on Windows. The program is not at all a valid html document, but fortunately
+browsers have good error recovery and amongst other things will ignore
+the The generated GIF is not compressed. This could be argued as an
+advantage - at least I don’t violate any of those old Unisys
+patents! The pieces aren’t really those colors. Unless you make your own. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/sykes2/index.html Author: This will repeatedly remake the program and run it then sleep for one
+second for a nice show of time. As they say, “Lather, rinse, repeat”! :-) If you have the time :-), figure out how this small 1-line entry
+works! At 130 characters of C code (without the newline at the end), this
+should fit into the “1-liner” category. The clock numerals are rendered as an old fashioned 7 segment
+display. The encodings for which segments light for which number, and
+for where each segment appears on screen are hidden in the two
+strings. When reading the program, you may want to refer to a table of
+operator precedence (try One interesting bit of obfuscation - the null at the end of the
+second string actually forms part of the lookup table. Intel CC warns about the lack of a declaration for the argument to
+ I’m not sure of the effects on a hard disk of rewriting the same file
+multiple times per second for a long time. Run at your own risk! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/toledo1/index.html Author: where For most of the arguments (e.g. those above) the resulting path is
+not circular, but at least one starting point yields a circular
+path. Why do some of the “illegal” starting points work more or less as
+could be expected, and some dump core? Can you place a knight on a chess board and make it visit the 64
+squares without repeating them? If not, this program does it, just run it with an argument giving
+initial position. It will print move order. The algorithm is so simple that you can
+read it in the source code. At the first glance it can appear checkered.
+Nevertheless, don’t be dismayed, jar, jar. :-) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/toledo2/index.html Author: There is alternate code that is based
+on the author’s notes for DOS/Windows. This cannot be tested by us, not
+even to compile, but it appears that it should be fine, after the proper
+header files were added. The current status of this entry is: For more detailed information see 2006 toledo2 in bugs.md. To end execution press and then type in the following: To end the program hit ctrl-z. This version, as noted, should work for DOS/Windows. It uses
+non-standard functions in place of The author noted that for PC/DOS you will have to add
+ Use We’re impressed! Last year, it was a 6502
+emulator; this year, it’s 8080! It requires an
+input file ( In addition to the functionality you could expect from a program of
+this size, it allows importing files from the host file system (one by
+one, so you’ll have to be patient). Remember the good old days and play (or let your kids play) Adventure (in the directory
+ NOTE: The This program emulates a complete Intel(r) 8080
+processor, along with a teletype and a disk controller, just like at the
+start of the personal computers revolution (circa 1975). It needs an initial memory image to do something usable, so along
+with it you will find two files: (C.BASIC and C.BIOS). Rename C.BASIC to
+ Type using uppercase letters. Here are three example programs. Press
+Enter after each line: Press Ctrl+Z to quit. By the way, the segmentation fault is normal at
+this point. All good programmers started learning BASIC, now, what about a
+CP/M emulator? Copy Now you have a running CP/M system!, with two
+files on A: drive, To get a complete CP/M system, you will need
+the following files from the To import them, you must run the emulator with an argument, by
+example: When the When it ends, do At this time I have tested successfully the following software from
+http://www.retroarchive.org: Some programs require installation to configure the terminal, locate
+ANSI or VT-100. It is simply the little brother of the Z80; it has no
+extended registers ( The flags are only It is easy if your platform has
+ Notice that you’ll have to do Also add the following to trap Ctrl-C: NOTE: this is what the alternate code
+is for! NOTE from the judges: in Unix like systems On PC/DOS you need to add In Unix the min 0 on The The following instructions do peripheral operation: Memory addresses: The BIOS is tailor made for this emulator, and helps to simplify
+it. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/toledo3/index.html Author: The author provided two alternate versions, one which adds a status
+bar and another that makes it text only. The author also provided a
+version that they tested with Windows. See alternate code below. The author provided two additional versions, toledo3-sbar.c and toledo3-txt.c. Respectively these create a
+status bar and make the game text only. With the exception of the Windows version, these are built by
+default. To build the Windows version, toledo3.alt.c, you will have to figure out how
+to compile Windows code. Use As for the Windows version, It’s pretty obvious from looking at it what this program does, since
+it’s clearly spelled out in the code. The interesting question is
+whether this is easier or harder to understand than the code for Deep
+Blue. There are so many text-based chess programs, what is that of
+ So I managed to do a graphical X11 chess program
+(‘ The computer will check that your moves are legal. Full legal chess
+moves are allowed, except minor promotions on human side. The game will continue up to its logical conclusion, you make a
+mistake and the computer surpasses you. ;) Uses an alpha-beta search up
+to a depth of 3+level ply, extended
+with quiescence search, that helps playing strength, something around
+1500 ELO (level 1) to 1700 ELO (level 3). It searches the board and generates moves for each piece located. A
+lot of comparisons are used for en passant, castling
+and promotion. Would be faster with optimizations, but that
+optimizations use valuable IOCCC characters. It plays a different game every time, using the C library random
+number generator. Because it is resource-hungry, I strongly recommend to compile it
+using maximum optimization. With GCC you can use: Because this is my second X11 program (the first was point n
+click happy face), I added sentences everywhere until it worked.
+:) It is portable to Windows (using the supplied layer.c file)
+Change It will give warnings on compilation, so you can be sure that
+your compiler works. It will not update the window while it is “thinking” The space character has many useful applications, especially when
+it comes to the character limit (8). I still don’t understand what to do after semicolons. :P It is possible to convert this code into JavaScript with a graphical
+interface. Can you do it? Can the evaluation function be enhanced to make the program play
+stronger? Using toledo3-sbar.c (which is too large
+for this IOCCC size rules) creates a status display about gameplay on
+the window title bar. Using toledo3-txt.c turns this into being
+purely text based. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/akari/index.html Author: PGM (netpbm greyscale image.
+ PPM
+(netpbm RGB image). Only ASCII art
+(with end of lines
+in LF bytes only, not CR-LF!) Anything that is not parsable as The first argument is the input image. If it’s The second argument is the output image. If it’s The third argument, if specified, causes This is useful for decoding some curiously interlaced images, such as
+the included example.ppm. Anything that is not parsable as You can combine the two programs together to have just a regular
+rot13 filter: Of course, we wouldn’t stop with just 2 programs, you can downsample
+the source again and get yet another C program: We must go deeper: It takes quite a bit of skill and obfuscation to interleave a C
+program 4 levels deep, it’s much easier to interleave something like a
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/blakely/index.html Author: Zoom out and make your terminal window 53 or more lines deep. For those who have a lot of time, try: though one might or might not need to kill it, depending on your
+boredom threshold. This program plays Life
+(see also here), computes Pi to 16
+digits if given its own source as input, and allows to check if your
+garden is a Garden
+of Eden, all in one source. If you have enough time to spare, put the plan of your garden in a
+text file, and run: This program uses a well-known algorithm in order to display pi to
+fifteen decimal places. The source-layout itself demonstrates the
+importance of using the correct amount of whitespace in code and the
+clear superiority of spaces over tabs. In order to see the main feature of the code, type: and wait for about four seconds before using Ctrl-C (or whatever) to
+end the program. The results are best viewed in a terminal window at
+least 60 characters high and wide. Alternatively, redirect the output to
+a separate file (killing when necessary). The program emulates John Conway’s cellular automaton known as “The Game of Life”, using standard
+input as a starting grid. The layout of the source-code is such that it
+evolves to a digital representation of the first 15 decimal places of pi
+after 4 time steps. This was setup using the other feature of the
+program which can be demonstrated as follows: The program will first display the grid given in 3.dat, and then three more grids (taking a few minutes
+to display the last). Waiting for any more grids will take a substantial
+amount of time. The final grid has been put into evolve_to_3.dat, and if you type then the 3 will reappear after three time steps. As should now be clear, this use of the program will attempt to
+evolve a given setup backwards in time according to the Life rules. The
+resulting grid is clearly not necessarily unique. The program will
+evolve backwards given any single command line option. When evolving forwards, the code can only be stopped by killing the
+program. In the reverse direction, the code can either be killed, or
+will stop if it is unable to find a grid that will evolve to the current
+layout correctly. This can be seen with the sample grid t0_3.dat, which evolves backwards by only two
+time-steps. The input files must encode a square grid, where a space is a dead
+cell, and any other character (except a newline) is a living cell. Each
+line must be the same length, and end with a single newline character
+ This is only an approximation to the original Life, as it takes place
+on a finite grid, with borders that are automatically killed off before
+each time step. However, when evolving backwards, the resulting grids
+will not cause any cells on the boundaries to come alive. As the display
+is performed before killing off the borders, some boundary cells may
+sometimes appear to be alive, but not be treated as such for the
+following time-step, although any living cells on the right border will
+never be displayed. The maximum grid size is currently 99 by 99 (exceeding this will
+cause a segfault), but changing the two When compiled with the Since the program calculates ASCII character values for display, an
+ASCII based system is required to run it. Also, as mentioned above, any
+system that uses anything other than a plain Given the finely-tuned layout required to evolve into pi, this is one
+of the main obfuscations used in the code. However, running the code
+through the preprocessor, expanding the Other obfuscations used are: The forwards evolution of the grid is straightforward. The reverse evolution is done using a brute-force method. As far as I
+know, a brute-force method is the only viable automatic approach for
+general grids, although more intelligent algorithms would be possible
+given more space. The program starts with an empty “trial” grid and, starting from the
+top-left, tries all possibilities for the neighbours of the current cell
+that will cause the cell to evolve to the required state. It then
+proceeds to the right and down. Thus, it only ever needs to look at the
+cells below and to the right when testing. However, the already defined
+cells above and/or to the left of the cell may mean that there are no
+possibilities that will give the correct state, in which case the code
+backtracks and tries other possibilities on previous cells. The program
+knows it has a valid grid if it gets to the last cell. If it cannot find
+a valid grid, the program exits. Since this uses brute-force, it can be very slow. (In fact, the
+various obfuscations have, at least for the gcc compiler, caused a
+substantial slowdown.) The “calculation” of pi was chosen purely because algorithms to find
+pi are numerous, but the Game of
+Life is rarely (if ever?) used for this purpose. Also, separate
+digits made determining the layout somewhat easier. Deriving the layout was the most complicated part of the program. As
+is clear from the final layout featuring pi, the grid was divided into
+sixteen squares, and layouts that would evolve to each of the nine
+digits required were found. (This used the three-by-five digit-layout
+embedded in, at first, a nine-by-nine grid, then in larger grids, until
+fifteen-by-fifteen was reached.) The fifteen-by-fifteen grids give
+enough blank cells around them that the digits will not collide when
+evolving. However, this did not allow for sufficient characters to fit the code
+into. Therefore it was necessary to add some regions that would quickly
+die off without expanding to collide with the digits’ evolution. Groups
+of cells such as singletons, pairs, and larger groups like were useful in this regard. Other problems were keywords which need to be all in one string,
+keywords requiring space after them, and multi-character tokens. Some of
+these problems were dealt with by using the It should be noted that evolving a full 60-by-60 grid backwards using
+this code would probably take us at least up to the heat-death of the
+universe. The command This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/borsanyi/index.html Author: The current status of this entry is: For more detailed information see 2011 borsanyi in bugs.md. This is a nice quick histogram plotter. A
+useful utility when you need to look at the distribution of some
+data. You can modify the number of histogram bins and the
+scaling of the histogram by editing the source. Try to find them! If you look at the source you will notice that the usual array of
+histogram bins is missing. The source contains no arrays and it does not
+use While the input does not need to be sorted, the histogram output is
+sorted. How does it put the data into buckets? Why does it
+ This small piece of program is meant to be a useful tool, when there
+are some data around and you need a quick glance at the histogram. I am
+all too often logged in to a remote machine with slow X connection, and
+a terminal-based program would be of great help. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/dlowe/index.html Author: The current status of this entry is: For more detailed information see 2011
+dlowe in bugs.md. NOTE: In the above command, the directory args MUST end in a
+ Then to use Try these pre-trained networks: NOTE: The This entry is a ghoulish example of a brain (dead?) neural network
+classifier. It comes with a set of corpora for you to try. You can create your own trained networks. For example, we trained a
+network on the C code of entries that were supplied to the 20Th
+IOCCC. The where: NOTE: The above directories were not shipped and everything from the
+entries that did not win were flushed to The earlystop.pl tool wrote: The resulting The dlowe.c was explicitly excluded from this
+trailing set, so this test is interesting: NOTE: this is done in try.sh. The match of dlowe.c to the lose/win trailed
+network was: NOTE: The non-artificially intelligent decisions of the IOCCC judges
+include random quirks and their non-linear judgment calls not found in
+the ioccc trained network. Just because C code is or isn’t scored highly
+by this network does not mean it will win or lose a future IOCCC. On the
+other hand … it just might! While we cannot supply you with the losing IOCCC source code, the
+author did supply a number data sets on which to test: We created the english-trained.net as
+follows: dlowe-aux-data/english-0/
+Non-English (French) text dlowe-aux-data/english-1/
+English (non-French) text We created the png-trained.net as
+follows: dlowe-aux-data/png-0/ Non-png
+(gif) images dlowe-aux-data/png-1/ png
+(non-gif) images We created the xor-trained.net as
+follows: dlowe-aux-data/xor-0 Data
+that XORs to 0 dlowe-aux-data/xor-1/ Data
+that XORs to 1 NOTE: The directory args must end in
+a This is an artificially
+intelligent judging tool to help the IOCCC judges. Here’s to
+shorter, more frequent contests! This is a multilayer perceptron (a feedforward
+artificial neural network) which can be trained, using on-line backpropagation,
+to classify input files. It has a fixed topology of The neurons’ activation function is the logistic function
+ To classify files, one specifies a trained network (on
+ The interpretation of the classification number depends on how the
+network was trained, but it’s geared toward interpretation as a
+probability or a confidence. NOTE: The directory args must end in
+a To train a network, one specifies a starting network (on
+ If no input network is given, a random new network will be generated
+as a starting point (i.e. provide an empty The first corpus will be assigned a target value of The learning rate is hard-coded as The png-1 corpus was obtained by
+manually scraping the first results from an https://images.google.com search for “obfuscate
+filetype:png”. The png-0 corpus was obtained by
+manually scraping the first results from an https://images.google.com search for “obfuscate
+filetype:gif”. produced a network with about 87% accuracy The english-1 corpus was
+obtained by manually scraping the first results from a https://www.google.com/webhp?lr=lang_en search for “paris
+filetype:txt”. The english-0 corpus was
+obtained by manually scraping the first results from a https://www.google.com/webhp?lr=lang_fr search for “paris
+filetype:txt”. produced a network with 100% accuracy. The xor-1 corpus consists of two
+files containing The xor-0 corpus consists of two
+files containing Using these corpora as a training set takes about 8000 iterations to
+learn xor to within a tolerance of The program can’t tell you anything meaningful about files with less
+than two bytes in them (I’m looking at you, smr.c!) You must include the trailing directory separator on training
+directories (this allows the program to be portable without wasting
+precious bytes on figuring out how to concatenate directory and file
+names…). Serialized network files are only portable between systems with the
+same floating-point
+representation and endianness. Making sure not to overfit
+the network to the training data is a bit of a black art. I have
+enclosed earlystop.pl, a wrapper script that
+implements a simple ‘early stopping’ algorithm; other techniques are
+possible. Bad input (e.g. nonexistent files, non-numeric number of iterations,
+etc.) tends to result in empty output. Given exactly one corpus, the program will crash or produce
+garbage. Leaks memory and file descriptors while processing files. Will crash and die horribly if it runs out of memory. The Microsoft C compiler doesn’t provide a Backpropagation doesn’t always converge: if you play with this long
+enough, you’ll eventually have a training session that completely fails
+to converge. … but mostly zombies! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/eastman/index.html Author: Quit the program. Resize your terminal window. Run it again. NOTE: to restore your cursor in your shell, try
+ This round program will generate a classic spherical result! You will need a terminal capable of displaying coloured ANSI
+characters (for example an xterm or a Terminal.app window in macOS). You might also want to turn off any scrollback history. The program
+will size itself to the initial geometry of your terminal. If you are ambitious, make the font really small and the window
+really large for hi-res graphics! This program uses ANSI graphics to recreate the classic Boing Ball
+demo from the Commodore Amiga. See https://www.youtube.com/watch?v=-ga41edXw3A if you
+aren’t familiar with it. Back in its day, this demo inspired lust and
+awe in geeks around the world. The graphics are
+[raytraced](https://en.wikipedia.org/wiki/Ray_tracing_(graphics), with
+procedural textures on the ball and the back wall. I did cheat a little
+to simplify the calculations: it uses a parallel projection, but
+textures the back wall to look as if there were a floor being viewed in
+perspective. The shadow is also just part of the texture, not an actual
+raytraced shadow. This program automatically adapts to the size of the terminal it is
+running in, so try enlarging the window to get higher resolution. Don’t
+resize while the program is running, though. It only checks the size
+once, when it starts up. To compile: It should be completely portable. I’ve tested with gcc on Mac OS X
+10.7 (Lion) and Fedora 10. I would expect it to work in any Unix-like
+environment. I have merged expressions wherever possible, making extensive use of
+ternary operators, commas, return values of assignment operators, etc.
+The entire raytracing computation, include ray intersection tests and
+procedural texture evaluations, is a single expression involving 41
+operators. Variables are named alphabetically in the order they are
+declared. The third argument to A wonderful thing about ANSI graphics is that it produces nearly
+unintelligible code. Consider the There are lots of other minor obfuscations to make the code less
+obvious. For example, I could have written the outer loop as
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/fredriksson/index.html Author: The current status of this entry is: For more detailed information see 2011 fredriksson in bugs.md. NOTE: you need to be allowed to change your stack size or else the
+last command in the script would likely cause the program to dump core,
+which is why the script checks the exit code of The author of this entry was making sure that it does not win the
+“Best Short Program” award. On the outside, the program behaves as an
+approximate Implements a variant of To search regexp from file, do: Pipes might not work, see the section Limitations. The options
+ This version of Of course, one could construct a standard regexp that matches the
+same patterns, but the problem is that such a regexp grows exponentially
+in size when the number of allowed edit
+operations is increased. This version does not recognize all regular expressions, but the
+following are allowed: Wildcard: Bracket expression: list of characters enclosed by Range expression: two characters separated by hyphen and enclosed
+in brackets, matches any character that is lexicographically between the
+two characters (inclusive). E.g. The special characters must be escaped, if they are to be taken
+literally (e.g. It is assumed that the user knows how to feed correct input to
+the program. If undefined options are given, the result is also
+undefined. This is a feature. It may consume huge amounts of memory, and a stack overflow may
+occur. This results in Segmentation fault (or the equivalent of your
+favorite system, such as Bus error). This is a feature, that can be used
+to detect overly long lines in the input file, such as checking the
+length of one liners in IOCCC entries, just adjust your stack size to a
+suitable threshold, and search for “ Using warning options (such as Only standard input is handled. And only if
+ The total length of the (preprocessed) pattern is at most
+ Depending on the file, it might require a lot of stack space. If
+the program segfaults (because of this), say ulimit -s unlimited cross your fingers, hope it is enough, and try again. Assumes C99 standard, because of the one very long line. Most C
+compilers handle this just fine even in C89 mode, though. The code should be reasonably portable, it assumes standard ASCII
+codes for each char, and that a C compiler is on (Btw, tcc has its roots in IOCCC…) The initialized char array includes the source code of the real
+program, as well as its name and commands to build and run it, all Burrows-Wheeler
+-transformed, then run-length-encoded with unary coding. The main
+program extracts and builds that, and then calls it. More precisely, the
+command to build is To change that you need to edit the char array (The original version also deleted the generated source and the
+corresponding binary after running it, but this feature was removed from
+the submitted entry.) The code demonstrates several useful programming paradigms, such
+as: Algorithmically, it incorporates the following: As a C program, it demonstrates that It also shows the power of boolean logic and bitwise
+arithmetic. This is the first (?) entry in the history of IOCCC, that cannot
+be totally de-obfuscated by the author. This is due to the clever choice
+of the actual algorithm, that is obfuscated by nature, and it is an open
+research problem whether a simpler algorithm exists, with the same time
+complexity. The main obfuscation comes from using only arithmetic and boolean
+(short-circuit) logic combined with recursion to remove all loops and
+if-then-else constructs (also, no ternary No numerical values, other than in the initialized char array,
+try This should print 1, as there is a number after running The source code is best viewed with cat (or using the program
+itself), instead of some editor. (This is a somewhat system dependent
+thing.) One reason for this is that the code builds (some of the) constant
+values from string literal Some other constants are built from ASCII values of
+ Besides of making the code hard to read, all this makes it also quite
+large. Running it through GNU Some abuse of the rules. The number of non-whitespace
+and This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/goren/index.html Author: In the words of René François Ghislain
+Magritte Magritte: One may ask the surrealist question: However if one takes a firm stand and declares: something happens! Why? This program was written in homage to Rene Magritte’s
+picture “La
+trahison des images” (The Treachery of Images). In order to show my unconditional admiration of this work, I avoided
+using conditions. In this work, Magritte points out that a picture of a pipe is not a
+pipe. But what IS a pipe? This program tries to provide an answer. Magritte’s test for
+pipes is: Accordingly, this program only approves pipes which can be used for
+stuffing data. One thing I tried to achieve is condition free programming. Many have
+noted that conditions make the code harder to read and understand. A
+good example would be: Brent Burley’s
+2004 IOCCC winner. That entry omits conditional statements such as First, conditional operators, such as By removing these, the code is 100% condition free, and every
+function runs its instructions in perfect order. Naturally, this makes
+the program flow trivial to understand. This can be verified by
+disassembling the compiled code and looking for conditional jumps (when
+compiled with gcc on x86, there are none). The program should compile with any C compiler, but was tested mostly
+with gcc on Linux. It doesn’t support 64 bits (due to integer-pointer casts, and
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/hamaji/index.html Authors: If you have perl installed you should be able to reproduce dragon.nono like: This program solves Nonograms which is also
+known as “Paint by Numbers”. This entry roars as the Year of the Dragon: A year considered some to
+be good luck. Well it was certainly true that the IOCCC was lucky to get
+such a fine submission! The source code is a solution to a Paint by Numbers puzzle when you
+paint by C. Try your hand at solving a few of the other
+ NOTE: NONOGRAM (r) is a registered Trademark and is used with
+permission. See https://nonogram.com for more information. The format of the input files are as same as this site: https://web.archive.org/web/20130218055139/http://codegolf.com/paint-by-numbers. For example, for a simple problem which shows a glider of Conway’s
+Game of Life: the input should be The width and the height of an input puzzle should be less than or
+equal to 60. When this solver finds the problem has no solution, it prints
+“ When this solver cannot find a solution, it prints
+“ There are two solutions: and Solving Nonogram is NP-complete, so
+we cannot make a solver which solves all puzzles. However, we can write
+a solver which solves most problems solvable by humans. There are a
+bunch of ways to write such programs. The two most obvious approaches
+are: The former, brute-force approach is easy to implement. However, it
+works only for smaller problems (width and height should be at most 30
+or so). Similarly, using generic probabilistic metaheuristics
+such as simulated
+annealing doesn’t work for big problems. See: http://ccl.northwestern.edu/netlogo/models/community/Nonogram. By its definition, the latter method works for all human-solvable
+problems. The issue of the latter approach is this kind of program tends
+to be lengthy. This approach still requires some recursions. The most
+difficult problems which are considered human-solvable may require some
+“guesses”. For these kinds of problems, we need to assume a cell is a
+space or a box, go ahead some steps with simple methods and mark the
+tried cell as a box (or a space if we assumed the tried cell is a box)
+if a contradiction is found. My program uses an approach like “Set based solver” introduced in https://wiki.haskell.org/Nonogram#Set_based_solver. This
+should be equivalent to the combinations of simple methods (no advanced
+reasoning with guess). My solver also runs a non-recursive guess for
+each undetermined cells. So, my program should be able to solve most
+human-solvable problems (assuming humans cannot execute deeper
+recursions). First of all, as you see, my program looks like a nonogram puzzle
+which results in a dragon.
+This puzzle is dragon.nono in this directory.
+Note that whitespaces in character literals, a string literal, and
+around the last comment are considered as a boxed cell. My program is based on bit operations for speed. Many values are
+stored using negative logic (0 means on and 1 means off) to utilize the
+initial value of global variables. Thus, it might be difficult to figure
+out how it works. My program is decently shortened, because the size of source code is
+limited by IOCCC’s rule (2048 non-whitespace characters) and a lot of
+characters are just wasted for numbers around the picture. The three requirements (dragon, speed, and size) naturally ended up
+with the well obfuscated code. This program uses two C99 features. One line comments and
+ I checked my program with gcc-4.6.2 on linux, llvm-gcc-4.2 on Mac,
+and clang-3.0 on Mac. Note that the behavior of This program should not depend on I found long long may be 32bit integers only on AVR. This code is considered as a new
+year’s postcard in Japan. We chose the dragon because 2012 is the year of
+dragon. The second author wrote the picture, and the first author did
+everything else. The dragon.nono, samurai.nono, and penguin.nono were written by the second author.
+The soccer.nono was from a wikipedia entry.
+This file is important because it requires some guesses. The random.nono file was randomly generated. The codegolf.nono and face.nono were taken from https://web.archive.org/web/20130218055139/http://codegolf.com/paint-by-numbers. You can reproduce dragon.nono from hamaji.c using c2nono.pl: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/hou/index.html Author: As the script asks you, what does the last one mean? Can you get it
+to report a different value? Hint: it’s in this file, kind of. This self-documenting scientific calculator compiles clean with no
+warnings under the most strict pedantic mode of gcc and clang. The first example, along with the correct result appears in the
+source code. What does it mean? The calculator obeys the precedence rules and allows parenthesis. What exactly does the text formatting do? What does this evaluate to in C? Comments would almost be redundant. :-} … and not just fancy formatted comment removed by the C
+Pre-processor. The code does not contain some simple string-encoded lookup table for
+calculator operations. The example input and output in the C code is significant. Can you
+find out why? The button layout in the C code is significant … not just a nice
+looking layout. The parser is functionally equivalent to a normal arithmetic parser
+for all valid inputs. For another fun challenge: try to determine how it
+parses the command line argument. This program is designed to be self-documenting. It doesn’t just
+provide an example command line. It also provides the expected output
+and illustrates all supported functionality using embedded ASCII
+art. The parser parses function names, subtraction, and division as
+single-letter unary operators. A bitmask encoded hash table is used to
+check no-ops/digits and another hash function maps the ASCII to a
+function ordinal, which is then executed by the button panel. Both hash functions were found using a separate search program.
+Another program was used to find a way to format one hash function as
+example input such that it produces something resembling the bitmask
+hash table as part of its output. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/konno/index.html Author: This tiny program outputs what looks like a tiny keyboard. OK, so the
+letters are missing. But that is no problem because this program
+identifies the lower case letters that were pressed! It is one of those minimal keyboards without all of those confusing
+symbols keys. No shift for SHOUTING CAPS but at least it does not have
+that useless CAPS LOCK key! We recommend that you completely deconstruct / figure out how this
+program works and does what it does. Can you extend this program to deal
+with a full QWERTY keyboard? Can you then minimize the size of that
+code? This program ignores non-lower case letters. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/richards/index.html Author: The current status of this entry is: For more detailed information see 2011 richards in bugs.md. Oh no, yet another dc-style
+calculator? (see 2000/dlowe using an embedded
+Perl interpreter and deemed This is an implementation of the classic UNIX dc
+command, the reverse
+Polish calculator. Actually it’s a pretty bad implementation, since
+it only implements 32-bit integers (well, OH! I forgot to mention! It’s a JIT. Wait, don’t stop reading! I know what you’re thinking,
+platform-specific code is discouraged in IOCCC. But do you see any
+platform-specific code? There’s no assembler here! This JIT
+works on a dozen platforms, and the only platform-specific assumptions
+it makes are that the stack grows down and integers are at least
+32-bit. You will probably get warnings while compiling the code. In
+particular: If your system requires the inclusion of If your system cannot use I don’t include any headers I don’t strictly need to, so you’ll
+get warnings about (at least) GCC likes to complain about I don’t return from Platforms on which all known/tested optimization levels work with no
+additional flags: Platforms which work but not at all optimization levels or needing
+special flags: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/toledo/index.html Author: If you have X11 installed: There are two alternate versions, one that
+lets you reconfigure the controls and size and another that should work for Windows. See Alternate code below. The first alt version, toledo.alt.c,
+allows you to reconfigure the controls and the dimensions more
+easily. The second version, toledo.alt2.c, should
+work for Windows but does not allow you to reconfigure the keys or
+dimensions. This is because it cannot be tested by us. For the one that lets you reconfigure the keys you will want to look
+at the included header file, keysym.h, to find
+the correct macros. Once you have the right names you can define the
+macros but you can change them about however you like, even with other keys.
+For instance to swap but you can specify something completely else and you can pick and
+choose which controls you wish to redefine. You might also wish to
+change the dimensions of the game, Observe that each of the controls are a pair in the form of
+ This two player game uses X11. The control keys can be configured by
+modifying the After a quick splash screen the objective should be clear. There are
+Red, Green and Cyan tanks. A larger window can be made by altering the
+source early on, right before the code gets hard to follow, or using the
+alternate version. Like Oscar’s previous winning X11 program for the 19th IOCCC, if you
+remove both the X11 include files and replace them with you ought to be able to compile and run this program on Windows.
+NOTE: this is what toledo.alt2.c is for. This is a color X11 3D tank-game for two players, just compile and
+run it without arguments. You will see briefly a tank spinning before each level. The Left half of the window shows the red player view and the right
+half shows the green player view; the background will change to blue
+when the view goes inactive. The objective is to chase and destroy the other player’s tank. There
+is also an aqua tank for testing your aim and getting extra points. Caveat: You can shoot only 3 bullets at a time. When only one tank remains on the field, the level will advance.
+Don’t forget to destroy the aqua tank. The The bars show players energy and score; each bar shows energy and
+indicates the current player view (wider on the left). The right part
+grows with every point. Keys for player 1 (lowercase): Keys for player 2: Note: Numeric keys don’t work. If you don’t like the keys assignment, you can change it in the
+Makefile or use the alternate version. This game is highly violent: when the tank explodes you can see the
+little stick man blowing in parts. Not really, just kidding :D When I started working on this program, I figured that it would be
+easy to fit on the character limit, but I missed three things: the
+enormous X11 names, the non-portable key codes and my 2 KB of
+artwork. Very hard coding did the first thing. In fact I worked out
+twenty-nine different versions and at one step I had four parallel
+versions with different characteristics removed (mountains, horizon
+lines, score/status bars and explosions) but I’ve managed to fit it all
+together! The second thing was solved using the Makefile: it is under 160 bytes
+and you get adjustable controls. The greatest mystery on the Earth is
+why X11 gives non-portable key codes to the user. And finally, the third “Thing” was growing and growing, and growing,
+eating bytes for lunch… after endless rounds of crunching I obtained
+three-hundred seventy-eight bytes of artwork and guess what? It doesn’t
+fit. So I had to integrate a decompressor based on the space, tabulators
+and other non-counted characters. The final program is composed of eight micro-functions: one is the
+core and does most of the hard work and the other functions help do the
+X11 things, explosion effects, 3D calculations and viewing. The source code was formatted as a cube using a specially written
+program. This program is smaller and obfuscated what is needed so the
+reformatting doesn’t exceeded the character limits. The crunched vectors
+were generated by another special program and the tank that surrounds
+this text was generated by yet another program. Have fun! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/vik/index.html Author: There is an alternate version that should work for Windows. See alternate code below. The current status of this entry is: For more detailed information see 2011
+vik in bugs.md. Alternatively, you can use: It is possible to download a number of music module files from The Mod Archive. This version is based on the author’s remarks and it should work for
+Windows. Assuming that Use This entry converts .MOD audio files to a playable stream in a most
+pleasing manner if you don’t like tremolo or vibrato. Also it abuses the C compiler and/or assembler with a partially
+initialized 32MB array. Can you tell what that partial initialization
+for? Does it take your system a long time to compile? You may want to
+do: and examine the resulting assembly file NOTE: The randowan.mod and mad_world.mod files were created by Henrik Bertilsson and are
+included with his permission. In 1987, Karsten
+Obarski changed the
+way music was handled in games and demos with the introduction of
+the MOD file format on Commodore Amiga A MOD file contains a set of samples, a number of patterns indicating
+how and when the samples are to be played, a list of what patterns to
+play in what order, and a number of effects. This program converts MOD files created with the standard trackers
+for Amiga, e.g. Pro Tracker, Noise Tracker and Sound Tracker to raw 16
+bit 44.1kHz stereo audio. The program supports MOD music with 4, 6, and
+8 channels MOD files with up to 31 samples. The MOD format includes many effects for each audio channel and this
+program supports most of them, including: Due to size constraints tremolo and vibrato is not supported. Also,
+to avoid infinite long songs, the position jump feature is ignored. With his permission, the package includes two songs composed by
+Henrik Bertilsson, also known as Deelite: Compiling for Unix systems (including cygwin) is straight
+forward: (Don’t forget the last The IOCCC rules did not put a limit on the entropy of the source
+code, and it appears that the general entropy rules don’t apply. An
+estimate is that the code density entropy of this entry is
+ The use of macros certainly adds to the obfuscation but the reason
+for using them is mainly to fit as many features as possible within the
+size limits. So please excuse the use of them. Once the preprocessor is run, the code gets more interesting. The MOD
+player is basically a register based state
+machine and all the magic
+is hidden in a fog of short statements. Many of the register updates are
+conditional and the program uses the The program is portable to most platforms. The only system dependency
+is that the program relies on writing binary data to
+ Microsoft compilers adds a carriage return to newlines, and to
+compile the program with this platform, the following line can be added
+after the main declaration in order for the program to run
+correctly: NOTE: this is what the alternate
+version is for. The program only runs when a valid MOD file is passed as argument. If
+no argument is passed, the program crashes. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2011/zucker/index.html Author: There is an alternate version which should work for Windows which
+distinguishes binary mode from text mode. See alternate code below. Display the PPM image with your favorite image viewer. This version uses the Windows functions Use Try The rendered image is centered and is output as a 600 by 220 pixel
+PPM. The vector font is proportional. This entry uses no local variables. None! At! All! This program makes pretty pictures. To see the default output, try
+running On the author’s 2.5 GHz MacBook Pro, this command takes approximately
+1 minute and 18 seconds to run – your runtime may vary. You will need an
+image viewer capable of displaying Netpbm images in order
+to display the output. On the Mac, the system supplied
+ With macOS you can type at the command line: and it will open image in the default application Preview.app. To use ImageMagick you might do something like: and then open To use GraphicsMagick you might do something like: and then open Aside from the default image, you may create your own by running the
+program as follows: To mitigate long runtime, the program can be invoked in a “preview”
+mode by appending If your platform distinguishes between binary and text streams, you
+may need to insert some code to reopen standard output in binary mode at
+the start of This program is quite suitable for the inexperienced programmer, due
+to a number of considerations: It is fairly short: just 4 preprocessor directives followed by 29
+lines of source. It compiles cleanly as ANSI C under gcc 4.2.1 with very strict
+compilation flags. It uses a very small subset of the keywords available in C,
+namely It also uses a very small number of library functions: just
+ New programmers often prefer to use global variables when
+possible. Hence, all variables in this program (aside from
+function parameters) have global scope. An important aspect of the computation is graphically illustrated
+by the source code itself: the geometric construction of a reflection
+ray at an object’s surface, given the incoming direction and surface
+normal. The program is not quite a traditional ray
+tracer, but a “sphere tracer” which
+uses distance fields to encode proximity to objects in the scene. Using
+sphere tracing to compute visibility instead of analytic ray tracing
+provides two advantages: first, it greatly eases the computation of ray-torus
+intersection (which would otherwise require solving a quartic
+polynomial), and second, it makes it possible to compute ambient
+occlusion (which is used to generate soft shadows). Unlike many
+traditional ray tracers and sphere tracers, this one uses iteration
+instead of recursion to compute the effect of reflections. This,
+unfortunately, resulted in the programmer going insane; however, program
+size was reduced and readability hindered. Neither the plaintext for the
+program’s default output nor for the Netpbm header appears in the
+program source, which hinders readability as well. Also, unlike some
+previous IOCCC entries which render ASCII text, this one uses a vector
+(as opposed to raster) font. Although the program does not generate
+uppercase letters, it handles them in a reasonable manner when they
+appear in the input. Even when the program is pretty-printed and preprocessor macros are
+translated, it should be fairly resistant to analysis due to reckless
+reuse of global variables, the inherently opaque nature of the math, and
+its overall density. Global variables are used to store the results of
+intermediate computation. As a result, seemingly simple functions have
+important side effects. Although some of the global variables are simply
+constants, their use is overloaded. For instance, the variable
+ Some of the functions are simple vector algebraic operations such as
+vector construction, dot product, and normalization. However, it was
+found to be much more compact to define a single operation for
+multiply-and-add rather than to have separate functions for addition,
+subtraction, and scaling. Again, compactness led to obfuscation. This program heavily abuses Bitwise and arithmetic operators are used instead of logical
+operators whenever gcc doesn’t warn about it. Conversely, integer
+multiplication, division, and modulus are sometimes used in place of
+traditional bitwise operators just to keep the reader on his or her
+toes. Automatic casting between characters, integers, and floats is
+performed just about everywhere. Fascinatingly, this doesn’t seem to
+affect performance too badly. Sometimes when an explicit cast (i.e. from
+ Two other programs were written to support development of this
+program. The first used a randomized search algorithm to deduce the most
+compact encoding of the vector font instructions into ASCII; the second
+used a modified form of the Knuth-Plass
+algorithm to layout the final text on top of a hand-generated ASCII
+“stencil”. The programs were not submitted as entries for this year’s
+IOCCC, not because they lack obfuscation, but because neither is written
+in C (they are in C++ and Python, respectively). This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/blakely/index.html Author: The current status of this entry is: For more detailed information see 2012 blakely in bugs.md. Several IOCCC themes (RPN
+calculator, animated GIF generator, ray
+tracing) in one package! Very impressive! The checkerboard pattern in the output can be broken. Could you
+figure out how? Larger GIF files confuse some image viewers. This program renders a generic RPN
+expression in ray-traced
+animated GIF form. The
+expression in spatial variables The program should be run as: where the first parameter is a RPN
+expression, and the second is the width of the required GIF, up to a maximum of
+250. The expressions are written in Reverse
+Polish Notation with the following characters recognised: NB: all arithmetic is done in double precision, so The surface plotted corresponds to If there is a division by zero, square-root of a negative number, or
+similar operation, then the results are undefined. For test-runs, use a resolution of 32. For simple expressions, the GIF generation should take
+only a few seconds with a modern processor and full optimization.
+Runtime scales as O(N^3) with
+resolution A generic root-finding algorithm to find the point of intersection
+between a ray and the surface is done using a simple forward search from
+the eye. In order to make the rendering realistic, both the value of the
+expression, and its derivative with respect to Much of the obfuscation is achieved through the use of single-letter
+variables and ASCII is assumed since many bytes for the GIF output are generated
+from characters given in the source code. On compilation a few warnings
+about parentheses come up when using gcc 4.6.3, and one about no return
+value from (Note that the author may or may not be able to answer all of the
+above questions.) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/deckmyn/index.html Author: The current status of this entry is: For more detailed information see 2012 deckmyn in bugs.md. The C of this entry is definitely sharp. The program cleverly uses
+its own source at runtime to define the notes, time signature and
+accidental bitmaps. In addition to sheet music, this program is also able to, given the
+right input, generate an image of a 10-pin DIP chip
+(a sound processor?). We previously wrote that ironically, the way this entry is called
+from the command line is an abuse of C Shell. Please use Bourne-family
+shells to run this entry. … but in 2023 we changed the backticks to be the bash
+ You need the source code and example input (either one of the example
+files, or manual input as below) ready and a program capable of showing
+.pbm bitmap format
+images. If you have macOS you can open the image like: … otherwise, you’ll have to open it in your viewer of choice how you
+would normally open an image. If you have macOS you can open the image like: … otherwise, you’ll have to open it in your viewer of choice how you
+would normally open an image. Every major C competition should have an entry capable of producing C
+major. This is a music notation program. It produces bitmaps
+( The program is capable of printing notes, rests, (double) bar lines
+and accidentals on a single melodic line (multiple staves). No chords,
+polyphony etc. The program expects two command line arguments. The first is
+a (very long) string that contains the complete music font. Note that it
+should not be given as a file name! The default music font is
+encoded in the (whitespace of the) source code deckmyn.c itself. Therefore, the first argument
+should be The second command line argument is the music itself. This is, again,
+a string, not a file name. All music signs are entered as tokens of
+exactly 3 characters. The code is very sensitive to bad spacing! So for
+instance, if you use a file to write the music (e.g. example_greensleeves), you should keep
+in mind that newline is also a character! To minimise the memory footprint, this program has no variable
+declarations at all, except for the arguments to
+ The “music font” is defined by the source code itself. The first few
+lines are not part of the font definition, as this memory space will be
+modified by the program. (So as required by the rules, it is only a
+(memory) copy of the source code that is modified.) As there is no memory available, output is directly to
+ The memory locations of The code is quite sensitive. Errors in the input can lead to strange
+results. The code does not read beyond the end of the music input, but
+that is about the only error checking available. Any input that is not
+according to the rules in the manual, may cause
+errors. The program has no special hardware limitations or requirements,
+other than 8bit The limitations of using The code has no declared variables other than the command line
+variables. Not even pointers (we all know how messy code can get with
+too many pointers!). As more than one variable needs values beyond 127,
+parts of the command line memory are cast to This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/dlowe/index.html Author: The current status of this entry is: For more detailed information see 2012
+dlowe in bugs.md. Watch for a while if you like, then press a key within the
+window. Use up and down keys to escape death. The judges lose playing this game. This entry wins! Q: How did we get past the variadic macro problem on a Mac? A: Don’t use This is a challenging, fast-paced arcade game, based on the famous Game of
+Life. In the game, you are Mr.C, a lightweight spaceship making a futile
+dash for escape from the rigid rules and predictability of life in the
+B3/S23 universe. Use the up and down arrow keys to steer: collisions are fatal for
+Mr.C! Learn to spot incoming gliders, skim the surfaces of beehives and
+blocks, and give blinkers plenty of space. Things get crazier as Mr.C
+picks up speed… can he escape? No. There is no winning. Sadly for Mr.C, this universe goes on
+forever. Just see how far you can make it! Press The code is formatted into a 14-cell shape which will evolve into a
+glider in 19 generations. Lots of globals, including a global Global variables getting reused in different contexts. Huge and convoluted expressions, abusing ternary operators and
+operator precedence. Lots of magic numbers, abuse of the relationships between magic
+numbers, and abuse of the arithmetic properties of magic numbers. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/endoh1/index.html Author: There are two alt versions that let you control the compile time
+variables that control the fluid behaviour and the added variables to
+speed up or slow down the fluid as well as setting a timeout (if not 0):
+one for the original black and white and the colour one added by the
+author at the request of the judges. Another version is the deobfuscated
+version provided by the author as well. See alternate code below for more details. Also try using The files endoh1.alt.c and endoh1_color.alt.c correspond to endoh1.c and endoh1_color.c but which allow you to speed up
+or slow down the fluid and change the behaviour of the fluid. The file
+endoh1.alt2.c is deobfuscated and was
+provided by the author. For the default values, try: The In the If you wish to change the speed you should do: where WARNING: if you’re sensitive to flashing colours or any flashing at
+all do make sure you don’t decrease the value of If however you wish to change the gravity factor, pressure factor
+and/or viscosity factor, you should redefine the values where There is no restriction on what the number is because doing so
+prevents the macros from being defined to If you want to disable the alarm time, set It cannot be < 0 or > 60 (arbitrarily selected). Try slowing down the display by increasing the sleep time from
+ Now try using both Also try speeding up the display by decreasing the sleep time from
+ WARNING: again, be careful with too low a value if you’re sensitive
+to flashing colours or anything at all. Now try using both You might also wish to try redefining the macros You might try even: See the author’s remarks for details on these macros. Use To see two different ways run on the source file and each of the text
+files, try: The second run of each will be with the gravity factor set to
+ Let’s play Jeopardy! A: An obfuscated program that deals with complex numbers and produces
+animated ASCII graphics. Q: What is a Mandelbrot simulator? Bzzzt! Such heavily squeezed fluid simulation (this is parsed uniquely as
+fluids are not squeezable) has a few quirks that the judges were happy
+to experiment with. One configuration file was inspired by an XKCD
+what if? entry. DO NOT FORGET This program is a fluid simulator using the Smoothed-particle
+hydrodynamics (SPH) method. The SPH particles represent the fluid flow. Particles have
+information about the position, density, and velocity. In every
+simulation step, they are changed by pressure force, viscosity force,
+and external force (i.e., gravity). This program reads a text from standard input, and uses it as an
+initial configuration of the particles. The character The compilation options Marching
+square-like algorithm is used to render the particles. The program requires a C99 compiler; it uses I expect it to work in any Unix-like environment. VTxxx/ANSI
+sequences are used to clear screen and move cursor to home. I’ve tested with gcc-4.6.3 and clang-3.0 on Linux (Ubuntu 12.04) and
+gcc-4.5.3 and clang-3.1 on Cygwin. On Cygwin, gcc and clang complain
+about a usage of First of all, the source code itself serves as an initial
+configuration. Preprocessing directives (such as
+ This program uses (Incidentally, you can exert horizontal gravity by using for instance
+ Every five entries of You can use Though some assignments may look meaningless, they are actually
+meaningful; they extract “integer part of real part” from a complex
+value by assigning (and casting) it to an integer-type variable. logo.txt is a source of the logo in this
+remark file. column.txt is a water column collapse, which
+is a popular demo of SPH. pour-out.txt pours you a cup of tea. tanada.txt simulates “Terrace farming”.
+(“Tanada” means a “terraced rice
+fields” in Japanese.) clock.txt is a “water” clock created by
+HAMANO Tsukasa. Other endoh1_color.c is a variant that shows
+the density by using terminal 256 colors. I would like to thank my wife @hirekoke for her teaching me the SPH
+method. The judges The judges and HAMANO Tsukasa (The silver medalist at this IOCCC)
+kindly provided many configuration files. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/endoh2/index.html Author: and: … A pi/e
+printing quasi-[quine](https://en.wikipedia.org/wiki/Quine_(computing)
+in ASCII art with
+a compressed font in it; what else to wish for in this program? Virtual machine
+emulation? Yeah, “Again”. Sorry. But I don’t feel guilty or uncomfortable. This entry is based on ‘over-used themes’ such as self reproducing
+program and pi or e)
+computation. I know you’re tired of them. But have you ever seen them all-in-one? This program generates a new program in the shape of the Greek letter
+ One more thing… When you give a command line argument This program itself is in the shape of a spigot. This is
+derived as an analogy with spigot
+algorithm which infinitely computes the value of a mathematical
+constant such as pi or e. The two sets of programs, On the other hand, to make it fit inside one screen (80 x 25), my
+program is shortened properly, more than it looks. (As you may know, quines need
+to make its program size doubled.) For example, this program involves
+3x5 bitmap font data of ten characters ( I used many other tricks for short coding. I’m sorry that many ASCII-art-style winning entries of IOCCC ignore C preprocessor
+directives. In my program, These design requirements made my program well-obfuscated
+willy-nilly. I expect it to work in any major environment and C compiler. To build
+with no warning, it requires two C99 features: allow string literal to
+be more than 509 characters and not requiring a return in
+ I’ve tested with gcc-4.6.3 and clang-3.0 on Linux (Ubuntu 12.04) and
+gcc-4.5.3 and clang-3.1 on Cygwin. You can do Note: The executable may return a failure (non-zero) exit status
+unless This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/grothe/index.html Authors: To create a shared secret shared among To reconstruct the original (an arbitrary combination of
+ Also known as ‘Best abuse of the judging process’. The IOCCC 2012 submission page didn’t enforce the 2048 meaningful
+character limit. This entry, as submitted, weighed in at 2222 chars but
+lucky for it, it was extremely easy to bring down below the limit. There
+were a number of strings that when concatenated allowed the program to
+slide under the limit. It was clear to the judges that the extra size was an entry
+beautification step. Had it not been, this entry would have been
+rejected in round 0. The judges also took some liberty obfuscating this entry a little
+more. How does this entry work? The only place multiplication is used is to
+perform the This program implements a version of Shamir’s
+Secret Sharing. Shamir’s Secret Sharing allows you to encrypt a file
+into Actually surprisingly useful for an IOCCC entry :-) To share a secret. For example: To split a secret into 4 pieces of which at least 3 will be needed to
+get it (in this case the cookie recipe) back: To put the recipe back together using the first, second and fourth
+pieces: The program is limited to 256 input and output files and will slow
+down dramatically when you get past 20-50 inputs and outputs. Nothing is done consistently throughout the program E.g
+ Uses the most powerful obfuscation of all “Math”. “Any
+sufficiently advanced cryptography is indistinguishable from magic.” -
+Apologies to Arthur C.
+Clarke Shadows variables by using brackets in main program to create
+local copies of variables that are the same as global scope variables.
+ Uses Liberal use of octal numbers, hexadecimal numbers and regular
+decimal numbers throughout the program. Variables and function names are semi-random and upper and lower
+case characters are used. Use of Arrays only need to be 256x256 but most are set to greater values
+than they need to be so trying to figure it out can be a bit
+tough. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/hamano/index.html Author: The script will generate a number of PDF files and it will suggest
+you look at them as well. You can read One of the PDF files generated is this README.md file as a PDF,
+obfuscated, and the PDF file will then be compiled as C (itself!) and
+executed so that it shows README.md! Another PDF file generated is obfuscated C code. Once this is done it
+will compile the PDF as if it was C and then run it like: This entry treads into a new territory for IOCCC - generating PDF
+files. The originally submitted entry could have been thought of as a “Best
+abuse of Ghostscript” winner. :-) The source code and rendered pages are obfuscated for humans (where
+is the font?), and the submitted entry created PDF files that left
+Ghostscript confused. The results can be viewed with Acrobat Reader, evince and Apple’s Preview. The updated version can also be viewed using Ghostscript. There is something strange about the little flags in the output. A
+search of English literature will provide a hint. The conclusion you
+might draw is too elementary. :-) So what do those flags really mean? The Dancing
+men algorithm might be useful. Don’t forget to take a look at the generated PDF. Perhaps you might
+even want to compile the output with a C compiler. When you run it, what
+does it output? This program obfuscate text file into PDF file with Dancing
+men algorithm. Probably, the output PDF file is compliant with PDF 1.3 and it’s also
+available to compile as C code. I’ve tested it with GCC 4.7 and Clang 3.0 with Linux, and the
+following PDF Readers: This program is obfuscated by using classical methods. But can you
+find the embedded font in the fragmented glyph? This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/hou/index.html Author: View the The result is best viewed in a 80x25 console with ANSI colors. What a versatile entry! It can be used to check the size of IOCCC
+entries and to publish them as HTML. For extra credit: what is the meaning of the number
+ The reviewer may have already noticed that the 2nd page of this
+program is a dense blob, which is discouraged by the contest rules. We
+wish to point out that a majority of state-of-art programming editors
+support syntax highlighting, which should be enabled when reading this
+entry. Anticipating that the reviewer’s preferred color setting may
+produce a suboptimal visual effect, a few syntax files is provided to
+highlight the source code under an author-provided setting, using the
+submitted program itself. Syntax highlighting would also visually
+improve the 3rd page. The code may throw a few warnings due to formatting constraints. The
+author did try to remove warnings under gcc and Visual Studio,
+though. The author does not own the original anime series where the embedded
+ASCII arts come from. For comparison, original non-ASCII art depictions
+of the relevant characters and objects can be found by googling the
+embedded text messages. The syntax file consists of a number of rewriting rules. Each rule
+consists of a regular expression, a space, a format string, and a
+newline. All text matching the regular expression would be replaced by
+the format string. In case of a conflict, rules appearing earlier would
+take precedence. One can refer to the original text in the format string
+using The following regular expression operators are supported: For example, one can use the following expression to match a certain
+declaration statement in hou.c: The regex engine is also algorithmically efficient. To illustrate the
+point, ansi.txt contains a pathological
+expression 1 that guarantees a hang for the
+competing Perl engine while matching itself. Try to compare these two
+engines: Finally, there are a few limitations… The first layer of obfuscation comes from the challenge of embedding
+a large ASCII art in a dense blob. The entire art is composed using only
+keywords, strings and character constants. That results in a number of
+otherwise useless The second layer of obfuscation comes from the need to squeeze a
+reasonably powerful regex engine into the remaining area that isn’t
+occupied by excessive keywords and useless constants. To achieve this,
+the regex compiler is written using the same threaded virtual machine 2 that parses the regex. Due to
+compiler limitations, the generated VM code also ends up obscured by a
+large amount of spaghetti branches and virtual thread creations.
+Finally, the VM in 3 is extended to track multiple
+expression matches for the actual formatting. As an extra tweak, the text message actually does something useful.
+Remove the “Make a contract with me” catch line and the program would
+cease to function. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/kang/index.html Author: There is alternate code which fixes some German at the expense of
+other German. See Alternate code below for
+the (fun) rationale here. How does it have no This alternate code fixes the program that would throw off those who
+know German where the sound of ‘V’ is ‘F’ and so the program had the
+letter be ‘F’. A problem, however, with changing it is that it breaks
+other words including in German. Thus there is the alternate version
+instead which fixes a problem for Germans that causes problems for
+Germans so if you’re German you’ll just have to deal with it :-) It is,
+however, good as you might be able appreciate the entry even more. What does it get right? What does it get wrong? How does it compare
+to the original entry without the change of Finally why does it get what it gets wrong wrong? The judges were able to appreciate the Indo-European language family
+relation by making this entry successfully recognize some
+French, German, Italian, Russian, and Spanish numerals. Also worth mentioning is this entry’s ability to understand the
+colloquial year numbers of the last millennium. We’ve added a linefeed to the print format for convenience. Can you explain why: correctly reports 500 but: does not report 100, instead printing 0? This short program reads a spelt number (e.g. It accepts a variety of spelt numbers: It does not accept some spelt numbers, which I found mostly
+irrelevant: This program is quite portable, only requiring the following: The design of the program explicitly allows for Many obfuscations used are typical for standard IOCCC entries: Other obfuscations are more subtle: But the most important obfuscation is the clever construction of
+lookup table. The program uses 11 different characters required for
+recognizing 22 lexemes: So that they are internally represented as like: The stemmer recognizes the longest matching prefix, so every lexeme
+can be recognized by at most three characters (e.g. The trick is to use octal; three characters ( Having said this important trick, other details should be relatively
+easier to follow. The order of lookup table, for example, is very
+important, and the biggest constant 6177 is not arbitrarily chosen. More spoilers can be found at https://gist.github.com/lifthrasiir/3909337 The cleaner (size-optimized) version of this program was originally
+published in my website in July 2011. Sun Park and others have reviewed
+it and made me aware of possible improvements. I’d also like to thank
+Seo Sanghyeon for proof-reading remarks. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/konno/index.html Author: There is an unobfuscated version of this entry. See Alternate code below. NOTE: N is an integer from 0 to 255. An alternate version of this entry, konno.alt.c, is provided. This alternate code is
+an unobfuscated version of the winning code. Use This entry is a good one-liner to analyze completely. For extra credit, what are the minimal changes to convert it to
+64-bit integers so that it could print 32 lines? This program outputs elementary
+cellular automaton patterns. Try: There are 256 (from 0 through 255) possible rules. This program uses bit operations. I think is an interesting operation. This isn’t equal to operation. What is the operation doing? This program assumes that the size of This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/omoikane/index.html Author: There is an alternate version that will read from the compiled file
+itself, in case you don’t have a NOTE: if your OS does not have The script try.sh will check if you have perl
+before trying to use the perl parts of the script. The alternate version will, if no file is specified, read in the
+compiled binary itself rather than trying to open
+ For the first version: For the second version: Use For the first alternate version: We have no way to test the second version, sorry (tm Canada :-)
+)! The judges have nothing to add that has not already been written
+about in the spoiler.html (requires
+JavaScript) file! :-) Output is encrypted, but both key and data are included in the
+output. To separate the key from the data, run these commands: The key-less To combine the key and data, concatenate them together in either
+order: By default, This makes the output key deterministic, allowing the same key to be
+shared across different files. On operating systems that do not have
+ Implementation details that make Output code has these features: Code layout is meant to resemble Nyaruko, also
+known as Output code has the same dependencies, with the additional
+requirement that the compiler must support arbitrarily long string
+literals. Maximum input size that can be encoded while still producing
+standard-compliant output is ~276 bytes for C89, and ~3168 bytes for
+C99. Note that on MingW, spoiler.html - Contains full recording of
+how the code went from blank state to an obfuscated program, gzipped to
+fit under 1MB. Requires JavaScript. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/tromp/index.html Author: The current status of this entry is: For more detailed information see 2012
+tromp in bugs.md. Use The judges dare to say that the data files this entry is processing
+are more obfuscated than the entry itself. This program celebrates the close connection between obfuscation and
+conciseness, by implementing the most concise language known, Binary
+Lambda Calculus (BLC). BLC
+was developed to make Algorithmic
+Information Theory, the theory of smallest programs, more concrete.
+It starts with the simplest model of computation, the lambda
+calculus, and adds the minimum amount of machinery to enable binary
+input and output. More specifically, it defines a universal machine, which, from an
+input stream of bits, parses the binary encoding of a lambda calculus
+term, applies that to the remainder of input (translated to a lazy list
+of booleans,
+which have a standard representation in lambda calculus), and translates
+the evaluated result back into a stream of bits to be output. Lambda is encoded as 00, application as 01, and the variable bound by
+the For example the encoding of lambda term
+ In the closely related BLC8
+language, I/O is byte oriented, translating between a stream of bytes
+and a list of length-8 lists of booleans. The submission implements the universal machine in the most concise
+manner conceivable. It lacks Without arguments, it runs in byte mode, using standard input and
+output. With one (arbitrary) argument, it runs in bit mode, using only
+the least significant bit of input, and using characters The program uses the following exit codes: The size of the term space is fixed at compile time with
+ The shortest (closed) lambda calculus term is Since the least significant 4 bits of the first byte are just
+arbitrary padding that is ignored by the program, any character from
+ASCII 32 (space) through 47 ( If the input doesn’t start with a valid program, that is, if the
+interpreter reaches end-of-file during program parsing, it will crash in
+some way. E.g. the following might dump core: Furthermore, the interpreter requires the initial encoded lambda term
+to be closed, that is, variable will likely dump core. Since these properties can be checked when creating BLC
+programs, the interpreter doesn’t bother checking for it. The BLC
+universal machine may be small at 650 bytes of C (952 bytes including
+layout), but written as a self interpreter in BLC it is downright
+minuscule at 232 bits (29 bytes): The byte oriented BLC8 version weighs in at 43 bytes (shown in
+hexadecimal). Even shorter than the self-interpreter is this prime number sieve in
+167 bits (under 21 bytes): The For those who prefer to digest their primes in decimal, there is
+ The program It expects The smallest known BF interpreter is written in… you guessed it, BLC,
+coming in at 112 bytes (including 3 bits of padding): It expects its input to consist of a Brainfuck program
+(looking only at bits Curiously, the interpreter Writing BLC programs can be made slightly less painful with this
+parser that translates single-letter-variable lambda calculus into
+BLC: The program So we could assemble an input reversing program as and change it to BLC8 with and then try it out with: BLC8 program As expected, the resulting normal form is Church numeral
+8. Taking only the first line of output gives us a sort of BLC
+disassembler, an exact inverse of the above assembler. The prime number
+sieve disassembles as follows: Hardly any less obfuscated… The last line of starts out as The Since my computer reaches swap hell before line 40, we can’t see the
+next bit arriving, at least not in this symbolic reduction. Performance is quite decent, and amazingly good for such a tiny
+implementation, being roughly 50% slower than a Haskell implementation
+of the universal machine using so-called Higher
+Order Abstract Syntax which relies on the highly optimized Haskell
+runtime system for evaluation. Of course individual BLC programs running
+under the interpreter perform much worse than that same program written
+in Haskell. Our interpreter copes well with extra levels of interpretation: Obfuscation is due entirely to conciseness. Some questions to
+ponder: Which of the term space codes Why is the environment pointer pointing into the term space? What does the test How does the program reach exit code 0? And how do any of those BLC programs work? The program freely (without casting) converts between
+ Avoiding these would make the program substantially longer, and
+detract from its single minded focus on conciseness. It implicitly declares functions The program has been tested to work correctly on Linux/Solaris/MacOSX
+both in 32 and 64 bits. See the file how.md. Christopher Hendrie, Bertram Felgenhauer, Alex Stangl, Seong-hoon
+Kang, and Yusuke Endoh have
+contributed ideas and suggestions for improvement. Binary Lambda Calculus - https://tromp.github.io/cl/Binary_lambda_calculus.html G J Chaitin, Algorithmic information theory, Volume I, Cambridge
+Tracts in Theoretical Computer Science, Cambridge University Press,
+October 1987. https://web.archive.org/web/20121125233450/https://www.cs.auckland.ac.nz/~chaitin/cup.html Jean-Louis Krivine. 2007. A call-by-name lambda-calculus machine
+Higher Order Symbol. Comput. 20, 3 (September 2007), 199-207. http://www.pps.univ-paris-diderot.fr/~krivine/articles/lazymach.pdf This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/vik/index.html Author: This entry requires Zlib. There is an alternate version which might work for Windows. See Alternate code section below. The current status of this entry is: For more detailed information see 2012
+vik in bugs.md. To embed text (from file or command line): or To extract the embedded text: To embed a PNG into another: To extract the embedded PNG: For those few who might use Windows this alternate code might
+work. Use References to chocolate had no effect on judging this entry. We
+guarantee it. Can you discern hidden pieces of chocolate in chocolate-in-ioccc.png? This program is a steganography
+application for embedding an image or text into another image as well as
+extracting the embedded image or text back. The program stores the
+embedded image or text in the low bits of the RGB values. The program supports any 8 bit true color PNG images (RGB, RGBA,
+greyscale, and greyscale+alpha). The output image is always 8 bit RGB.
+When embedding one image into another, the width and height needs to be
+the same. The program only updates the For some reason the chocolate image seems to have some special
+properties. Apart from being quite big and a little bit noisy, it
+appears that when embedded into another image and extracted, the bitmap
+data is also a valid brain$#@$ program. It
+is of course possible to get the bitmap data from the extracted image,
+and run it through any of the previous winning brain$#@$ interpreters,
+but I thought it would be easier to include an interpreter in the
+program to avoid the hassle: It is of course also possible to embed a brain$#@$ program as
+a text file (as explained above) and decode it, e.g.: I really wanted to keep the program simple, so instead of adding
+multiple macros or helper methods that can be confusing, I placed all
+functionality in the The program is portable to most platforms that have zlib available. The only system
+dependency is that the program relies on writing binary data to
+ By default, Microsoft compilers adds carriage returns to new lines,
+and to compile the program on this platform, the following line can be
+added after the variable declarations in the main declaration in order
+to run correctly: NOTE: this is what the Alternate code
+does. The program doesn’t have many error checks so passing in invalid
+arguments or images of mismatching sizes, or unsupported pixel formats
+will cause the program to crash. Since a lot of care was taken to keep the code simple, it turned out
+to be quite easy to extend functionality. I did include a small brain$#@$ after I
+realized that the chocolate image had some interesting properties. But there is more functionality I added that didn’t fit within the
+size limits and could not remain included. For example, I added a method
+to format source code based on a PNG image. So the format of the program
+is actually done by the program itself. And to be honest, the chocolate image did not have a brain$#@$ program
+embedded to begin with. I added functionality to the program to embed a
+brain$#@$ into a PNG image and used it to create the image provided with
+the entry. I also added a method to analyze PNG images, to print the size and
+format, as well as the scan line filters. All these features were quite easy to add, much thanks to the
+(actually pretty good) design of the code. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2012/zeitak/index.html Author: There is an alternate version that is slightly deobfuscated. See alternate code below. where NOTE: it prints an error and exits on the first nesting error so it
+will not detect multiple issues! This version, zeitak.alt.c, is a version
+that has been slightly deobfuscated. You may find reading it helpful in
+your attempt to understand this extremely subtle entry. Use This is an extremely subtle and twisted piece of Gold award winning
+code! The judges had spent a considerable amount of time analyzing this
+entry. At one point we spent 18
+minutes just to understand 18 key characters of this code. As you have probably understood by looking at the source*, this
+program has something to do with parenthesis (and equality of opening
+and closing parenthesis, if you look close enough). It goes over the
+file given to it and checks that every opening If an error is detected, an error message will be printed. If the
+problem is a superfluous closing bracket, it will even print a few
+characters around it’s position. * Make sure you view the source with 4 spaces tab width. IOCCC winners already contain entries
+without digits, control-flow keywords and certain operators in their
+source. This entry has an even more limited source, that is: So, what’s left? Parenthesis, and lots of them, as looking at the
+source will reveal immediately. The main obfuscation is building the
+whole algorithm using only function calls, typecasts, array lookups and
+pointer operators. The program requires The program was tested on the following platforms: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/birken/index.html Author: We recommend that you use the alt version first to see what this
+entry looked like back in 2013 (with a configurable speed). If you wish
+to use the original version see the original
+code section below. NOTE: if your terminal is messed up after running this (perhaps from
+exiting before it finishes) try using This alternate version, which we recommend that you use in order to
+see what is happening with modern systems, and to not flash colours too
+quickly, which can be problematic for some people, can be configured to
+different speeds by way of the value used in To see the program run on each text file, try: If you have perl installed it will also try a random run. Finding the ‘right’ default value was a fine line; the default, 15000
+microseconds (0.015 seconds), will take quite a while to finish but it
+allows one to more easily see what is going on. Even easier to see would
+be 25000 but these values make it quite slow and one could easily lose
+interest. Like some other entries where this was made an alternate
+version it is configurable at compile time. If you wish to speed it up
+by 100% you can instead do: and then try If you wish to speed that up 200% (300% total) you can use instead
+try to make it sane again (running to completion will do that for
+you). The original code will run faster with modern systems which is likely
+to make it hard to see the art of the entry but you may do so if you
+wish. Use To use the demo script with the original code, try: PLEASE be careful if you are sensitive to flashing colours! This program also wins the “Most amusing abuse of the iocccsize tool”
+award; although not the absolute best: it is possible to achieve 0 by
+writing: The game of Tetris had been used in many endeavors, from studying algorithmic complexity to treating
+PTSD and it’s even been put on MIT’s
+Green Building. Using it for painting by numbers looks like a novel
+idea. This document is best viewed as an HTML file in a browser that
+supports animated GIFs. See the files: By rotating, positioning and dropping a predetermined sequence of
+pieces, this program exploits the mechanics of Tetris to generate
+arbitrary images. The algorithm converts pixels from a source image into squares in the
+Tetris play-field,
+one row at a time from the bottom up. To generate an individual square,
+the algorithm assembles a structure consisting of a rectangular region
+fully supported by a single square protruding from the bottom. When the
+rectangular region is completed, its rows are cleared, leaving behind
+the protruding square. Three examples of the process appear below. During construction of a row, all of the squares produced by this
+method must be supported. In the images above, the generated squares are
+supported by the floor of the play-field. However, if an arbitrary row
+contains holes, it may not provide the support necessary for the
+construction of the row above it. The algorithm solves this problem by
+constructing a flat platform on top of the row with holes. In the
+animation below, a platform is built above a row comprising of a single
+red square. The platform is a temporary structure and inserting the
+final piece removes it. Below, a row containing 5 red squares is deposited above a row
+containing 3 red squares. This is accomplished by building a flat
+platform on top of the lower row. The platform provides the support
+necessary to generate the 5 red squares. Finally, the platform is
+removed by inserting its final piece and the new row drops into place.
+Note, if the algorithm needed to generate the rows in the opposite order
+(a row of 3 red squares above a row of 5 red squares), a platform would
+not be necessary. For reference, the names of the 7 tetriminos (the game
+pieces or actually a kind of geometric shape used in Tetris) appear in the
+table below. This algorithm was tailored specifically to render sprites from early
+video games. Those games packed graphics into 8x8 tiles where 2 bits
+were dedicated to each pixel. Consequentially, sprites usually contained
+only 3 colors plus transparent regions and they were typically sized
+either 16x16 or 16x32 pixels. The animation below depicts all the patterns used to emit single
+squares. It is not possible to emit a square of all 3 colors in the first 2
+and the last 2 columns due to the shapes of the 3 tetriminos. As a
+result, the minimal width of a play-field to accommodate a 16 pixel wide
+sprite is As illustrated below, the region above the protruding square cannot
+exclusively consist of a single row because the only pieces that could
+fit, the With 2 rows, the only means of spanning the full play-field width in
+a way that remains supported is to use The minimal number of rows required above the protruding square is 3
+and as shown repeatedly above, such patterns do exist. 20 squares is the
+minimal width required to fit a 16 pixel wide sprite. But,
+ The original Tetris play-field is 10
+x 20 squares, a 1:2 ratio. The program maintains that ratio by using a
+play-field of 21 x 42 squares. Since Before a row is constructed, the algorithm inspects the row below it.
+If the row below fails to provide support for all of the squares to be
+deposited above it, then a temporary platform is required. When that
+platform is removed, the new row will drop, leaving some of the squares
+apparently floating above empty space due to the way that gravity works
+in the original Tetris. The illustration below depicts the 10 platform patterns (really only
+5 considering mirror symmetry). The construction of a platform begins by
+dropping a In the middle of platform construction, the bottom row gets completed
+and cleared, leaving 3 rows above it. The final Also, of the 19 possible ways to start constructing a platform on top
+of a The input sprite is represented textually. Digit characters
+ As discussed above, sprites are limited to a maximum of 3 colors from
+this palette. All other characters are interpreted as transparent pixels. The maximum permissible size of the input text is 32 rows by 17
+columns. Row length can vary as long as no single row exceeds 17
+characters. Every row must contain at least one palette digit character. The The program conceptually uses Tetris as an output
+device similar to a line printer. It
+restricts itself to those operations that can be performed on the Tetris
+play-field: spawning, rotating, positioning and dropping tetriminos. This
+process is visually represented using ANSI escape sequences. The rate at which the program plays Tetris is completely
+determined by the rate in which the terminal application receives and
+displays the ANSI escape
+sequences. To slow down the output programmatically, introduce a delay
+immediately after the call to This program demonstrates how to exploit a bug in IOCCC size tool
+version If that line is added to the top of any program, the tool will report
+a size of 8. When that line is deleted from this program, the tool properly
+reports the secondary size limit of the program as 2048. Although this bug provides an easy means of circumventing contest
+rule 2, as demonstrated from the size value, this entry is not
+necessarily striving for a ‘worst abuse of the rules’ award. This program is almost, but not quite, entirely unlike a
+demonstration of good programming practices. Contrary to other programs,
+an inspection of this one will certainly reveal that it possesses tea,
+not to mention an affinity for the constant 42. Variables are named and ordered to spell out, Carefully selected variable names also yielded wonderful expressions
+like The source is formatted to resemble the Tetris play-field
+mid-game. It is also an homage to all the past
+IOCCC entries formatted as a compact block of text; the
+ Three tables are encoded as separate strings within the program: The first string stores the coordinates of the squares of the 19
+distinct rotations of tetriminos (see
+below). Since a tetrimino is a chain of 4 squares, all tetriminos fit
+within a 4x4 matrix. To determine the coordinates of the squares, the
+tetrimino is pushed to the upper-left of the matrix. Each coordinate
+value requires 2 bits of storage. Consequentially, the four
+x-coordinates and the four y-coordinates were packed into separate
+octets. To convert the octets into valid ASCII characters, the squares
+were sorted such that the least significant bits stored the largest
+coordinate values. The results were offset by 35, the The second string stores the single square emitter patterns and the
+platform patterns. Each pattern is a sequence of pairs,
+ The third string conceptually stores the default colors of the 19
+rotations. A 3-bit value is assigned to each, covering the 7 possible
+colors. In addition, when a mirrored pattern is executed, The program is full of subtle obfuscations: The unary decrement operator is used in conjunction with global
+variable automatic zero initialization to set variables to
+ The boolean expression of the form, Several arrays store unrelated data in segments throughout the
+array to reduce named variables.. The Variable A cursorily glance at the expressions The varying single square emitter pattern lengths are resolved
+during string decoding using the clever expression,
+ The file size of birken.c is a prime
+number. Deleting the first line also produces a prime-sized program.
+These properties do not qualify the program as a prime number
+generator. Due to the contest code size constraint, some optimizations
+reluctantly had to be omitted. For example, multi-square emitters are
+possible: In fact, using dynamic programming and creative heuristics, real-time
+search is possible, enabling patterns like this: And, even this: In addition, it is possible to extend the algorithm to 6 colors
+instead of just 3. This is achieved using The details of these enhancements are left as an exercise to the
+reader. The following example files were created by the program author. They
+can be freely used and distributed. The following files are based on graphics from non-free, copyrighted
+video games. The use of a limited number of textual representations of
+the graphics for the demonstration of this program qualifies as fair use
+as such files do not significantly impede the right of the copyright
+holder to sell the copyrighted material and it is not being used to
+generate profit in this context. The origin of each file is detailed
+below (character, game, company, year). belmont.txt - Simon Belmont, Castlevania,
+Konami,
+1986. bloober.txt - Bloober, Super Mario
+Brothers, Nintendo,
+1985. bomberman.txt - Bomberman, Bomberman,
+Hudson,
+1983. boo.txt - Boo, Super Mario
+Brothers 3, Nintendo, 1988. bub.txt - Bub, Bubble Bobble,
+Taito, 1986. cheepcheep.txt - Cheep Cheep, Super
+Mario Brothers, Nintendo, gurin.txt - Gurin, Binary Land,
+Hudson, 1983. koopaparatroopa.txt - Koopa Paratroopa,
+Super Mario Brothers, Nintendo, 1985. lakitu.txt - Lakitu, Super Mario
+Brothers, Nintendo, 1985. mario.txt - Fire Mario, Super Mario
+Brothers, Nintendo, 1985. mspacman.txt - Ms. Pac-Man and
+Ghost, Ms. Pac-Man, Midway,
+1982. paranaplant.txt - Piranha Plant, Super
+Mario Brothers, Nintendo, samus.txt - Samus Aran, Metroid,
+Nintendo/Intelligent
+Systems, 1986. The origin of the remaining files are described below: happyface.txt - Based on a smiley; original
+trademark of smiley Smiley
+Company. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/cable1/index.html Author: Partisan may be defined as a strong supporter of a cause, party or
+person. We need not limit ourselves to the two major political parties
+in the US today. Let us consider: Simon works for Apple, so you would expect Mac. :-) Landon is a long
+time Mac user: That works too! Now Leo brings PCs to the IOCCC judging for
+cross-platform testing: We can test other people. The late Steve Jobs: That works! How about Bill? A PC guy as expected. What about that other Steve? Humm .. maybe there is a hidden reason he is leaving the late
+Micro$oft? :-) Why late? Because: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- An important 2023
+update about twitter: The IOCCC no longer uses twitter. Today the IOCCC uses Mastodon. For
+more information and to see our IOCCC Mastodon posts, see: End of important 2023 update to this historic note.
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- So how does a one line C source know so much? Hint: it doesn’t. Politics is full of memorable one-liners.
+Without wishing to misunderestimate
+the taste of the judges, nor prejudge the past, the author hopes you
+enjoy this contribution to the genre. This one-line C program accepts as a first command-line argument the
+last name of any of the last 31 US Presidents (from Franklin Pierce
+onwards), in lower case, and prints out their political affiliation. Use The program looks up the name supplied on the command line against a
+list of Presidents’ names, and matches names to political affiliations
+using a look-up table. But where in the source is the list of names, and
+where is the look-up table? For Theodore Roosevelt, use:
+ But, for Franklin D Roosevelt, use:
+ This program needs a little endian CPU to work properly. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/cable2/index.html Author: The current status of this entry is: For more detailed information see 2013
+cable2 in bugs.md. For different OCR examples: We can confirm that this is the first time the IOCCC has been used to
+peer-review a new research. We had quite a bit of fun with a sharpie and
+a scanner. This entry takes a BMP image file of hand-drawn (mouse-drawn?) text,
+specified as the first command-line parameter, and converts it to an
+ASCII text document. Magic! BMP files created by most paint programs should work. The author
+recommends Paint.NET. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/cable3/index.html Author: An alternate version that should compile in Windows/MS Visual Studio
+is available. See the Alternate code
+section below. NOTE: to quit the program type To send an To send an To send a An alternate version, which should compile in Windows, is
+provided. Assuming Use This entry weighs in at a magical 4043 bytes (8086 nibbles, 28,301
+bits). It manages to implement most of the hardware in a 1980’s era
+IBM-PC using a few hundred fewer bits than the total number of
+transistors used to implement the original 8086 CPU. If you are using macOS, the included sc-ioccc.terminal configuration file will
+correctly display console applications that use ANSI graphics. NOTE: the author remarked that in some systems one might need to
+ Update: This entry now has its own website: https://github.com/adriancable/8086tiny The author hereby presents, for the delectation (?) of the judges, a
+portable PC emulator/VM written specifically for the IOCCC which runs
+DOS, Windows 3.0, Excel, MS Flight Simulator, AutoCAD, Lotus 1-2-3 … In just 4043 bytes of C source, you get a complete mid-late 1980s-era
+IBM-compatible PC, consisting of: The emulator uses the SDL graphics
+library for portability, and compiles for Windows, macOS, Linux and
+probably most other 32-bit/64-bit systems too. If you like living on the edge you can try building the emulator on a
+big endian machine, and you will get an emulation of a big endian 8086,
+a rather bizarre and somewhat useless beast. For everyone else, please
+run the emulator on a little endian machine. This entry has been tested on Windows (compiled with MS Visual Studio
+2010 and 2013), Mac OS X (clang and gcc), and Linux (clang and gcc). The
+Makefile supplied is good for Mac OS X, Linux and probably other Unices.
+I have received reports that the emulator works on Raspberry
+Pi/Android/ARM (you will need to compile with
+ On UNIX-based systems we can get raw keystrokes using
+ NOTE: this is done in the Alternate
+code. The code as supplied uses implicit function declarations for POSIX
+file I/O and in doing so assumes that file offsets are the same bit
+width as your architecture. For some systems (e.g. 32-bit Mac OS X,
+which uses 64-bit file offsets) this is not the case, and to run
+successfully on these systems, you will need to explicitly declare these
+functions by adding the appropriate include to the top of the
+source: NOTE: this has been done in cable3.c. PLEASE NOTE that under Unices the keyboard must be in raw mode for
+the emulator to work properly. Therefore the emulator is best run from a
+shell script that looks something like: See the runme script. The simplest use of the emulator is with a single floppy boot disk
+image, like the Before running the emulator on a Unix-type system, Easiest to start with is to try a ready-made 40MB hard disk image
+containing a whole bunch of software which is in the included file
+ For the more adventurous, you can start off with (for example) a
+blank 40MB image file called hd.img made using e.g. Makefile. Then
+use: Preparing the hard disk for use in the emulator is done just like a
+real PC. Boot the emulator, and use The emulator emulates an XT-style keyboard controlled by an Intel
+8042 chip on I/O port 0x60, generating IRQ1 and then interrupt 9 on each
+key press. This is harder than it sounds because a real 8042 returns
+scan codes rather than the ASCII characters which the C standard I/O
+functions return. Rather than make the emulator less portable and use
+ Most of the time you can just type normally, but there are special
+sequences to get To send an To send an To send a The emulator supports both text output via the standard BIOS
+interrupt 0x10 interface, and also direct video memory access (one page,
+4KB video RAM at segment BIOS text output calls are converted to simple writes to
+ Most The regular PC character code page ( Occasionally a DOS application on exit will leave the video hardware
+in an odd state which confuses the emulator, resulting in subsequent
+text output being invisible. If this happens, just use the DOS
+ Hercules
+720x348 monochrome graphics mode emulation is implemented using SDL.
+Most Hercules features are supported via the normal I/O interface on
+ports When an application enters graphics mode, the emulator will open an
+SDL window (which will be closed when the application goes back to text
+mode). Including code to redirect keystrokes from the SDL window to the
+main terminal window would have busted the IOCCC size limits, so you
+need to keep the main emulator terminal window in focus at all times
+even when you are doing graphics (sounds a little odd but you will get
+used to it). On Unices, SDL will automatically output graphics via X11 if the
+DISPLAY environment variable is set up. Some applications (e.g. AutoCAD) support a PC configuration with a
+CGA card and a Hercules card, for simultaneous text and graphics output
+on different displays. The emulator simulates this configuration, too,
+using separate windows for the (terminal) text and (SDL) graphics
+displays. Like a real PC, the emulator needs a BIOS to do anything useful. Here
+we use a custom BIOS, written from scratch specifically for the
+emulator. Source code for the BIOS (written in 8086 assembly language)
+which compiles with the freely-available NASM x86 assembler is in bios.asm. The BIOS implements the standard interrupt interfaces for video,
+disk, timer, clock and so on, much as a “real” PC BIOS does, and also a
+small timer-controlled video driver to convert video memory formatting
+into ANSI escape sequences when the emulator is in text mode. Memory map is largely as per a real PC, with interrupt vector table
+at The CPU supports the full 8086/186 instruction set. Due to the
+complexities of the 8086’s arbitrary-length instruction decoding and
+flags, 8086 instructions are first converted to a simpler intermediate
+format before being executed. This conversion, along with instruction
+lengths and how each instruction modifies the flags, is assisted by some
+lookup tables which form part of the BIOS binary. The CPU also implements some “special” two-byte opcodes to help the
+emulator talk with the outside world. These are: Emulator exit is triggered if Emulates a 3.5” high-density floppy drive. Can read, write and format
+1.44MB disks (18 sectors per track, 2 heads) and 720KB disks (9 sectors
+per track, 2 heads). If you want to install your own software from floppy images
+(downloaded from e.g. Vetusware),
+the easiest way to “change disks” is to copy each disk image in turn
+over the floppy image file you specify on the command line. Don’t forget
+to put your original boot disk back at the end! Supports up to 1023 cylinders, 63 sectors per track, 63 heads for
+disks up to 528MB. Disk image format used is a subset of the standard “raw” format used
+by most disk image mount tools. In general, disk images prepared by the
+emulator will work with disk image tools and other emulators, but not
+the other way around. The emulator uses a particularly dumb algorithm to derive a simulated
+cylinder/sector/head geometry from the disk image file’s size. This
+algorithm often results in not all the space in the image file being
+available for disk partitions. For example, creating a 40,000,000 byte
+image file results in Note that unlike a real PC, the emulator cannot boot from a hard disk
+(image). Therefore, you will always need to use a bootable floppy image,
+even if after boot everything runs from the HD. No mouse is emulated. Reading the RTC (both time
+and date) is emulated via the standard BIOS clock interface, pulling the
+time/date from the host computer. Setting the time or date is not
+supported. A countdown timer on I/O port On a real PC, IRQ 0 and interrupt 8 are fired every 55ms. The
+emulator tries to do the same but again, the delay period is not
+calibrated so you get what you get. Beeps only, through the console. The emulator will run practically any software a real PC (of the spec
+listed at the top of this file) can. The author has tested a number of
+OSes/GUIs (MS-DOS 6.22, FreeDOS 0.82pl3, Windows 3.0, DESQview 2.8),
+professional software (Lotus 1-2-3 2.4 and AsEasyAs 5.7 for DOS, Excel
+2.1 for Windows, AutoCAD 2.5, WordStar 4), programming languages
+(QBASIC, GWBASIC, Turbo C++), games (Carrier Command, Police Quest, and
+a bunch of freeware Windows games), and diagnostic/benchmark software
+(Manifest, Microsoft MSD, InfoSpot, CheckIt) and all of them run
+well. Screenshots of some of these applications running (on Mac OS X) are
+provided for the impatient. A lot of compiler warnings are produced by clang. Missing type
+specifiers, control reaching the end of functions without returning
+values, incompatible pointer type assignments, and some precedence
+warnings, all necessary to keep the source size down. Other compilers
+are likely to produce similar warnings. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/dlowe/index.html Author: The current status of this entry is: For more detailed information see 2013
+dlowe in bugs.md. where What is different about the above if you do something like: ? To make it simpler to see try showing just the different line
+like: We liked how this entry used Unicode, specifically UTF-8, in a
+somewhat obfuscated way. Also, why doesn’t it crash but instead produces a correct output when
+called with one argument or when all arguments are equal? For extra fun, compile and run fun.c: with gcc and clang. With GCC (4.7.2), we get and with clang (3.3), we get and with Apple clang version 15.0.0 (clang-1500.0.40.1) in 2023, we
+get: Which one is correct? :) NOTE: A tiny implementation of command-line sparkline data
+visualization. NOTE: this has been provided in slflen.sh so
+you can try: instead (which try.sh also uses). This is a handy little tool for visualizing numeric series from the
+command line, using sparklines. Pass it a numeric series as arguments,
+and The code is very terse. I was torn between submitting this version,
+and a one-line version compressed using a couple more Hand-rolled UTF-8 sequence, magic numbers (what’s that 7 for?),
+meaningless variable names, reused variables, and so on. Edward Tufte invented sparklines (among other things.) Brilliant. Zach Holman’s ‘spark’
+utility was absolutely an inspiration. As I was writing up this description, I discovered I’m not the first
+person to write an obfuscated C sparkline utility! Vicent Martí created
+this one years (!)
+ago. (My implementation is completely independent.) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/endoh1/index.html Author: The current status of this entry is: For more detailed information see 2013
+endoh1 in bugs.md. You might also enjoy running: We liked this entry because it can serve as a standalone program as
+well as an include file; and, as usual, because its input data is at
+least as obfuscated as the program itself. This entry can be considered an abuse of the GCC’s optimizer; it
+takes GCC about 4x longer to compile it with -O3 than without, compared
+to clang’s 2x. … Isn’t there any more to it? Yes, of course. This is a tool for C programmers to play the SKI
+combinator calculus, especially, Lazy K. This program will shine when it is used as a library. For example, hello.lazy is a “Hello world” program written in
+Lazy K. where In other words, this program is a kind of polyglot. The usage is simple: you just have to wrap Lazy K program with
+ … is inherent in SKI combinator calculus :-) In addition, it uses various hacks to parse SKI code as C, and to
+satisfy IOCCC’s size rule. These led to the good obfuscation. See Spoiler section in detail, if you
+need. This program supports only “Combinator-calculus style notation” of
+Lazy K. “Unlambda style” and “Iota and Jot” style are not supported. Also, it requires a space between identifiers. In short, use
+ Huge memory may be required to compile the program (about 300 MB on
+my machine). In addition, there are some limitations (and workarounds) mentioned
+in Spoiler section. But I think it would only matter when you run the attached
+programs. I confirmed that the program successfully worked with the following
+compilers: Recent compilers with I think it will work on almost all platforms. I confirmed: To check whether the program is specified on the command line or
+included from another source file, the program uses a predefined macro
+ The whole program is interpreted by macro expansion. For example,
+ This expression returns an abstract syntax tree, and endoh1.c evaluates it. This program uses a very simple “term rewriting” approach for
+evaluating SKI combinator calculus. The rewriting rules are shown in the
+shape of the code. Consider a sequence of function applications in C: What type should So, I used a heavily nested function pointer type: This limits how many arguments one function can be consecutively
+applied to. But you can increase the number by tweaking the definition
+of macro Next, we need to encode “closures”. A closure is a function together
+with an environment which is a reference to non-local variable. In this case, we need something that meets all of the following
+criteria: However, no type in C is callable and has a reference at the same
+time. (It is feasible by dynamic code generation, but it is far from
+portable.) So, I addressed this issue by generating many function definitions
+statically by (ab)using macros: and by allotting each of them when a closure is needed. This leads to another limitation: the number of pre-defined closures
+limits how many identifiers ( But you can increase this number by tweaking the definition of macro
+ This margin is too narrow to contain a detailed explanation. Instead,
+I just ask you one question. Can you tell what
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/endoh2/index.html Author: You’ll need to have both Ruby
+and ImageMagick installed to run
+all the automated checks. If you do not have both, however, you can still do the below in the
+try section to enjoy the entry. The Makefile Next look at This is a program which, when fed its own source, generates a program
+that almost is its whitespace inverse, which, in its order, generates a
+JPEG file (speaking of file size abuse, that is about 16.4 times larger
+than a PBM file with the same image, but the source was also abusing the
+size counting program…) Don’t pay attention to the OCR I picked JPEG instead of PNG, GIF, or BMP because it is the most
+difficult to generate. I believe that the JPEG encoder is the world’s
+smallest ever. Nevertheless, the program was too big to meet the IOCCC’s size rule.
+So I created a smaller bootstrap program that generates the main
+program. I think the program will work on any major platforms and
+compilers. This program uses (a part of) Proggy Tiny Fonts which is distributed
+in MIT License: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/endoh3/index.html Author: The current status of this entry is: For more detailed information see 2013
+endoh3 in bugs.md. Trying this out will depend on how your system can play sounds. The
+author’s remarks include some options for different operating
+systems. The simplest way is to create a .wav file and have your system play
+that. Observe how you will need ruby installed. There are also some other musical samples, twinkle.abc and
+menuet.abc. This program can toot out a tune that is small enough to posted to
+most social media platforms that have small message length limits. This endoh3ram can toot out a tune that is small enough. The IOCCC no longer endorses the use of what was once twitter, or
+whatever it might be called today. We recommend that you pick a
+responsible social media platform to post the program’s output on.
+Nevertheless the award of this entry will remain the same for historical
+purposes. This is a sound synthesizer for a subset of ABC music
+notation. Try: If If you are using Mac OS X, try sox like so: If that does not work, use the attached script to convert the output
+into a wave file format: and play You can also enjoy some music scores that I attached. With
+ but you should be able to modify it a way to meet your system
+requirements as described above. The following sequence of questions may be helpful to understand the
+ The following features are supported: The following features are NOT supported: You can NOT write a note length immediately followed by a
+note Can you figure out why? A workaround is inserting a whitespace: I tested it on: I believe that all the scores that I attached are
+out-of-copyright. I did write a score of the Happy Birthday song too. (It does not
+matter because the song is out-of-copyright in my country.) But I do not
+attach it to protect you from W****r. For the same reason, do not post a score that contains only
+ Here is a magical expression which I found by brute-force: Interestingly, it converts an ASCII number of ABC notes to the
+corresponding tone number. By the way, you can write a half-tone by the following
+characters. Note that the tone numbers simply enumerate the semi-tone steps. So
+we can calculate the frequency easily: Finally, the following code generates a saw wave: where (Strictly speaking, this behavior is undefined according to 6.3.1.4
+in C99; you can replace it with All that was left was to combine and condense the components. The key
+is squashing them into just one This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/endoh4/index.html Author: The second form is preferable as it will temporarily make the cursor
+invisible as recommended by the author. If no file is specified in
+ Hit ctrl-c to end the program. The author recommends the use of xterm. For an example, if you are a football/soccer fan, try: This program is formatted as the net for a tetrahedron (hint: try
+feeding the program it’s own source code like This is a convex polyhedron viewer, which: This simple spec involves many details. (Note that this program does not use I think it conforms with both C89 and C99. I confirmed that it worked
+on gcc, clang, and tcc. It should not be warned with
+ You may want to use or You can change the screen size. Let the aspect ratio be about
+3:1. The shape of this code is the geometric net of a regular tetrahedron.
+So, try: The solids/ directory includes various solid
+data: I created the files by using the POV-Ray scripts (1 and 2) in
+Wikipedia. They are copyrighted in CC BY-SA 3.0 by “User:Cyp” and
+“User:AndrewKepert”. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/hou/index.html Author: The current status of this entry is: For more detailed information see 2013
+hou in bugs.md. Follow the instructions in Try opening the file and then let the program run a while and every
+so often reopen the file, to see how it changes. The author suggests
+that you leave the program running overnight to see what happens. If
+however you do not have all night :-) then the following JPEG files
+should show you what happens with some of the invocations above: This program does not terminate by itself: you must kill
+ You could consider that this program violates the source code size
+limit. This is because the first compilation of this program is really
+just a decompressor to generate the real source code of the program. This program will loop infinitely while progressively refining a raytraced
+image. NOTE: the author refers to a.c, placed in a gzipped
+file but there is no need to do this as the Makefile takes care of it
+without even needing to create a temporary file. This program is a programmable rendering engine with a built-in
+default scene. The standard command line is: As To save time and energy for the judges, rendered images for all
+provided scenes are provided as attached files. The program consists of a recursive-descent interpreter, a
+ The The The The encoder never emits The decoder uses an O(n^2) algorithm to avoid the gigabytes-sized
+hash table frequently found in other This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/mills/index.html Author: The current status of this entry is: For more detailed information see 2013
+mills in bugs.md. While that is running, point your favorite browser at: http://localhost:8224. Who will be the first to post an image rendered during a
+leap-second? This program is a handy graphical clock. Simply run the program,
+click OK to any annoying security dialog that pop up (aren’t
+those annoying?), then fire up your web browser and type in the
+following URL: http://localhost:8224. You will soon be presented with a lovely dynamically rendered 3D
+scene that also conveniently tells you the current time! The program will continue to give you the time of day as it changes
+by reloading the page as often as it can render. If you grow tired of
+watching your life slip by, hit It would be possible to fix this by adding at an appropriate spot in the code (an exercise left to the reader).
+However, as this limitation is documented, it is not technically a
+bug. The program wears many hats (not literally). It is It replies to web requests with a PNG image that uses the Adam7 encoding
+to return data progressively. Since the data is returned in Adam7
+format, the scene is displayed initially at a lower resolution and
+allowed to be progressively refined as time goes on. The ray tracer is
+integrally tied to the PNG encoder, casting rays in the Adam7 order. The
+web server uses PNG primarily because of PNG’s ability to return data
+progressively, and not as you might think it being because the PNG
+standard is so obfuscated as to require both little and big-endian
+encodings at different spec layers. Since ray-tracing was an obvious choice to return to a web server, I
+needed something to ray-trace. A static scene would be uninteresting. I
+took inspiration (as I often do) from the IOCCC remarks file which
+says At least one judge prefers to maintain the use of the leap-second as
+part of the world’s time standard. Then it was obvious; the code should display the time. It is believed
+(but not confirmed) that the code will, in fact, display leap seconds
+correctly. To display the time, of course we would need a font. This font is
+encoded as a string, using only the C whitespace characters. Clearly,
+the judges intended this use of whitespace for data compression, since
+their tool doesn’t count whitespace in strings differently than
+whitespace outside of them. The code can be user-modified simply by changing the build command
+line. The following symbols are defined in the Makefile: The original program bound the server to This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/misaka/index.html Author: This will build a bunch of versions of the code. See the author’s
+details for information on all of these builds. To understand the various intermediate source files that are built,
+try: Also try: NOTE: Use - for standard input. For example: There is more to cat than mere cats. Be they tall,
+fat, long or squat, this source code is sure to amuse. While one of the judges was reviewing this entry on the stern of the
+Island
+Sky in the middle of the Atlantic Ocean waiting for the total
+solar eclipse of 2013 the judge was struck by a flying fish. While
+the result of the impact was that the Port from Portugal was
+lost, the Grog
+from Cape Verde and the laptop containing this entry was saved. While I’m sure most cats would have
+preferred otherwise, the flying fish was returned to swim with the
+fishes. :-) No cats were harmed in the
+process of judging this entry. Where One of my favorite unix utilities is I thought the lack of horizontal concatenation must have been an
+oversight, so I implemented this utility: If Because Seems like the After If your terminal has really thin fonts, you can also make this output
+fatter by concatenating files horizontally: Output width is determined by the first level of stacked programs, so
+a triangle like the following will not have horizontally expanded
+output: Finally, if you lost track of how many misaka.c you have stacked together, you can feed the
+source to a brainfuck interpreter
+to get an overview of how the programs are stacked. Example: This outputs: If any input file fails to open, If Main obfuscation is in having a C program that compiles when tiled
+horizontally and vertically, while using single line comments in less
+than half of the lines and maintaining a meaningful layout
+while doing that. There are other challenges too, of course, like getting a Brainfuck
+program to tile horizontally and vertically. Really, tiling code of any
+sort horizontally is an interesting exercise, I encourage everyone to
+try this once. Other features to look for: Extra files included in my submission are informational only, they
+are not needed for the program to work. The name, layout, and functionality of This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/morgan1/index.html Author: Try pressing the arrow keys when your focus is in the window. To verify the output, try echoing the date of an evening with a clear
+sky. Use binoculars and/or telescope as needed. In some cases you may
+need to wait for a better time of the evening. In a few cases, such as
+the South Pole in the summer, you may need to move to a different
+observing site. It displays the position of the 8 planets of the solar system around
+the Sun. The date given in the command line is in the format YYYY/MM/DD
+(year, month and day). The direction keys can be used to move in time
+: It handles correctly all leap years and the switch between Julian calendar
+and Gregorian
+calendar (10 days missing between 1582/10/04 and 1582/10/15). The scale is logarithmic to be able to display the 8 planets without
+having Mercury, Venus, Earth and Mars squeezed around the Sun. The size is not proportional either. It also displays the position of 2 famous comets during their last
+approach: With gcc 4.7.2 on Linux Ubuntu 12.10: With clang 3.1 on Linux Ubuntu 12.10 : This is due to most of the parentheses and braces being removed when
+unnecessary. To verify the display, you can look at one of these programs : *
+xephem : https://web.archive.org/web/20130310133219/http://www.clearskyinstitute.com/xephem/
+* homeplanet : https://www.fourmilab.ch/homeplanet/ * https://www.theplanetstoday.com This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/morgan2/index.html Author: For the console version (ncurses): For the graphical version (X11): The judges enjoyed playing the game almost to completion; if we
+remember correctly, we managed to place 59 or 60 dominoes. We wonder,
+what would be faster: to play the game to completion or to write an
+unobfuscated version of it? This program is a domino game. The goal is to place dominoes on the
+8x8 grid. Each domino is made of 6 squares of the colour red or green.
+To place a domino, at least one of its side shall match the other side
+of another domino. At the start of the game, the first domino is placed randomly on the
+grid. You get another domino to place by selecting one empty position in
+the stack on the right. You can have up to 8 dominoes pending at any
+time. Use The currently selected domino is indicated on the top right. Once a domino has been selected, the cursor moves to the grid. Use
+ To go back to selection mode, press The domino can be placed in an empty position if all its neighbours
+have matching sides and the domino has at least one neighbour. First, depending on the number of dominoes pending in the stack, a
+bonus is accorded: Then the bonus is multiplied by the number of matching neighbours the
+placed domino has (1, 2, 3 or 4). This is added to the score. Finally, the total score is divided by the number of dominoes placed
+(1 - 64). The 3 numbers on display represent: the total score, the fill count
+and the final score (total score divided by fill count). The game is finished when no more dominoes can be placed and if one
+of the following occurs: Note: There is no real end of game detection
+implemented in the program, simply press With gcc 4.7.2 on Linux Ubuntu 12.10 : With clang 3.1 on Linux Ubuntu 12.10 : !!!!! HAVE FUN !!!!! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2013/robison/index.html Author: Of integers this prog does a lot, And modulus if remainders the needing, More than one line can thru give input, With cut and paste and some time, I love the C language; its terseness is tops. No shifting, division, remainder, or times. But I do have a pref’rence, for pointer deref’rence. With mem copy I copy, and mem set I clear. One tiny detail that could lead to defeat. My fixation might hint at a textual bent. You can add, do division, and multiply too. Try dividing a googol by one forty
+three, A hundred and twenty five digits or so, Say, say, does it have octal or binary zen? Use lowercase in trans-decimal radix, To grok the internals, ask Queen
+Cleopatra, Unlawful subtraction, a grade school infraction, The moral is clear, for programmers out there: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/birken/index.html Authors: There is alternate code that lets you redefine the port to bind to,
+in case there is a firewall issue, and also lets you redefine the timing
+constant, or maybe: Next, try in another terminal, as the above one is running: What happens if you specify instead of a regular file something like
+ But there’s more! Try opening in a browser the same address and then
+see what happens. This is explained by the authors when explaining their
+inspiration. This version allows you to redefine the port to bind to, should 1701
+be a problem for some reason, and it also allows you to change the
+timing as described by the author. See configuration below. To specify the port to say, 31337, try: To change the timing constant, You can combine them both of course. Use Port 1701? Well this is not the l2f registered TCP/1701 protocol.
+Sniff the traffic to/from that port. You will see HTTP client and server
+traffic. The HTML content you may see is static and immutable. Nothing
+funny with the HTTP status codes. Even the timestamp cookie, once set,
+remains static throughout the session. The data appears to not be
+transmitted within the binary content communicated between client and
+server. So how does this program do it? A trek though the cloak of
+obfuscation awaits the reader of the source! When launched in web server mode, this application appears to deliver
+nothing more than a static HTML page. But, in actuality, it allows
+covert file transfer over the Internet. This is demonstrated by starting
+the application as a client-side downloader. The hidden transmitted data
+cannot be reconstructed or even detected from the binary content of the
+traffic between the client and the server. Try using the program’s source code as the secret file: The optional port defaults to 1701. If the web server instance is
+started on the same box, try: It will incrementally display the contents of the hidden file at a
+rate of approximately 1 baud. The client-side downloader will automatically terminate if the web
+server is bounced. Plug the URL into a browser to view a static HTML page containing
+ASCII artwork. Studying the network traffic will reveal that the HTML content is
+static and immutable, the HTTP request and response fields do not
+contain anything remarkable, HTTP status and error codes are not
+exploited, no unusual or deprecated features of HTTP are used, and while
+the cookie is based on a timestamp, its value also remains unchanged
+throughout the session. As mentioned in the abstract, the data is not
+transmitted within the binary content communicated between the client
+and the server. A full explanation of the protocol appears below, but
+feel free to explore before reading further. The inspiration for this program comes from Star
+Trek VI: The Undiscovered Country, specifically the final
+confrontation between the Enterprise
+and the enhanced prototype Klingon
+Bird of Prey. The definitive feature of the prototype was its
+ability to fire while cloaked. But, perhaps even more impressive was its
+ability to keep an open communication channel with the Enterprise
+throughout the battle, enabling the antagonist Chang to
+taunt Captain
+Kirk with Shakespearian
+quotes while he slowly pelted his ship with torpedoes. Normally, cloaked
+vessels must maintain silent running to avoid detection. The battle is commemorated in the form of ASCII artwork depicting the
+ships faced head-to-head in the page delivered by the web server. Plus,
+the program source code is formatted in the shape of a Klingon Bird of
+Prey. The code itself includes a number of Star Trek references: the
+registry number of the Enterprise (NCC-1701) is defined as a constant;
+variable names spell out Cpt. James T. Kirk and Odo (the Deep
+Space 9 character was played by René Auberjonois who also appeared
+as Colonel West
+in Star
+Trek VI); the As obligated by a program that employs 23rd century cloaking
+technology, when the source is fed as input to IOCCC size tool version 2014-09-23-v19, and
+the The client-side downloader relies on the response time of the web
+server rather than the binary content of the response. The server
+transmits 1 nibble at a time by counting to the nibble value via a
+sequence of rapid responses terminated by a long response. For instance,
+the value 5 would be transmitted by making a series of requests that
+result in 5 near instantaneous responses followed by a half-second
+delayed response. The long delay is skipped in the case of 15, the
+maximal nibble value. With the aid of an ASCII table, it is actually
+possible to read the nibbles by repeatedly pressing the refresh button
+within a browser and observing the page refresh delay. Nibble Count Coding (file transfer protocol NCC-1701) is faster than
+transmitting each individual bit as a short or long delay because it
+sends each byte with 2 long delays whereas communicating individual bits
+requires 8 long delays in the worst case scenario. In fact, Nibble Count
+Coding is faster than applying Huffman Coding since that is designed to
+produce compact codes under the assumption that the bit value does not
+affect transmission time. The server relies on the cookie to identify each client uniquely,
+enabling it to transfer the sequence independently to each client. As with all network communication, accurate transmission of data
+relies on the nature of hardware revealed through statistics and
+timeouts set accordingly. The long delay is arbitrarily set to
+ The NCC constant is the web server port number. For space considerations, the following include statements were
+dropped resulting in compiler warnings: It may be necessary to restore some of these under certain
+environments. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/deak/index.html Author: There is an alternate version that the author provided but fixed in
+2023 to compile with modern systems and to allow one to reconfigure the
+constants Try changing bounding box coordinates in the source to explore
+various regions of the fractal. The alternate code is included as prog.alt.c
+so you can more easily see the difference in what it might look like if
+the C was more recognisable and also to let you reconfigure the
+coordinates. If you wish to redefine the coordinates you can do so by defining
+ You may pick and choose which ones to redefine. Use We consider this entry a tribute to all “Abuse of the C preprocessor”
+and Mandelbrot fractal drawing entries we’ve seen over the years. We liked the use of unary notation facilitated by variadic
+macros. The application was written on a standard Ubuntu 14.04 and tested
+with gcc 4.9.1 and clang 3.5 on a 64 bit system (though this should not
+matter). The application makes no assumption regarding any system
+specific settings, and it only needs a console to run. The provided
+Makefile is just to have an easy compilation. I don’t see any problems
+porting it to different compiler/system as long as it supports the C99
+standard. The purpose of the application is mainly to illustrate the weird
+possibilities of the C preprocessor, rather than to be a full featured
+console mode Mandelbrot drawer. There are tools much better suited for
+drawing fractals. The usage of recognizable elements from the C programming language in
+the application source code is intentionally kept to a bare minimum. If
+this phrase would not be true, the application would be the
+following: The application expects no parameters, the only way you can change
+the behaviour is to modify the source code at the indicated location:
+the line Yes, unfortunately there are compiler warnings of the kind
+“initialization makes integer from pointer without a cast” but the
+provided Makefile automatically disables them. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/endoh1/index.html Author: The script will ask you if you wish to run What is the difference between running Big terminals with tiny fonts have their uses in certain cases. One
+of them is: which is shorthand for: When using a smartphone to read the output, you may need to step back
+to see the bigger picture because that picture is worth more than 1000
+words. You may want to use a large display with a very small terminal
+font. See spoilers.md. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/endoh2/index.html Author: If you look closely at the source, you will see code that appears to
+puts C code that includes itself. How and why? Perhaps it is in the DNA
+code of the code? Perhaps there are 23 reasons? :-) This chromosome program synthesizes a double helix. The helix can
+also be compiled as a C program. Enjoy DNA programming! This program was inspired by Acme::DoubleHelix: http://search.cpan.org/~xern/Acme-DoubleHelix-0.01/ The synthesized helix just includes the original program at the
+head. Do you see how prog.c determines whether it
+was invoked as a standalone program or included as a header file? Note
+that it does not use any gcc extension such as
+ The synthesized helix of course follows the base-pairing rules
+for DNA: A is bonding only to T, and C is bonding only to G. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/maffiodo1/index.html Author: This entry requires SDL to be installed. See FAQ 3.8 if you don’t know how to do this for
+your system. The current status of this entry is: For more detailed information see 2014 maffiodo1 in bugs.md. The parameters to the program are: If you end up telnetting to the server (feature of mario.sh) you can try: If you wish to change the width and height, defaulting at 640 x 480,
+say to 800 x 800, try: A classic for a particular generation. Like all good programs, being
+data driven means you can do fun things in small spaces. NOTE: the author states to use in command mode to see this effect. You don’t need to modify your
+ Use The program returns 0 if the player wins or non-zero if the
+player loses so you can test it and make something useful (or not), like
+this: and type in: This is an engine for platform game. It
+can be used to create games like the legendary Super Mario
+Bros. With this simple and clear source code you can create all the games
+you want, for free! In my two tests I tried to create one level of Super Mario
+Bros and one of The Great
+Giana Sisters. Both games are classic platform games
+and both share the same fundamental rules: There is a character. There are power-ups that can change the look of the character
+and/or give the character more or different powers or
+abilities! There are walls, floors and ceilings. The character can move and
+jump over these type of obstacles but cannot walk through them. There are enemies and if the character collides with an enemy,
+the character dies or loses its powers. [NOTE: this seems to no longer be the case as of 2023 and most likely
+much earlier. However one can change the look of the game doing this
+anyway:] The color of the sky is wrong on macOS. You need to flip some bytes
+from the last parameter of the program: MARIO LAST PARAMETER: GIANA LAST PARAMETER: The code requires The build process will generate some warnings (~60 with clang)
+about: The program read a single image that contains all the game sprites.
+The image must be a grid of 8xN sprites. The size of a single sprite
+must be square. The program calculates the size in this way: Each sprite is identified by its position inside the grid, counting
+line by line, from left to right (for example sprite 0 is the top left
+sprite in the grid, sprite 8 is the first sprite of the second row of
+the grid etc.). Some positions of the grid have a predefined purpose: All the others sprites can be used as you want, depending on the game
+you want to create. The program reads the level description from The level description is a sequence of rows where each row describe
+an object. You can input as many objects as you want but the maximum
+number of objects handled by the program is 333. You can modify this
+value by editing the source here: Each row has six columns: If The last row of the level descriptor must have all its columns set
+equal to Some classical features are missing: throwing objects, shooting,
+multiple lives, score tracking. You can add those features if you
+want! The program allows only one level. It’s easy to add a menu and
+multiple levels but the size of the engine would too big for the
+contest. When the There’s only one audio track (game effects are missing). Some of the sprites used in the examples are identical to those of
+the original games; the others were designed by me. The music used in the examples have been resampled,
+starting from the original versions for the Commodore Amiga and Nintendo
+NES. Super Mario
+Bros is a game created by Nintendo Co., Ltd. My
+use of the sprites
+does not intend to infringe the intellectual
+property of Nintendo but only demonstrates the operation of the
+program. From my point of view this is a tribute to the legendary game
+Super Mario
+Bros! The
+Great Giana Sisters is the game created by Time
+Warp Productions and my justification for the sprites for Mario are
+the same for this game. Long live The Great
+Giana Sisters !! :) This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/maffiodo2/index.html Author: There is a 121 byte version provided by the author. See Alternate code below. The current status of this entry is: For more detailed information see 2014 maffiodo2 in bugs.md. This shorter version is provided by the author. It has a fixed ramp
+and so not as fun but it’s 121 bytes instead of 140. On the face of it :-) given what this program does one might wonder
+what makes this winner special. But when you realize the source is small
+enough for posting to social media that has a small size limit. Who will be the first to tweet this source? How many re-tweets will
+such tweet get? And how many people will really understand the
+tweet? Judges’ 2023 update: Last year we would have referred to a toot,
+as in a Mastodon
+toot. This year we might have mentioned the term publish
+although we remain fond of the historic
+Mastodon term, toot. This program convert an image to an ASCII ART. The program reads a
+raw RGB image from The build process will raise some warnings about: The program will crash if run without parameters. If you have a terminal geometry than is different from the common
+80x25 you can modify the output width by changing the value of
+the first variable: Type this: You can use your own image. Convert the image to a raw RGB image.
+Using ImageMagick it’s very simple: This program require one parameter or it will crash. The parameter of
+the program is the conversion ramp. You can use different ramps
+or create your own (for example using some letters of your name). These are some ramps you can try: An alternative version of this program is only 121bytes long: This alternative version has a fixed ramp. It’s
+smaller but it’s not so fun to use… This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/morgan/index.html Author: Think of this as a Maker Faire’s make. :-) It works reasonably well. While not super ultra-featured, it does
+fair well with the Makefile we supplied. Not only that, it helped
+uncover a bug we had in our special Makefile rules. This program is a tiny It is able to parse a subset of the It should be able to build programs of previous years with the
+provided With gcc 4.8.2 on Linux Ubuntu 14.04 64-bit : This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/sinon/index.html Author: This script will ask you if you wish to try again after each run.
+Type in any character other than Try to figure out how this entry determines the optimization level
+with which it had been compiled. Is this an example of undefined
+behavior or unspecified behavior? Sinon is a game of timing, the goal is to eliminate all enemies in
+under one minute. To start, compile and run the program. To resume, compile and run the
+output repeatedly until you have won/lost the game. For example: Sinon is played by compiling and running the output repeatedly. Two
+factors determine what actions are taken: If you fire too quickly, the weapon will jam. If you fire too slowly,
+you will not be able to eliminate all the enemies in time. Thus the
+primary objective of the game is to time your compilations just
+right. Sinon has two weapons that are selected based on compiler
+optimization level: “gcc -O2” or “clang -O2” will fire Hecate II, a powerful rifle
+that requires longer time to cool off. “gcc -O0” or “clang -O0” will fire Glock 18C, a less powerful
+pistol that requires less time to cool off. Because the weapons cool off independently, the best strategy is to
+alternate between the two weapons. It is fairly easy to win the game
+with this strategy even with occasional jams. If your compiler does not have the right optimizations, only Glock
+18C would be available. It is still possible to win, but your timing
+will need to be more precise. This is effectively playing the game on
+“hard” mode. It is worth trying this mode even if you have the right
+compilers. Sinon has been tested and verified to work on these platforms: Sinon is intended to be played in a 80x25 terminal. Sinon might be the first game that uses compiler optimization level
+as a primary input. Sinon has a demo mode that plays the game automatically. Make sure
+that there are no files named “run” and “run.c” in current directory
+(they will be overwritten) and run: File size and CRC32 of prog.c are embedded in
+line 7. Process for making Sinon is included in spoiler.html. Layout of this code is based on Asada Shino, also known as “Sinon”,
+from Sword Art Online. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/skeggs/index.html Author: HINT: Try pressing the left and right arrow keys as needed. Also try
+pressing space/enter to select options. Pressing Q or Escape may end the
+fun before you are ready. :-) When the code looks like lemons, it is probably because the
+LEMONPEOPLE, or at least the LEMONLORD was involved. :-) Look at some of the C pre-processor macros in the source code. Ask
+yourself why C source is being passed as arguments to some of those
+macros. Now you may observe, while it is running, that some C source code is
+being written to a file and then compiled. And yet that compiled code is
+somehow executed from It was ten yours ago when THE LEMONPEOPLE invaded, juicing all in
+their path. Attempting to free the Earth from their tyranny, you have endured
+pulpy and sour battles. This has now culminated in you reaching the throne room of THE
+LEMONLORD. Armed with your right-facing curly brace, you charge into battle. (Use left and right arrow keys and space/enter to select options.
+Press Q or Escape to quit.) Unfortunately, it became very difficult to get this entry to fit
+within the size requirements. It’s currently at 2052 according to iocccsize, and 3994 according to
+ The current size is a third to a half of the original size before
+compression. Due to this, it does LOTS of things that subtly annoy compilers! This occurs because some of the Somewhere, I needed to set a variable and then branch on the result.
+The shortest way was to combine them. Some self-proclaimed “EXPERTS”
+think this is a bad programming practice, but what do they know?
+:P An Turns out that sometimes, a (?) Under some systems, Take a close look at how it works. Notice that it’s passing C code to
+certain macros… Guess what? It’s a very simple kind of JIT compiler, though not used
+as deeply as would be cool. Essentially, it generates C code at runtime, dumps it to a file, and
+then runs a C compiler on that file, telling the C compiler to generate
+a shared library. Then it loads the shared library with
+ Ignores the result? That can’t be right. Well, it is. Instead of using But wait - how can it link into the main program, either? It has no
+way to reference anything in the main executable! But it does: I’m injecting certain addresses into the generated code,
+which it then casts to pointers and accesses! It uses this to make
+certain functions available to the main program, so the main program’s
+generated code will then enter itself where it’s needed. There are also lots of No, these are not obfuscation. These are compression. There is a little bit of obfuscation gained from using the
+stringification operator. (I can never remember what it’s actually
+called, but it’s the As part of the JIT compiling, the program hides the fact that it
+needs ncurses: it just links ncurses with one of the generated shared
+libraries, and then can access the contents of the ncurses library! Also, note where functions start and end… I’ve messed with the syntax so that it’s not actually formatted
+properly. It almost looks like it is, but it isn’t. This isn’t significant obfuscation as long as you run it through a C
+source code beautifier. But wait… if you aren’t careful, running it through a C source code
+beautifier won’t work. Remember how I’m interlacing generated C code
+with actual C code? Note that this WRECKS some beautifiers. I hope you
+have a good one! (There’s an obvious way around this but I’m not going to spell it out
+for you. That’d be too easy!) Do note that there are some other miscellaneous obfuscations, but
+they should be easy to understand once you figure out the ones
+above. This program is a very easy program to cause to fail! Some things to check On line 16, where it says Do you have ncurses installed? Does your system have If it’s the latter (or some other path), you’ll need to update line
+97. (I had to do this under Cygwin.) Does your system need Does your system have a vague dislike for Does your system support
+ Check the file Can’t run a beautifier on the source code? I’m not going to help
+you there. I’ve tested it on the following platforms, in case you need to try it
+on one: I ran out of time to test it on more systems. Who am I? Yes. Why doesn’t your program require a pet fish license? THE LEMONLORD’s pet LEMONFISH was not rendered in the game, and so
+does not require a pet fish license. Was this inspired by anything? Yes, this was inspired by a minigame from an open-source codebase of
+Space Station 13. I didn’t, however, look at the minigame at all during
+the development of this entry. What’s the length of this README file according to the iocccsize tool? $ ./iocccsize -i < README.md 6057 This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/vik/index.html Author: There is an alternate version that will theoretically work with
+Windows compilers (if anything in Windows works :-) ). See the Alternate code section below. The current status of this entry is: For more detailed information see 2014
+vik in bugs.md. The alternate code, prog.alt.c, is based on
+the author’s instructions on how to get it to work with Windows. Use This program sets a new tone for obfuscation. But do you understand
+what it says about obfuscation? Perhaps: might speak to your coding style? If not, then perhaps: might help? :-) This program converts ASCII text to Morse audio file and vice versa.
+As far as I can tell, there are at least six chocolate references in
+this program. This program can convert text to Morse to a raw 44.1kHz stereo audio
+file. Via streaming to Don’t forget the last ‘ or alternatively pass a .wav file as input. The preferred input format 44.1kHz stereo, but it does a decent job
+on mono input and different frequencies as well. The program is portable to most platforms. The only system dependency
+is that the program relies on writing binary data to
+ Microsoft compilers add a carriage return to newlines, and to compile
+the program with this platform, the following line can be added to
+ NOTE: see the alternate code for this. The program uses a quite simple algorithm for detecting tone on and
+off events in the Morse signal. Hence the program does not work well
+with noisy input signals. I have tested it with several samples of man
+made Morse recordings as well as computer generated ones. Generally, any recording from ham radio transmissions does not decode
+due to noise and echoes. Other man made recordings may decode, but some
+characters can be incorrect due to too big variation in length of tones
+and pauses. However I found some man made recordings on that decode
+reasonable well. If a recording doesn’t decode, you could try to pre-process the input
+with a narrow bandpass filter on the frequency of the transmission. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2014/wiedijk/index.html Author: By default that will use which would change it to use C11 features definitely help this entry to be as concise as it
+is. The judges would like to think that they had almost understood how
+this entry works. If you win a bet by demonstrating this entry, please let us know. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/burton/index.html Author: or: Type in expressions on standard input. Notice how the script reads in from a file. If you type just: it will prompt you in the same way. Send ctrl-c to exit. Finally, if you wish to read the man page: An alternate version of this entry, prog.alt.c, is provided. This alternate code is
+discussed in the “prog.c vs prog.alt.c” section of the author’s remarks
+below. Use “Look, Ma, no The place where some arithmetic operations are done, for example,
+division or modulo, are easy to find. Where are addition and
+subtraction? We were impressed with the level of detail the author “blogged” the
+obfuscation process. All useful tools should include sufficient documentation. See the
+included man page. ;-) This program is named Printed in 8 pt Courier, it makes aesthetically pleasing 8.5 x 11
+wall art. Dominik Muth observed a
+syntax error on The modified code is agnostic to Yes, this is another calculator program. However, unlike any other calculator source code the author is aware
+of, this one contains no digits. At all. Anywhere. As in Nor are the digits simply obfuscated. There are no character
+constants. There is only one single, short string, and it does not
+contain any obfuscated digits. And yet the output is in decimal and
+hexadecimal, and it accepts octal, decimal, and hex input. Flow control is by The code size is intentionally 2015, as stated by
+ Finally, The code follows many industry best-practices: You know what it does just by looking at it. Numbers and digits have often been used for obfuscation, so in a
+bid for better clarity, this code has no digits at all. In the spirit of clarity, most of the variables are declared
+before use, so they are readily visible, with single letter names that
+don’t clutter the screen, in a tautological arrangement. More helpful is the use of All functions are short (and therefore easy to understand?) and
+do only one thing, well, …. Curly braces invite endless holy wars over readability. This code
+only uses them for function definitions, thereby greatly improving
+readability, and reducing arguments about said readability. One of C’s many blessings (until recently) is a modicum of
+keywords, of which only 8 are used: The code helpfully declares In spite of its inherent clarity, the code was presented to both
+ That the code is obfuscated is spelled out two different ways in
+the source; it helps to reformat the code to see the second
+spelling. The author is overly fond of the code that handles input. There
+is no memory allocation, nor pre-allocation of arrays, so where does the
+memory come from? The multi-base Finally, documentation of the source code structure is helpfully
+provided in rot13 format. But isn’t it unsportsmanlike to rely upon it?
+However, even with this helpful guide, things like reading input lines
+remain as tricky to read as they are to write. gcc 4.2.1 without arguments compiles cleanly
+(e.g. clang 3.6.0 lives up to its namesake, resounding on non-problems. To
+stifle these complaints: When invoked with With If the program name begins with an If you do not want to puzzle out how it works, see spoilers.md. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/dogon/index.html Author: To change the dimensions you can use the to make the game 640 x 480. Obviously changing it to non numbers or
+negative numbers or too large numbers will cause problems. There is an alternate version that is based on the author’s
+suggestion to change a value in order to see a bug that they avoided in
+their entry. See Alternate code below. Press and hold the Left Arrow key until you turn 90-degrees to the
+left. When you see a long tunnel, press the function key F2. Use the Up, Down, Left and Right keys to change your path. Press function higher numbered function keys (F3, F4, …) to go
+faster. Press F1 to stop. Turn 90-degrees to one side. Press F4 to drill into some blocks for a bit. Press F1 to stop. Turn 180-degrees to face the way you came. Press F2 and navigate back down the new hole until you reach the long
+tunnel again. Press F1 to stop. etc. Press the ESC key. The author suggested that one change This alt version does this for you. Use Try locating the issue the author suggested exists. You are in a twisty maze blocks, almost all alike. Those blocks are generated by twisty maze of code blocks, almost all
+different. Can you find your way around either and understand where you are? How many function keys does your keyboard have? Can you generate very
+high number function keys such as F30 or F31? :-) Textures? We don’t need no stinking textures. Just run This entry, though pretty thoroughly obfuscated, is not entirely
+original, nor am I Notch. The inspiration for this entry is a demo code
+written by the Notch himself, which was released with the following
+license: “you may use the code in here for any purpose in any way you
+want, at your own risk”. That version will henceforth be referred to as
+the original. Though the original in itself was quite nice and rather
+dense piece of code, it was not written in C, nor entirely and
+meticulously obfuscated, a state of things I hopefully rectified. Basing it on the original which already had a wonderful simple and
+concise ray casting through a generated voxel world rendering, I added a
+few tweaks of my own device: This entry is rather portable I think on modern platforms. It assumes
+of course basic X-windows availability. There are several other salient
+assumptions though: The entry, on purpose, (see the section about SIMD below) does not
+use enough bits of precision, so sometimes the ray will miss the
+intersection of two voxel faces and push on through. That’s why you may
+notice some noise along close up voxel edges. Fixing this issue would
+have taken the entry over the size limit regrettably. Well, of course you have all the usual suspects, used for extreme
+compression, and such a nice layout: not very informative identifiers,
+which are being reused all over the place, some rather gruesome looking
+expressions, a whole load of magic constants with apparently no rhyme or
+reason (including a Lagrange polynomial), and a message from our
+friendly Cetaceans. However it also includes some clever and not so
+obvious though instructive techniques, to subtly make the code more
+magical and efficient, at the same time. Those techniques are about the use of 64 bit integers in order to do
+SIMD work, in a portable way without ever using any SSE/AVX or other
+non-portable compiler inline functions! The irony though, is that when
+compiling the program on modern X86 architectures indeed SSE/AVX is used
+for the long longs. Following is some “Spoiler” information, So if you
+want to play tough, stop reading at this point. So how is this done? Quite simply by using the whole
+ To spell it out, the macro producing such vectors is Evidently when doing such arithmetics, care must me taken to avoid
+overflow from one component to the other, but since our voxel world is a
+torus of size 64 in each dimension this hardly matters. A subtle issue,
+is how to deal with signed quantities. In the Once sign is extended from a least component into higher bits, it
+seems at first to be recipe for disaster, however everything works
+beautifully, and you get precise component results when the final
+accumulation components in Similar technique is used on the RGB components so their brightness
+can be adjusted simultaneously by the expression:
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/duble/index.html Author: There is an alternate version of this entry, discussed in the
+author’s remarks. See Alternate code
+below. This alternate code, provided by the author, is discussed in more
+detail by the author in the ‘prog.c vs prog.alt.c’ section of their remarks. Use Beautiful penmanship! However, your fonts may vary. How does this entry compress the font it uses? What’s the purpose of
+ This program prints text in your terminal with an interesting
+hand-writing effect. It uses the Braille patterns range of the unicode standard:
+this allows to consider each terminal character as a tiny 2x4
+bitmap. Turning the Braille code into something visual might be considered
+blasphemous. When I was fighting to make this program work, I started
+wondering if it was not the reason for its very erratic behaviour. The file prog.alt.c is the one I
+submitted. Gil Dogon noted a few unsafe
+statements (statements whose behaviour is undefined in the C standard
+and, as such, could cause issues with other compilers or optimization
+levels). These have been fixed in prog.c. After this fix, in order to remain rule-2-compliant, a variable name
+has also been shortened in this file. If you have Otherwise (gcc): (You will get a few warnings in this case.) You need a terminal configured to handle a UTF-8 encoding
+and a font including Braille patterns. This is the default on most modern GNU/Linux operating systems. The default terminal application (gnome-terminal) or even a simple
+xterm should render things properly. I tested this on several Debian and Ubuntu systems, 32 and 64bits and
+no configuration was needed. I also tested it on FreeBSD 9.3 32bits (font and encoding
+configuration was needed in this case). This entry is obfuscated in various ways: On the other hand, the following may help: In order to comply with the size rule, I encoded only a part of the
+visible ASCII chars: Uppercase and lowercase chars are rendered the same. The program also
+understands space and linefeed ( This limitation is due to the heavy use of recursion. After having
+processed a large number of characters, the process may exceed the stack
+size and crash. (However I did not experience this myself. The top-level
+recursion might be removed by the compiler as part of its
+optimizations.) The program does its best to avoid cutting words at the end of lines,
+but it could still happen in case of long words. Given the limited set of characters handled, the program is mostly
+limited to simple text documents. Thus, if you try for example: You will not get something that looks like C code. (but you can still
+try, if you are curious. :) Defining an environment variable called The program will run much faster but the rendering will be less
+precise. I saved the best for last: usually, programs that handle an
+“interactive mode” have to check whether their standard input is a
+terminal or not (by using This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/endoh1/index.html Authors: NOTE: this program requires the tool Then connect to http://localhost:10333 with your browser. How did
+the leopard get its spots? Why are a zebra’s stripes
+unique? In case you didn’t recognise the portrait of Alan Turing, there
+are some pointers to his features like eyes with “ What does “Alan
+Turing” remind you of? Cryptanalysis of
+the Enigma
+machine? Turing machine?
+Turing test?
+This program is also based on his work. Compile the program as follows: Then, run it with the Finally, open This is a simulator of reaction-diffusion
+systems. Reaction-diffusion systems, proposed by Alan Turing in 1,
+are mathematical models in which two chemical substances are transformed
+into each other (local chemical reactions) and spread out
+(diffusion). Their interactions sometimes form non-trivial
+patterns, such as spots, spiral, dappling, and labyrinths. The systems are generally formulated as follows: The functions See the
+Wikipedia article of “Reaction-diffusion system” in detail. This program simulates the systems. The field consists of 128 x 128
+cells. Each cell includes information of an amount of the two
+substances, and interacts with neighbor cells (in terms of von
+Neumann neighborhood) in each frame. You can change the model, initial pattern, simulation speed, and
+color via macro definition. The definitions represent the equations of reaction-diffusion system.
+For example, the following is the
+Gray-Scott model in TeX notation. You can specify this model as follows: The definitions specifies the initial amount of the two substances
+ You can specify a pattern file when the executable is invoked (not
+compile-time). The file should include a sequence of points, see ioccc.txt, center.txt, or
+line.txt as examples. Each amount in cells near
+to the point included in the file, will be added by
+ The definitions are for changing the simulation speed. This specifies a color used for rendering. Some interesting parameters are included in These examples are created by drawing (and modifying) the pattern
+files of Ready, a
+cross-platform implementation of various reaction-diffusion systems 2. This program compiles clean with no warnings under
+ You must use a modern browser that supports the latest specification
+of WebSocket 3. All the following browsers worked
+for me: I think Safari 6 will work but I haven’t tested. (I have no recent
+macOS.) NOTE from the judges in 2023: recent versions of Safari also
+work. I think you may use But note that I didn’t test well. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ Turing, A. M., “The Chemical Basis of Morphogenesis”,
+Philosophical Transactions of the Royal Society, 1952.↩︎ The Ready Bunch, “Ready”, A cross-platform
+implementation of various reaction-diffusion systems, since 2011, https://github.com/GollyGang/ready.↩︎ Fette, I. and A. Melnikov, “The WebSocket Protocol”, RFC
+6455, DOI 10.17487/RFC6455, December 2011, http://www.rfc-editor.org/info/rfc6455.↩︎ Eastlake 3rd, D. and P. Jones, “US Secure Hash Algorithm
+1 (SHA1)”, RFC 3174, DOI 10.17487/RFC3174, September 2001, http://www.rfc-editor.org/info/rfc3174.↩︎ Josefsson, S., “The Base16, Base32, and Base64 Data
+Encodings”, RFC 4648, DOI 10.17487/RFC4648, October 2006, http://www.rfc-editor.org/info/rfc4648.↩︎ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/endoh2/index.html Author: At this point you might be wondering, WTF?* What The Freak (polite form) What’s This For? (you may be wondering) What the Fish (python form) How is this code obfuscated? Well look again: Where did those underscores come from? Well RTFS!** ** Read the Freaking Source (polite form) ** Read The Freaking Screen
+(polite form) If you are still puzzled, look at prog.c with
+your favorite text editor. Follow these instructions literally! You will do a double take. Hint 1: Do Hint 2: Do Spoiler: Open the source with an editor like This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/endoh3/index.html Author: To see the original mullender in
+action: Observe what happens when you hit enter or another character! You
+might even try typing out, one character at a time,
+ More generally use: to compile and run Like Marty
+and Doc,
+something nostalgic from 1984 appears live in October of 2015! The author of this gem is a true DeLorean! A question for inquisitive readers: is the implemented subset of
+PDP-11 instructions Turing-complete?
+(For a clue, see the end of the author’s remarks.) If in doubt, use APOUT. This program is a joke PDP-11 emulator. (“ll-dpd” is embedded in the
+code. Read it upside down.) You got it? This program is supposed to be used in this way: You can enjoy the legendary winner of the first IOCCC, again. This program uses It supports the minimal subset of instructions and addressing modes
+which are needed for mullender.c to work: Non-trivial combination of instruction and addressing mode may cause
+undefined behavior (unsequenced modification), such as attempting to
+auto-increment a destination register. Index addressing mode works well
+only for R7 (PC register). Note: this program writes a binary file to This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/endoh4/index.html Author: There is an alt version which is the originally submitted entry. See
+Alternate code below for details. An alternate version of this entry, prog.alt.c, is provided. This alternate code does
+not contain improvements suggested by Gil Dogon; it is the author’s
+original entry. Use For this one liner it is best to avoid prime numbers. The output
+groups factors in the x-y dimensions. How many factors can be
+represented before you run out of command line argument space? How could
+you modify the program to experiment with numbers that have more or
+larger factors? Visual factorization 1-liner. Try: Inspired by Animated
+Factorization Diagrams. prog.alt.c is the original version that I
+submitted. Gil Dogon kindly
+improved it during the review. Thank you! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/hou/index.html Author: The current status of this entry is: For more detailed information see 2015
+hou in bugs.md. A good start for understanding this entry might be rfc1321.txt. How does it compute this using only
+a single looping construct? The original reference source code for this
+algorithm is about 355 lines of code, yet this entry is only 199 lines
+with one statement per line and it isn’t using lots of macro expansion
+tricks like the reference code! Some things that make you go, “huh?” How are those values magically returned? What happens with a large file? Something over 256K. Where does that message come from? This looks like a normal C program. Almost everything is a There are tell-tale signs like It looks like a ????? ???????????, right? Run and find out. Some poor scripting folks only have access to doubles (Jav?script,
+L?a, BA?IC, etc.). As a C programmer, I feel obliged to show a gesture of sympathy, to
+experience their pain and provide an answer. Except when absolutely necessary ( Since Hard requirements: The platform must implement the The program must start with the CPU / FPU in round-to-nearest
+mode. Soft requirements: The compiler must respect The printed result is only correct on little-endian machines. The
+program takes care to warn about this issue after printing an incorrect
+big-endian result. Error messages become garbled, though. Tested platforms: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/howe/index.html Author: There is an alternate version provided. See Alternate code below. This alternate version does not use a 64-bit FNV hash. This was the
+original entry but was changed to be the alt version. Use This is the best use of the FNV that we have seen in the IOCCC so
+far! The output, when used without We welcome back Canada to the list of nations from where winning
+entries have been submitted. Is this code a bug or a feature? :-) Or is this an attempt to corrupt
+the programming of our youth? Should we heed Kyle’s mom words that she
+uttered during a South Park P.T.A. Meeting? “We must stop dirty (C) language from getting to our children’s
+ears!” Or should we teach our youth to understand the intricacies of this
+code? Ying Tong Iddle I Po! We suggest you read the source for yourself,
+which might be easier than the academic papers it was inspired by. NOTE: Unlike the original entry source, prog.alt.c, prog.c uses a 64
+bit FNV hash and fixes a function call warning. “An O(NP) Sequence Comparison Algorithm” by Wu, Manber, Myers,
+Miller. Output compatible with Strokes one of the judge’s ego (I couldn’t email chocolate or
+curry). This is a functioning micro The The FNV1a hash is a little slow compared to the trivial hash GNU diff uses. I
+downloaded a plain text copy of “War And Peace” from Project Gutenberg, used makeholes.c to make 1000 random changes, then
+profiled and timed the program verses GNU There is no hash collision checking, partly because FNV1a appears to
+generate very few
+collisions and an assumption that localised collisions within a
+region of edits are highly unlikely. prog-test.sh Basic test program
+verifies known test edit distances and makeholes.c Random edits (holes) made
+to a file in-place. Wu, Manber, Myers, and Miller; August 1989; Fowler, Noll, Vo; 1994 Fowler, Noll, Vo on Wikipedia “diff”, The Open Group Base Specifications Issue 7 Eugene W. Myers; “An O(ND) Difference Algorithm and Its
+Variations”; Webb Miller and Eugene W. Myers; “A File Comparison Program”; D.S. Hirschberg, “A linear space algorithm for computing maximal
+common subsequence problem”; Which hashing algorithm is best for uniqueness and speed? This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/mills1/index.html Author: Press the up arrow and the down arrow at the right time. Did you find that mobile application game a bit frustrating? Well you
+can adjust the Makefile parameters to make life a bit easier for
+you: which runs: From the Makefile: WARNING: if you have good eye-hand coordination and too much time on
+your hands you might fall asleep while playing as you probably will
+never die in this mode. We only stopped when a reminder came through and
+we tried to mark it complete at the same time as playing and we almost
+managed to survive that. At that point we already scored over 90. Enjoy! Better late than never to jump on the bandwagon of 2014’s most
+successful mobile game. The game is called Tappy Bird, and has all the
+sophisticated gameplay of the original, except with an exciting twist!
+(you get to fly to the right instead of to the left). In addition, the game features exciting new customization options!
+Too hard? Ran into that damn wall too many times? Now you can change
+physics! Change any of a number of parameters (speed, gravity, etc.) of
+the game to suit your gameplay! You can even make the game more challenging – resize the terminal
+window to make the world taller or shorter. You’ll never be able to get
+through the pipes when they are four times as tall! The instructions are printed at the start of the game: Tap to
+Flap! Hit any key to make your bird fly. Navigate her between the gaps in
+the pipes. Your score is shown in the upper left, along with your
+current high-score. To customize the gameplay, change any of the following options on the
+compile command line: Feel free to try out physics or play field options to make the game
+more interesting. Try setting the player sprites to change the game
+completely – maybe you can be a fish, or a pig – the options are
+limitless! Try using emojis – you can be a flying beer mug! Note that since the or for some examples (the full list of options is in the
+ You will also need a UTF-8 compatible terminal and an emoji font
+installed, and you will need to have your Future versions of the game will include monetization via the
+freemium model with micropayments for customization options, play-to-win
+and of course live-streamed targeted video advertising. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/mills2/index.html Author: The current status of this entry is: For more detailed information see 2015
+mills2 in bugs.md. Without ASCII art, the source code of this entry would have been
+exactly 256 bytes. Compared to 1990/jaw, it is very
+impressive, even taking into account the missing Why is the sad smiley on line 12 in that particular place? This program is an implementation of the unix The adaptive LZW
+compression employed by To run the program, take an existing compressed file and pass it to
+the program on the command line. On the odd chance you don’t have
+ The basic cleverness here comes from realizing that the compressed
+data is itself an encoded version of the code dictionary. When the
+encoder sees an input string that is not in its dictionary, it emits the
+code corresponding to the longest prefix that is in the dictionary and
+adds a new entry consisting of that code followed by the next input
+character. This means that when the decoder wants to know how to decode
+a code, it just needs to find the spot in the code-stream where the
+encoder added that entry to the dictionary. The code at that spot is the
+prefix, and the first character of the following code is the suffix.
+Decoding then just becomes recursion, to follow the chain of prefixes
+and suffix characters. Of course, it’s not nearly that simple. Finding the code in the
+stream is complicated by several issues: Managing all the details involved added a lovely additional layer of
+obfuscation to the otherwise elegant recursive decoder. Still, the code
+manages it in a remarkably small amount of code. The decoder doesn’t look at the header. If you supply something that
+is not compressed data, it’s likely to crash in an interesting
+manner. In particular, it doesn’t look at the third byte of the header, which
+encodes the maximum code word size and whether “block mode” was used
+when the encoder was run. If you use In the event that you don’t supply an argument, or that argument
+doesn’t name a readable file, the program will just silently exit. This
+is a feature. The program depends on having a little-endian system. On a big-endian
+system you will get a weird big-endian version of
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/muth/index.html Author: This is something we were fearing all along: that the C preprocessor
+is Turing-complete even without conditionals and recursive file
+inclusion as some kind of a rewriting system. Now
+we have the proof! If the machine does not halt after M( If Implementing your own Turing machine is easy. Take a look at the
+supplied header files for examples. Every symbol used (except Example: The initial content of the tape must be defined in the tape header
+using a triple like: The empty pairs All transitions are defined in the machine header using the
+syntax where There must be a state To halt the machine, use the keyword This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/schweikhardt/index.html Author: The current status of this entry is: For more detailed information see 2015 schweikhardt in bugs.md. where n is a base 16 number of any size. NOTE: although it’s supposed to be a base 16 number nothing will stop
+you from doing something else. The author explains this in more
+details. After running it once to see what commands are run, you might wish to
+run it a second time and just hold down space to see a fun scroll of
+numbers especially where zeroes move to the right. This code is clean. When you compile with all warnings enabled, such
+as with clang: The code compiles without warnings on the systems that we tested! Even more, the code was 100% clean when we ran it against various
+static source checkers. This tool references a problem that David I. Bell once
+described as having one of the largest “yummo quotients” in number
+theory: Erdős
+privately told one of the IOCCC judges: Solving the Generalized
+Riemann hypothesis would be a good warm-up exercise for someone to
+get ready to begin to work on the Collatz
+conjecture. You may explore this famous conjecture using this entry: NOTE: try.sh runs these for you, filtered
+through When you first look at the source, the code looks fairly
+straightforward. But look again. Like the Collatz conjecture, simplicity
+is deceptive! Oh, and the variable names? They are not simple single
+letter variables, they are names of various Proteinogenic
+amino acid: which is yet another simple building block that can be
+used to build some very complex structures. :-) p.s. We appreciated that apart from a few powers of 2, the source
+code is magic number free. This is the cleanest program ever submitted. If for some input it
+enters a non-terminating loop or runs out of memory you will be
+insta-famous. It’s a bit like a lottery without the need to buy a ticket
+and you can play as often as you like. One notable historic person has
+even offered some prize money. The program illustrates the bloat caused by adherence to too many
+rules, each of which may sound sane in isolation, but in their entirety
+lead to an obfuscated, hard to read and understand monster. The program tests whether a given natural number satisfies the Collatz
+Conjecture: Take any natural number The conjecture is that no matter what number you start with, you
+eventually reach Paul Erdős said about the Collatz conjecture: “Mathematics may not be ready for such problems.” He also offered $500 for its solution. For example, the sequence of numbers for 6, 3, 10, 5, 16, 8, 4, 2, 1. Continuing past one leads to the cycle 1, 4, 2, 1, 4, 2, 1,
+… Interesting factoid: if you allow negative start values,
+there are a few more cycles, each of different length: The program computes the sequence for a given positive natural number
+and stops at The size of which reports the limit in bytes, here 256KB. This allows to test
+whether a Googol,
+which is 10100, satisfies the conjecture. But what is a
+googol in hex? Fear not, bc(1)
+to the rescue: Observe how the first 100 iterations melt the zeros to the right. Can
+you explain why? For a given I gave myself the following objectives. Like in real world
+programming, not all of them can be met 100%. Think of them as a
+multidimensional continuum, where trade-offs have to be made. In the following I address all the tests as specified by
+your honors in the guidelines. Using one letter identifiers is quite old. I decided to use TLI
+(three letter identifiers). Not the random kind, rather with a
+connection to the meaning of life, the universe and the rest. Enter
+amino acids! Among the myriad of possible amino acids there are 23 from
+which proteins are built. In biochemistry, each is assigned a TLI (see
+Proteinogenic
+amino acid): My own research results complete this list (not yet in Wikipedia due
+to the rule “No
+original research”): Interestingly, the TLI are the perfect mnemonics for C language
+source. For example, Huh??! Wow, an identity operation (except for the
+ Another identity operation. I’ve done it for you already. Use this
+ It looks like a perfect program should have: The program contains not a single magic number (only 0 and
+powers of 2, each power from 1 to 512) which are obvious to competent
+software engineers). How many programs have that property? The
+check for Spoilers ahead. Duh! Pseudocode, with comments matching those in the C source: Here’s where the program shines brighter than a gamma-ray
+burst! I challenge you to throw all kinds of compilers, lints, checkers and
+analyzers at my program and make it find the slightest of issues. Is
+ May you win the jackpot! For least surprising results, the execution character set should be
+ASCII. The program computes four bits from every character in
+ This means however, that the program accepts any
+string, turns it into a starting number (which is output as the
+first line), and starts crunching. Nothing stops you from executing In a certain way, the program is character set and encoding
+agnostic. While the program works best when bytes/characters are octets and the
+number of bits in a type is The open source static checker cppcheck checks various
+problems with respect to style, performance, portability and general
+fishiness. To enable all checks, run No issues found. The open source static checker flawfinder checks various
+problems with respect to security like buffer overflows, function
+arguments to known troublemaker functions and more. It doesn’t need to
+pre-process code, so can be run without the The open source dynamic checker valgrind runs an executable and verifies
+all memory accesses and (de)allocations for proper bounds and memory
+leaks. Since the program frees all memory in all possible execution
+paths, even when it must bail out, valgrind should be happy. An early
+version of my program however reported this: From which I concluded that Whether or not the call succeeds, the stream is disassociated from
+the file and any buffer set by the So I A squeaky clean valgrind result! FlexeLint is a commercial lint tool by Gimpel Software. It
+supports nearly a thousand checks, broadly categorized into 4
+levels, There is an on-line
+demonstrator you can use for checking your C programs and I highly
+recommend trying it. For a start, paste the well know first program in
+the form and press “Analyze Code”. Note the FlexeLint configuration
+options in comments (no space between Possible checks include those for MISRA 2004 compliance verification.
+The Motor
+Industry Software Reliability Association has produced a list of
+121 required and 20 advisory rules for C programming. I am proud to
+report that my program fulfills almost all rules. To assess the
+few exceptions, one has to understand that MISRA rules are geared
+towards embedded systems used in the automotive industry. That’s why
+features like I started out with enabling all messages using
+ Which of the rules cause which obfuscation? MISRA 6.1: “The plain because of the “no magic numbers other than powers of two” rule. How
+is this an improvement over
+ MISRA 6.3: “ MISRA 10.5: “If the bitwise operators MISRA 12.1: “Limited dependence should be placed on the C operator
+precedence rules in expressions.” This requires parentheses for almost
+all expressions involving more than one operator, especially those for
+which a cast is required, leading to hard to understand expressions such
+as MISRA 14.7: “A function shall have a single point of exit at the end
+of the function.” Sigh. Since I must use eloquent prototypes (8.1, 16.3,
+16.4) and static functions (8.10, 8.11), I can only use a few functions.
+Everything usually written with an early MISRA 16.10: “If a function returns error information, then that
+error information shall be tested.” A cast to which are, in the absence of errors, equivalent to MISRA 13.1: “Assignment operators shall not be used in expressions
+that yield a Boolean value.” Forbids the idiomatic
+ MISRA 16.7: “A pointer parameter in a function prototype should be
+declared as pointer to and quite a number of automatic variables. The guidelines state “We like programs that: make us laugh and/or
+throw up :-) (humor really helps!)” If your compiler supports a 128 bit wide type (e.g. clang, gcc) then
+you can use it via the Indeed, the program can use (and lints clean for) all of This works because the program has no need for corresponding
+ The number of hex digits in the start number is limited by
+ The algorithm requires two How long would it take to overflow the Not Overflowing Type?
+Lets assume we’re processing 2GB numbers. The program copies, shifts by
+one, adds and increments 2GB long bit strings, each time completely
+thrashing the data cache – at all levels. We have a fast
+machine that can do an iteration in one second, on average. To make
+things easy, we round up For all intents and purposes, the Not Overflowing Type keeps
+the promise! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2015/yang/index.html Author: Before analysing the code in detail we were able to guess two out of
+four tests this entry uses to tell the 5 languages/flavors apart. Can
+you find all four? The way the text is encoded in the output doesn’t cease to amaze. Can
+you tell why an array of 512 elements is needed? NOTE: the author calls the program If you compile with a C99 compiler instead of C90, the sea stars will
+have eyes. Don’t like sea
+stars? Use a C++98 compiler to get a dango instead. Don’t like dango
+either? Use a C++11 compiler to get just circles (or Swiss
+cheese, if you prefer that). Don’t like any of these patterns? Use a C11 compiler and there will
+be no extra pattern. Regardless of which of these C/C++ dialects you choose, the output
+will all be valid C90 code that reproduces original input on
+ Next time people ask you for a few pointers on C, you can run their
+question through The most obscure parts are in detecting the subtle differences in
+different dialects. The standard committees put a lot of effort into
+avoiding “quiet changes”, but Output patterns are usually random (except for C11). The built-in
+random number generator is seeded using ASLR.
+On systems where ASLR is not so random (such as cygwin), you can
+introduce randomness by changing number of command line arguments to
+ Output is somewhat robust: corruption on most of the lines will
+usually result in a compiler warning. This is because the output is
+vastly redundant: For ~1K of input, expect output to be on the order of
+~1MB, and take ~500MB of RAM to compile. CRC32
+of source code is embedded in the source code itself. The process of writing this program can be seen by opening spoiler.html in a browser that supports
+JavaScript. Code layout is inspired by Ibuki Fuuko, for
+her love of sea stars. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/algmyr/index.html Author: To use this entry requires, in some invocations, a sound processing
+program. This can be ALSA or SoX but we recommend the latter. See FAQ 3.10 - How do I compile and use an IOCCC
+winner that requires sound?. The current status of this entry is: For more detailed information see 2018
+algmyr in bugs.md. Be warned, this is not your garden variety text-to-speech program!
+Earplugs are advised, or at least a handy and well-tested volume
+knob. Pixels are numbered, amplitudes are weighed, frequencies are divided,
+and the message can be displayed in fiery letters, but don’t be
+alarmed. How does decoding of the waveform work? Can you encode an arbitrary
+text in a sound sample? To put it brief, this entry is akin to a sound based cat. It takes
+characters as input and outputs them into frequency space as audio. The
+entry also supports decoding the produced waveforms using the
+ In normal operation, the entry reads characters from one or more
+sources. If the If a character is part of the supported subset of ASCII
+ Characters are printed using a (slightly modified) pixel font based
+on gohufont. Pixels
+are drawn using crosses in frequency space, achieved by simultaneous up
+and down chirps. Each input source is designated its own channel in the output (one
+float per channel per time step in the output) so if you have a surround
+sound system you could listen to a cacophony of chirpy characters. Interestingly, with training you might actually be able to tell
+characters just from hearing. But even without training you can easily
+read along with the printed characters and have the sound make sense
+with the look of the characters. See image spoiler.png for an example
+spectrogram. There is no error checking done when opening files, so expect
+segfaults if you provide the wrong path to a file. This program is bound to misbehave if Flags will only be interpreted correctly if they are the first
+argument. Reading a file named Providing invalid/unexpected arguments to the decode flag will result
+in odd behavior. Some erroneous arguments cause segfaults (negative
+number of channels, channel id outside valid range). One argument in
+particular causes an infinite loop printing whitespace. A lot of the obfuscations done came naturally from trying to appease
+the size tool. To name some: On the intersection of size and obfuscation is the data encoding,
+which was quite fun to design. Some additional obfuscation was done to mathematical formulas.
+Somewhat known expressions were transformed into equivalent but less
+recognizable counterparts. I have tried to avoid intentional red herrings in the code, although
+fishy statements are plentiful. The large string in the beginning of the source file contains font
+data, encoded in base64 using characters in the range Characters in the font (5x8 pixels, 40 bits) are packed into 7 base64
+digits (which was a pain to decode in minimal code). Note that even though A critical issue encountered was that having abrupt starts and ends
+of signals cause a lot of problems with spectral leakage which makes
+spectrograms hard to read and audio painful to listen to. To reduce
+spectral leakage a windowing function was used. Although the one used is
+quite well known, it is not in a form that should be familiar to anyone.
+What looks like a polynomial and quacks like a polynomial might not
+actually be a polynomial, at least not deep inside. The program was written to deal exclusively with file descriptors, so
+how would one go about printing a Compiling using gives only is a bit more pessimistic and gives produces a few page faults of warnings and makes me feel generally
+bad about myself. :( The reported size of the source code using the size tool is very
+intentionally 2018. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/anderson/index.html Author: There is an alternate version of this entry. See Alternate code below for more details. Compare prog.c and prog.alt.c and find out why we had to modify the
+entry, and what confused the author (see the author’s remarks). No, it
+was not the shape of the Roman V that we, or the compiler, didn’t
+like. Use With this entry, you won’t need to turn your monitor upside
+down! Also works with a standard of C99, but C90/C89 will not compile due
+to This small program, when given text on In its current form, this program can handle lines of length 255; to
+adjust this limit, change the variable In developing this program, the author found a potentially
+interesting bug. If the expression The structure of this program, as you may have deduced, is two
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/bellard/index.html Author: There is an alternate version that should work with Windows. See Alternate code below. NOTE: NOTE: Lenna.png is from https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png. The prog.alt.c is based on the author’s
+remarks and it should work for Windows. Use The file Compressing images is just a matter of simple arithmetic and some
+magic, isn’t it? We could understand some of the arithmetic but none of the magic. Deciphering the mechanism used for data encoding to make use of
+whitespace, braces and semicolons should be a slightly easier task. Warning: the program is not protected against invalid input. This program outputs a 128x128 RGB image file to the standard output
+using the portable pixmap file format (PPM). It contains the famous
+“Lena” image which is used in many image compression tests. The uncompressed image is 12 times larger than the source code of the
+program which includes the image data and the complete decoder. The
+actual image data is 1220 byte long, which gives a compression ratio of
+40. Using a JPEG-like algorithm would not be enough to reach this level
+of compression (the Lena image would be barely recognizable). So the
+algorithm is based on the latest advances in image compression. It
+includes the following features: The image data is encoded to a C string with some tricks to make the
+best use of the IOCCC size constraints. The identifiers were shortened
+to a single letter to save space. No specific obfuscation was needed as
+the algorithms already have a significant complexity. Although the program was optimized to decompress its built-in image,
+it accepts to decompress image files from its standard input.
+Examples: The original images for fruits
+and vintage
+cars come from Wikipedia and were resized to a width of 1024
+pixels. The program should be portable on any Unix system. On Windows the
+line This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/burton1/index.html Author: There is an alternate version of this entry. See Alternate code below. An alternate version of this entry, prog.alt.c, is provided This alternate code was
+supposed to compile without warnings, however with modern compilers this
+is no longer the case so it will only cleanly compile with
+ Use One line, one array, one loop and one statement but it prints many
+bytes. It won. Feed this anything on The included script.sh may be used as a
+driver program for this entry. It adds several nice-to-have features,
+and allows salt-to-taste customizability. This code has been compiled and tested on: This started life as a personal challenge: write the shortest hex
+dump utility in C. The self-imposed ground rules in the hunt for shortest: E.g: is not acceptable. And, “output correctly” is the output format of this entry. QED. Early attempts ended up at a reasonably short 157 characters. This
+was too long for a one-liner, so it had to be formatted as something
+more interesting. This solution is pleasing, but a true one-liner was
+the hoped-for goal. Here is the 157 character version in it’s
+entirety: While thinking about this in the shower (you are not the only one
+that does this!) came the idea which reduced the code to just 119 chars.
+This dramatic reduction started to feel close to minimal, and the hunt
+resumed. The progression to the present size is interesting, and it is
+interesting that the same algorithm can be expressed so differently by
+slight rearrangement of its parts. There are solutions without the ASCII sidebar that are significantly
+shorter. These do not compete in the same category, since their output
+is materially different. They are derived from the solutions above, but
+are still fascinating as concise utilities, so here is their
+progression, for the curious: It is possible to reduce the size of each of these by one by eliding
+the trailing newline. This was not reported above since the newline kept
+getting appended by processing software, and it is more interesting to
+remove characters by changing code than by filtering: An obfuscated hex dump has been done before: 1986/bright is similar in function,
+but it uses more characters in just setting up its obfuscation than this
+entire solution! If you are unhappy with the way DEL (character 127) is handled,
+replace the cryptic expression Technically, But how does this work at all, even as an extension? The 1979 Seventh
+Edition UNIX (v7) system pre-dates the IOCCC by several years, and
+the source code to More significant is that v7 Interesting digression: v7 By the way, there is no entirely satisfactory way to write a portable
+function that accepts a variable number of arguments, because there is
+no portable way for the called function to determine how many arguments
+where actually passed to it in a given call. … It is fascinating to explore the roots of C through the history of
+the operating system it was birthed within. C is often criticized as a
+difficult, inscrutable language, but as this contest demonstrates, this
+is in parody. Shell-gol is one of those instances where someone
+preferred a different
+language, and (ab)used the preprocessor to re-mold C into something
+they found comfortable. Most of the rest of the system, especially in
+the kernel, are models of clarity and efficient expression. So which version is the shortest, portable hex dump? Clearly, the smallest possible program violates modern best practice.
+It is not even possible to compile cleanly, but it will compile
+correctly. Included is prog.alt.c, a modern C
+implementation that is – perhaps – the smallest, clean-compiling version
+using Try: or to compare the differences ( This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/burton2/index.html Author: If you get really stuck, try: They say size isn’t everything, and in the case of IOCCC iocccsize.c that is
+saying something! What is this program weighing and how much does it
+weigh? It tries quite hard to act the same It does far more than print the size: Included is a keyword sorter, But first you have to figure out The rest of it is standard fare: The keyword list was made external, I hope you find this code obscure The token-based output is quite useful in analyzing source code (see
+below), and the counter is more accurate than The following bugs are always corrected: There is one (known) remaining problem with detection: Fixing this properly hampers backwards compatibility in counting.
+This requires eliding comments during the translation phases (ISO
+5.1.1.2, phase 3), and yet still counting words correctly absent
+ The discrepancies found are documented and explained in the file discrepancies.md. In summary, there are only 6 unique entries out of 366 that have any
+variation in Rule 2 counts; in all cases, the differences are due to
+bugs within This (minor) variation in word count values has not been addressed
+since it is not a qualifying metric, nor is it very useful in a
+programming context: whitespace surrounds English words, not necessarily
+C tokens, as in Accuracy (versus compatibility) is demonstrated through a series of
+small test cases designed to allow exhaustive, hand-counted values for
+comparison with the tool values. These test cases were vital in
+debugging and regression testing, and provided a way to determine which
+tool was correct when there were differences. A version of this tool in more clearly written C (tac.c) is presented for the Judge’s consideration as a
+more accurate replacement for NB: There is no limit on line length, file length, comment length, or
+identifier length. For instance, here is a simple token counter, useful in finding
+repeated long tokens, or operator frequency, or counting the references
+to identifiers, constants, or breadth of use of the language: And here is a C keyword frequency counter: This script was used to “optimize” the reserved word order so the
+most frequent IOCCC winning entry keywords are checked first. An interesting aside: as might be expected, obfuscation has changed
+the frequency of keyword distribution over time. The top five for the
+decades: The keyword list is external to the program, and is easily changed,
+sorted, checked, verified. This allows such additional programs in
+concert with the tool’s primary operation. A poor-man’s de-obfuscator can be based upon the output of
+ I assume you noticed the braces? Every brace is sacred, Keywords follow the 2010s top five, without the Sometimes a I see the No character constants, several Interesting aside: how many is “several ./prog < prog.c 2>/dev/null | awk ‘$1~/260/{a[$2]++}END{for(i
+in a)print i,a[i]}’ … | wc Which numbers are most often used? The code describes its function by careful arrangement of
+variables up front… …coupled with a description of the typical IOCCC contestant, or
+at least the author Why shouldn’t trigraph parsing be written in trigraph? Where iocccsize.c mocks, this
+code flaunts: “no matter how well you may think you understand this
+code, you don’t, so don’t mess with it. :-)” Globals are used to pass information between routines: don’t
+reorder “unrelated” statements…. How does the compatibility mode account for the fundamentally
+different manner of computation? The algorithm is quite efficient; reserved word detection and
+trigraph parsing particularly so. This may be the first obfuscated submission that provides the
+means for its own de-obfuscation. The keyword list is externalized as an include file. This presents a
+useful feature for the source code: not only can the reserved word
+script above be produced, but the tool can be rebuilt with any set of
+reserved words, just by using a different list. For instance: removing
+all the secondary keywords; removing all the C11 keywords; trying just
+K&R C. Since C++ and Java share the same operators as C, just change
+the keyword list and I believe this entry may also satisfy the request for gratuitous use
+of all the C11 keywords? Whether this context satisfies “intended C
+language context” is a matter of interpretation. ;-) And
+ The following reserved word files are included: NB: The keyword file used in this code is derived from the list in iocccsize.c, which is
+neither complete ( That is an obfuscated way to say “diff”. But it also more clearly
+shows the, um, diffs. The usage string is similarly externalized, providing a better
+usability string than the limits would otherwise allow. If this is
+considered bending the rules too far, just There is definitely abuse of the Rule2 counter, exploiting a
+“feature” of The code is ANSI compliant, but it does have a string longer than 509
+characters. It has been tested on OSX and Linux, Clang and GCC. The code uses trigraphs, ironically: it parses trigraphs with
+trigraph code. Because that’s funny. And it remains obscure after, so
+trigraphs are not used for obfuscation. Thus
+ It’s obfuscated C. Thus
+ The code uses Thus: Cody Boone Ferguson
+was relentless in his pursuit of bugs. Thanks to his reports, the
+version of unob.sh is stronger, manpage.sh is a useful program that turns
+ASCII versions of man pages (e.g. tac.man) into
+real man pages. It works for C and C-like languages, command lines, and
+was designed to handle man page sections 1-8. It works well on most
+inputs, but tends to need some raw nroff for more fancy constructions,
+such as combined arguments (e.g. the Try: NOTE: in 2023 the This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/ciura/index.html Author: There is an alternate version that lacks a useful bug fix. See Alternate code and the author’s remarks (remarks section) below for more details. An alternate version of this entry, prog.alt.c, is provided. As mentioned in the
+author’s remarks, the alternate version lacks a
+useful bug fix. Use This text was processed by “The Elements of Style” by Prof. William Strunk, Jr. and E. B. White
+is well known for its dislike of the passive voice. Direct, vigorous,
+active constructions were instead recommended by the authors. The
+development of this program has been driven by this tenet. Only passive sentences from the standard input are output. The
+offending part(s) of each sentence will be highlighted. Several kinds of
+passive constructions are recognized: Sentences are never broken by periods that follow abbreviations and
+initials. Both regular and irregular past participles are properly dealt
+with. Note that some words are red herrings: even though their ending is
+ Here is the purpose of every byte inside the I heard you don’t like state machines so I put a state machine in
+your state machine so you can reject this entry while you reject this
+entry. Both types of state machines in the program are Mealy machines: we
+can think of their transitions as triples
+( A state of type A state machine consists of eight transitions whose
+representations occupy consecutive bytes. The byte
+ The or one of word classes: The or one of Type A state machines run continuously. Their state is kept in
+ Below are sample steps of scanning a sequence of characters with
+classes And here are sample steps of scanning tokens with classes
+ Type B state machines are built by a variant of the algorithm
+described in the paper How to squeeze a lexicon
+(PDF). Their states are represented as interlaced sparse arrays of
+transitions. The The or The byte The byte The byte The byte A type B state machine starts in a given It also returns when
+ Below are sample steps of scanning the word “chiefly”. And here are sample steps of scanning the string “i.e.”: The judges found a bug in the handling of contractions: prog.alt.c outputs “foo wasn’[t
+bazzed]”. I fixed the bug in prog.c,
+making it output “foo [wasn’t bazzed]” instead, and
+took the liberty to merge one statement into a The program uses a 9,437,187-byte buffer so it probably will not run
+on 16-bit and smaller machines without changing the size of array
+ I have tested it on: For a clean compile under C89 and C90, add
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/endoh1/index.html Author: To see the input files and feed them to the program, redirecting to
+GIF files: To get the best experience, use a GIF viewer that can handle animated
+GIFs. With macOS you can use Safari using
+ Some things to consider are that this 2.5KiB gem encodes a 96
+character 8x8 font (naively this could already take 6144 bytes) and a
+GIF encoder. But how does it know which characters are closed? You should only give this program printable ASCII characters. Unfortunately this won’t run on your PDP8, if you had one, as it
+needs at least 2MiB of memory to run in. This program generates an animated GIF from a plain text. Run: Open Other examples: The program itself has a hidden message. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/endoh2/index.html Author: NOTE: to interrupt the loops send intr (typically ctrl-C). And now for something completely different: A program whose metabolic
+processes are a matter of interest only to historians. It has kicked the
+bucket and departed to that mysterious country from whose bourne no
+traveller returns! This is an EX-tremely obfuscated program! A high-context work that combines parrots that new hackers like and
+parrots that old hackers like. One is an internet meme called Party Parrot (WARNING: has
+flashing lights). The other is a sketch comté called “Dead
+Parrot” from the British sitcom “Monty
+Python’s Flying Circus” The “Python” in the award name
+refers to Monty Python, not the [programming language
+Python](https://en.wikipedia.org/wiki/Python_(programming_language) (the
+name of the programming language Python is derived from Monty
+Python). The shape of prog.c is “Undead Parrot” based on
+“dead parrot”. The message that appears in the bottom line of the output
+source code is the subject of the dialogue that appears in “Dead Parrot”
+and explains in various expressions that the parrot died. Also, the
+second **__<-_Source_of_Parrots__** line from the bottom of http://cultofthepartyparrot.com/ (WARNING: has flashing
+lights) has a hidden URL (hidden by the parrot’s body). Although it is a boring Quine story, it is quite difficult to have 10
+parrot pictures and 10 lines of data. Only the outline data of the
+parrot picture is saved, and the body is filled in at runtime. These
+data are probably compressed with byte pair
+encoding. The parrot ASCII art below is the opening line of the Monty Python
+show. The judge’s comment “And
+now for something completely different” is also used in the
+opening. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/ferguson/index.html Author: The author provided an alternate version which has a simpler keyboard
+for the monkey Eric. See Alternate code
+below. This version has a simpler keyboard (fewer characters). The author
+wrote more about this under the keyboards
+section, briefly referred to in the what it is
+section. Use Looking back over the strata of past IOCCC entries, this program
+marks a new mutation on our understanding of sequencing of code. In
+adaptation of the modern scientific that the C language has evolved,
+this mutant of a program may stress your understanding of taxonomy of
+the C syntax tree. The phenotype of the source suggests a veritable sea of primordial
+ASCII soup. The encoded logic of the watchmaker suggests a variation of
+thought experiment formulated by Richard Dawkins: but without the need
+for feeding too many evolutionary relatives of the primate order in
+which us Homo sapiens hang from the phylogenetic tree of life. If you wish your computer to maintain one branch in the Cretaceous C
+code era, while using more Cenozoic minded code migration, read
+rpm.md. If you find yourself in an evolutionary dead end, try: SPOILER WARNING: A great deal of this document and the man
+page is full of spoilers of different types; as such I would recommend
+that you try running the judges suggested invocations as well as running
+ I was at a loss on how to present my remarks; on the one hand I
+wanted to give everything to the judges so they didn’t miss anything.
+But on the other hand I didn’t want to reveal as much publicly and many
+people don’t like to read long texts. To resolve this I think the best
+way is referencing the judges’ remarks: if you want a quick rundown of
+the entry try what they suggest and view the man page (it explains all
+the options and describes the program briefly): If that isn’t sufficient I would recommend reading this
+section (and possibly the next) where I attempt to
+give a brief explanation of the sections to make reading it easier and
+faster. In addition I want to point out a few things. If you want
+more details read this document more thoroughly (or just the sections
+that seem relevant to what you’re after). The FILES file is a quick list of files and respective
+summaries in this entry. Because several sections are quite long I have
+added a skip to link to skip to the next subsection or section at the
+beginning of each section (and subsection). What it is: This is a brief
+summary of the program; the man page is more thorough than this. How it works: Explain some of the
+basic concepts and terms of the program; if you’re familiar with genetic
+algorithms there won’t be any problem following this section but it
+might be of some value to read anyway. There is a randomised mode that
+doesn’t use a genetic algorithm; it can be triggered a number of ways
+but the Hints: Perhaps the longest part
+of this document because in it I document the keyboards, options,
+subtleties (including features that might appear to be bugs but aren’t -
+including an input error), an Easter egg spoiler and quite a few example invocations. If you’ve read the man page
+you probably don’t need this unless there is something specific you’re
+after. Obfuscation: Some of the
+techniques that might not be used. How to build: Here I describe
+briefly the constants that can be redefined
+ On the subject of Final thoughts: You might
+enjoy what I included; they’re humorous pieces by Dennis
+Ritchie and Ken Thompson themselves from the
+infamous UNIX-HATERS Handbook. Winning thoughts: What it
+means to me to win as well as some dedications and thanks. Here too I
+include a link to a website which will be dedicated to this entry beyond
+what will be published on the IOCCC website. Skip to How it works. It is an implementation of Richard Dawkins’ Weasel program
+(Wikipedia). According to Wikipedia in chapter three of his book The Blind
+Watchmaker Dawkins wrote: I don’t know who it was first pointed out that, given enough time, a
+monkey bashing away at random on a typewriter could produce all the
+works of Shakespeare. The operative phrase is, of course, given
+enough time. Let us limit the task facing our monkey somewhat.
+Suppose that he has to produce, not the complete works of Shakespeare
+but just the short sentence ‘Methinks it is like a weasel’, and we shall
+make it relatively easy by giving him a typewriter with a restricted
+keyboard, one with just the 26 (capital) letters, and a space bar. How
+long will he take to write this one little sentence? He refers to the Infinite
+Monkey Theorem (Wikipedia). As he points out the operative phrase is
+given enough time; but even if it’s extremely unlikely
+technically the probability is greater than 0. He simplified it
+for the monkey; I thought the monkey had it too easy: unlike his limited
+keyboard I have (besides space) every character in the ASCII range
+ In its simplest invocation this program will work its way (using a
+genetic algorithm) towards the solution of the string
+ Skip to Hints. Here you can find a general explanation of a genetic
+algorithm as well as a brief history. Although the link
+provides more information (including images to try and show the way they
+work) for those interested I will cite the summary: Genetic Algorithms (GAs) are adaptive heuristic search algorithm
+based on the evolutionary ideas of natural selection and genetics. As
+such they represent an intelligent exploitation of a random search used
+to solve optimization problems. Although randomised, GAs are by no means
+random, instead they exploit historical information to direct the search
+into the region of better performance within the search space. The basic
+techniques of the GAs are designed to simulate processes in natural
+systems necessary for evolution, specially those follow the principles
+first laid down by Charles Darwin of “survival of the fittest.”. Since
+in nature, competition among individuals for scanty resources results in
+the fittest individuals dominating over the weaker ones. SPOILER WARNING: Some of the below might help you follow the
+code more easily. For each generation there is a total of After determining the two parents crossover occurs: each new
+offspring inherits DNA from the parents; every character in the
+chromosome string is pseudorandomly selected from one of the parents’
+respective character. Next, based on the mutation rate, perform
+mutation of the chromosome of each offspring; in other words
+some of the characters in the chromosome will be assigned a
+pseudo-random value from the keyboard (in normal mode; in random mode
+every character will be assigned a value). Before mutation the
+offspring chromosome will be printed; after mutation it will show what
+it was mutated to (on the same output line). After the new generation
+has been sequenced the loop goes back to the top and it starts all over
+until the maximum number of generations Note that the generation is checked before the scoring takes
+place by a prefix increment equality check; when the generation is
+ Too many attempts, blaming the monkey Eric even if he isn’t typing or
+doesn’t exist. Bye. Why ‘Eric’? Because the judges stated in the 2018 guidelines that
+when there is a user input error the program should insult the pet fish
+Eric even if such a fish (no, weasels do not equate monkeys to fish but
+see below) doesn’t exist. The second to last example limitation example
+note (it’s improved in the final but this is relevant) they give is: The judges might not have a pet fish named Eric, so might want to
+state: This entry factors integers between 1 and
+2305567963945518424753102147331756070. Attempting to factor anything
+else will cause the program to insult your pet fish Eric, or in the case
+that you lack such a pet, will insult the pet that you do not have. After the final message they ask: BTW: What is so special about
+2305567963945518424753102147331756070? You tell us! The answer is this: it is the primorial prime of 97:
+the product of all prime numbers less than or equal to N; and
+the primorial prime of I was quite proud that when the next contest came the judges removed
+that question. Later 2018 and all of 2019 was difficult for me so it was
+like I won a second time for the same entry. If the generation reaches Skip to Obfuscation. I noted that there are a number of additional features and here I
+will document some of them. Skip to Options. The keyboard, as noted, has more than just the alphabet and space. To
+be precise the following characters are acceptable; it equates to this
+in C (note it includes a literal space The simpler keyboard looks like: The program makes sure that the target string only has characters the
+keyboard can actually produce but there is a certain type of input error
+that might appear to be a bug; see specifically Input Error Example. Skip to Spoilers. There are a number of options you can pass to the program besides the
+target string; some I will document here (the summary being in the man
+page). You can join options but there is a caveat with spaces and
+ Enable quiet output: This means don’t print the generation and offspring output; only
+print (some) of the options set (this is always done but wouldn’t
+usually be seen due to verbose output) and the final answer. Change the mutation rate to
+ Please note that there cannot be a space between the The third invocation will set quiet output and have no valid value to
+parse for the mutation rate and When the mutation rate is out of range it does something interesting:
+take a look at the output and compare it to the output when the range is
+valid. Can you figure out another way to trigger this? In fact there are
+two more ways (one is an option I’ve mentioned and the other one is to
+do with the number of offspring)! If you want something of a walk
+through I suggest you follow the following: Enable quiet mode and set an invalid mutation range; for example
+specify: Take a look at the first few lines. Kill the program and try
+invoking it with the following options: Look at the first few lines again and compare it to the output of
+step #1. With the default string most modern systems shouldn’t take much
+time to - given decent parameters - come to an answer here but if
+necessary kill the program. Repeat the steps only this time don’t enable quiet mode. Look at
+the offspring output. If you still don’t see what it is and want to know
+see Spoilers below. Finally any argument that doesn’t start with a If you wanted If you do one of: If you actually do want to search for a string starting with a
+ The target string will be: The string to be searched would actually be In fact it will set quiet output and set the target string to be ‘5’.
+So the mutation rate will be out of range, thus enabling that Easter
+egg, but it will likely come to an answer fairly quickly because it’s
+just a single character. A note on the parsing of the Similarly this would set quiet output, then an invalid mutation rate
+and then a mutation rate of 5: If you were instead to do one of (for example): Then it would set quiet output then see the Skip to Example Invocations. The Easter egg: Since Dawkins references the Infinite
+Monkey Theorem it simulates a monkey using a typewriter! This mode
+has the following changes: Selection is omitted; this means no sorting by fitness score
+(each offspring is initially set to be the first two in the
+list) but do pseudo-randomly select characters for every character
+in the target string; that is to say if the string is of length 28 (the
+default) then all 28 characters in each offspring of each generation
+will be assigned a pseudo-randomly positioned character in the keyboard.
+If you want to enable this specially you can use the Skip to Input Error Example. The following examples are used to demonstrate better the command
+line parsing. In order to do that though I had to first document the
+ So in this case I joined the options in the following order: Quiet output. Mutation rate 101 (out of range). Mutation rate of 5 but note that during parsing I only print invalid
+mutation rate (only after parsing do I print the final mutation rate
+whatever it ends up being); so while it appears there is a bug, showing
+mutation rate out of range three times, this is expected (given the next
+one, Mutation rate to 101: this too is out of range (this is the second
+mutation rate out of range message). The typewriter returns to
+Eric. Set mutation rate to 1. Take that typewriter away! Set mutation rate to 0; when there are no valid characters passed to
+ Finally I requested it find the string Given that it was a short string it did find the answer relatively
+quickly, even in monkey mode. Another example: In this case I also enabled quiet mode but I didn’t join the options;
+the One more example of monkey mode: Here I also requested quiet output and then explicitly requested
+that Eric the monkey types. After this I set the mutation rate to
+be 101 which would have set monkey mode (in this case only
+temporarily as I later set it to a valid number) but since I have
+also requested monkey mode that won’t matter. Then I set the string to
+ When the program prints out each iteration (I’ll give an example
+next) it goes a lot slower; this makes sense because it’s an expensive
+operation. Here are the times for the same but without quiet output
+enabled: Whereas with quiet output: Of course it isn’t only down to the printing but the point is it
+slows it down significantly. Adding an option to print every X lines
+would go over the limit ( Finally I’ll show a default example in normal output (I omit many
+lines showing instead […]). Note that the real/user/sys
+times are from the Keep in mind the way I display the generations and the fact that
+generation 0 has no parents; it is generation 1 that starts working
+towards the goal. You’ll see also (mutation) at the end
+of the line at this point (if you enable monkey mode you’ll find that it
+shows something else). The lines that only have
+ One final thing to consider is that the
+program doesn’t directly read from a file. This combined with
+the way the shell works could possibly confuse some people. Take the
+following invocations: Only the first invocation of The second invocation will search for the default string if there is
+a file or directory called The third invocation would if there exists a file The fourth invocation will also search for the default string unless
+the file doesn’t exist in which case you’d get an error like in the
+second invocation. The fifth invocation will actually search for the default string even
+with the file The final invocation will search for the default and then read from
+ What this amounts to is if you want input from a file you have to
+read from the file and pass each string to the program itself. I’ve
+included a script Try: This will essentially make sure the program is compiled and then
+do: The script will first try compiling the program (if necessary) and if
+it fails for any reason it will exit; else it will read each line in the
+file You can pass additional options directly to the script but remember
+that it stops when there are no more strings in the file - so if you
+try: The final string Because the script quotes the strings that it reads from the file if
+you were to put in the file: Skip to Obfuscation. There is a type of input error, as I said, that might appear to be a
+bug. What actually is going on though is due to a technicality on how
+spaces are printed and the fact the program does not accept spaces other
+than a literal space I showed that Skip to Beauty. The following might be some of the techniques used in this entry: Helpful and descriptive names for all variables and constants
+(like The way encapsulation? And is it executing code of any kind? It mightn’t seem
+like it isn’t encapsulation and also isn’t executing code but assuming
+it’s encapsulation and executing code is it actually nothing? And if
+it’s nothing why is it there? If it is something what is it doing? Could
+it be both? Or maybe it really isn’t nothing or nothing? :) A special C parser called Digraphs. In their simplest form it’s probably not a big deal but
+consider: some source code formatters don’t like them at all (neither,
+incidentally, does The fact the program can by default print the primorial prime of
+97 (but that default isn’t the default - except when it IS the
+default!) and yet that number isn’t seen at all. See also technique
+#7. Another usual suspect: the source is formatted in a beautiful
+design that could be described artistic; on the other hand some might
+suggest it’s just a blob of octets but I disprove this when
+discussing beauty later on in the next section. The string METHINKS IT IS LIKE A WEASEL is
+searched for by default (except when it’s not searched by default) but
+it’s nowhere to be found in the source file in that form. Why? Because
+anyone familiar with the Weasel program won’t recognise the string and
+put together what it is by looking at the source code. In case you wondered deciphering #5 won’t decipher #7 (neither will
+deciphering #7 help you decipher #5). Skip to How to build. On the subject of beauty: the judges stated in the guidelines the
+following: We want to get away from source that is simply a compact blob
+of octets. Really try to be more creative than blob
+coding. HINT! And if you’ll notice that although it might look like a compact
+blob of octets at first glance if you look throughout the file
+you’ll see two statements to set your thinking straight: NO BLOB CODING THIS IS NOT A COMPACT BLOB OF OCTETS So you see even if your eyes are trying to deceive you they’re quite
+wrong. Yes some of it might look like a blob but this is clearly false;
+as all good programmers know if something is potentially confusing
+or misleading it should be made clear in the comments! :) Skip to Compilation. These two This determines the maximum size of the target string but it
+must be at least 38; this is because
+ There is obviously a reason This is the number of offspring per generation. Anything less than 4
+will be set to 3 (that’s not a typo!) and this is part of an Easter
+egg. Be aware that depending on the size of Skip to Portability. The following options must always be passed to the
+compiler: If you want to increase the number of offspring to If you wanted to change Remember that it cannot be less than Skip to An aside on bugs. This entry requires at least C99 even if you translate digraphs. The
+program doesn’t require third-party libraries and should work on any
+Unix based system. It works on both 64-bit and 32-bit (but inevitably
+some data type sizes will be smaller and this I believe includes
+ System Version: macOS 10.13.4 (17E199) Kernel Version: Darwin
+17.5.0 Skip to Installing. Any undocumented bugs are the result of insolent monkeys tampering
+with any number of things. That includes but is not limited to running
+the program on a non-ASCII system; non little-endian; meddling with
+ Skip to Final thoughts. I have included a RPM spec file for those with a Red Hat based Linux
+distribution; see rpm.md for details (including why
+I implemented this) if for some (strange or maybe even mad) reason
+you’re interested. Skip to Winning comments. The judges suggested that making them laugh helps entries chance of
+winning. Well laughter helps everything so in case you haven’t
+seen - and even if you have seen - Dennis Ritchie’s
+anti-foreword to the ghastly UNIX-HATERS Handbook or Ken
+Thompson’s revelation that C and Unix are a hoax (at the end of that
+book) I include it below; because I agree that looking at a lot of
+twisted code must be quite difficult (though maybe not as much as if you
+were to have to look at Microsoft Windows code or code for Windows in
+any case ? :)) and these two things I think are rather amusing (in order
+of least to most): Dennis Ritchie’s Anti-Foreword: Anti-Foreword By Dennis Ritchie From: dmr@plan9.research.att.com Date: Tue, 15 Mar
+1994 00:38:07 EST Subject: anti-foreword To the contributers to this book: I have succumbed to the temptation you offered in your preface: I do
+write you off as envious malcontents and romantic keepers of memories.
+The systems you remember so fondly (TOPS-20, ITS, Multics, Lisp Machine,
+Cedar/Mesa, the Dorado) are not just out to pasture, they are
+fertilizing it from below. Your judgments are not keen, they are intoxicated by metaphor. In the
+Preface you suffer first from heat, lice, and malnourishment, then
+become prisoners in a Gulag. In Chapter 1 you are in turn infected by a
+virus, racked by drug addiction, and addled by puffiness of the
+genome. Yet your prison without coherent design continues to imprison you.
+How can this be, if it has no strong places? The rational prisoner
+exploits the weak places, creates order from chaos: instead, collectives
+like the FSF vindicate their jailers by building cells almost compatible
+with the existing ones, albeit with more features. The journalist with
+three undergraduate degrees from MIT, the researcher at Microsoft, and
+the senior scientist at Apple might volunteer a few words about the
+regulations of the prisons to which they have been transferred. Your sense of the possible is in no sense pure: sometimes you want
+the same thing you have, but wish you had done it yourselves; other
+times you want something different, but can’t seem to get people to use
+it; sometimes one wonders why you just don’t shut up and tell people to
+buy a PC with Windows or a Mac. No Gulag or lice, just a future whose
+intellectual tone and interaction style is set by Sonic the Hedgehog.
+You claim to seek progress, but you succeed mainly in whining. Here is my metaphor: your book is a pudding stuffed with apposite
+observations, many well-conceived. Like excrement, it contains enough
+undigested nuggets of nutrition to sustain life for some. But it is not
+a tasty pie: it reeks too much of contempt and of envy. Bon appetit! Yes he misspelt ‘contributors’! But then again we’re talking
+about obfuscation and since it doesn’t break his message it’s not broken
+- it’s just obfuscated albeit not very much (and it still
+‘compiles’!); and isn’t that what this contest is about? :) Ken Thompson’s ending: Creators Admit C, Unix Were Hoax FOR IMMEDIATE RELEASE In an announcement that has stunned the computer industry, Ken
+Thompson, Dennis Ritchie, and Brian Kernighan admitted that the Unix
+operating system and C programming language created by them is an
+elaborate April Fools prank kept alive for more than 20 years. Speaking
+at the recent UnixWorld Software Development Forum, Thompson revealed
+the following: “In 1969, AT&T had just terminated their work with the
+GE/AT&T Multics project. Brian and I had just started working with
+an early release of Pascal from Professor Nichlaus Wirth’s ETH labs in
+Switzerland, and we were impressed with its elegant simplicity and
+power. Dennis had just finished reading Bored of the Rings, a hilarious
+National Lampoon parody of the great Tolkien Lord of the Rings trilogy.
+As a lark, we decided to do parodies of the Multics environment and
+Pascal. Dennis and I were responsible for the operating environment. We
+looked at Multics and designed the new system to be as complex and
+cryptic as possible to maximize casual users’ frustration levels,
+calling it Unix as a parody of Multics, as well as other more risque
+allusions. “Then Dennis and Brian worked on a truly warped version of Pascal,
+called”A.” When we found others were actually trying to programs with A,
+we quickly added additional cryptic features and evolved into B, BCPL,
+and finally C. We stopped when we got a clean compile on the following
+syntax: “To think that modern programmers would try to use a language that
+allowed such a statement was beyond our comprehension! We actually
+thought of selling this to the Soviets to set their computer science
+progress back 20 or more years. Imagine our surprise when AT&T and
+other U.S. corporations actually began trying to use Unix and C! It has
+taken them 20 years to develop enough expertise to generate even
+marginally useful applications using this 1960s technological parody,
+but we are impressed with the tenacity (if not common sense) of the
+general Unix and C programmer. “In any event, Brian, Dennis, and I have been working exclusively in
+Lisp on the Apple Macintosh for the past few years and feel really
+guilty about the chaos, confusion, and truly bad programming that has
+resulted from our silly prank so long ago.” Major Unix and C vendors and customers, including AT&T,
+Microsoft, Hewlett-Packard, GTE, NCR, and DEC have refused comment at
+this time. Borland International, a leading vendor of Pascal and C
+tools, including the popular Turbo Pascal, Turbo C, and Turbo C++,
+stated they had suspected this for a number of years and would continue
+to enhance their Pascal products and halt further efforts to develop C.
+An IBM spokesman broke into uncontrolled laughter and had to postpone a
+hastily convened news conference concerning the fate of the RS/6000,
+merely stating “Workplace OS will be available Real Soon Now.” In a
+cryptic statement, Professor Wirth of the ETH Institute and father of
+the Pascal, Modula 2, and Oberon structured languages, merely stated
+that P. T. Barnum was correct. So is it a hoax about a non-hoax, a non-hoax about a hoax, a
+non-hoax about a non-hoax or is it a hoax about a hoax ? :) And if it’s
+any of those what does it mean about Unix and C? And if a hoax
+is involved what is the hoax? The pedant and Tolkienist that I
+am has to state that Tolkien didn’t consider The Lord of the
+Rings a trilogy (and he made that very clear) but that
+doesn’t take away from the humour by any stretch (if anyone wants me
+to elaborate or debate the matter do send me an email - I love Tolkien’s
+legendarium and having another person to talk about it with is more than
+welcome!). Ken suggested that there is a lack of common sense but
+since he was part of its creation I don’t think it’s a bad thing;
+on the contrary it makes all of us C programmers even more
+talented! :) I do wonder if he tested that bit of C code
+though: I feel incredibly honoured, privileged and I am extremely happy and
+proud to have won! I am more proud and happy about this than anything I
+have ever done in my life and I don’t think there can be anything else I
+can be more proud of in the future (except winning again should I find
+or think of another interesting thing to try and implement in an
+obfuscated way). Because winning is one thing; but to be included
+amongst very clever and talented veterans whom I highly respect is an
+incredible badge of honour that I will proudly wear (literally too as I
+hope to get my entry on a shirt) for the rest of my life. This type of
+badge is something I feel most only dream of but never come close to
+earning. That I did is by far the best feeling I can think of. Thank you Simon Cooper, Landon Curt Noll and Leonid A. Broukhis, and
+thank you to everyone who has been an important and special part of my
+life. I want to specially name some: I dedicated this program to my beloved but recently late dog Venus;
+instead of drowning in grief I channelled it to creativity. And to have
+won a contest requiring creativity, cleverness and novelty is a tribute
+to an equally creative, clever and unique dog that she was. I miss you
+terribly Venus but I’m so happy to have had you in my life. But I want to also dedicate it to (and thank) my dear friend Martijn Schoemaker whom provided me
+with the spark a very long time ago (and whom has stood by me and helped
+me in more ways than he can know - I would also like to give thanks and much love to my dear friend
+Vicky Wilmore who means the absolute world to me; thank you for being
+such a wonderfully beautiful person and friend - that truly is what
+‘just you’ means, sweetheart, and don’t you forget it! <3 Finally I would like to thank my mother for being the best mum anyone
+could ask for, who’s always been here for me and whom I also inherit the
+keen analytical mind from. I love you all! I want to also thank Dave Burton
+for acknowledging me in his [README.md]((../burton2/README.md) for his
+2018/burton2 entry for as he put it
+‘being relentless with pursuit of bugs’. To think that it was
+circumstantial to my entry too makes it all the more unlikely but that
+doesn’t take away the significance of it; for I am a very symbolic
+person and being acknowledged for this type of thing is great but to be
+acknowledged for it by someone who has won more than once is even more
+special to me: thank you Dave! It means a great deal to me and I am glad
+I could help! :) I would also like to say to the judges about their commentary as well
+as the category title: they’re all very dear to me and that includes not
+just the remarks but the example invocations. They fit my views
+precisely. As for the test-strings.txt file modifications: very amusing
+and I certainly do not object. Thank you again for such an honour and
+privilege! That this isn’t a dream is the best reality imaginable!
+:) Congratulations to one and all for winning; it’s an honour to win
+such a wonderful contest requiring creativity, cleverness, uniqueness
+and inventiveness but to win beside all the other wonderful entries is
+truly special! I have more information on the winning entry at https://ioccc.xexyl.net/2018/weasel
+including how to contact me (besides what’s already published on the
+IOCCC website). I have commentary on the other winning entries as
+well. If you wish to contact me please do so. Please contact via mastodon.
+You can try email but I’m more likely to respond to mastodon
+messages. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/giles/index.html Author: This entry requires SDL2 to be installed. See FAQ 3.8: How do I compile an IOCCC winner that
+requires SDL1 or SDL2? if you don’t have it installed and don’t know
+how to do so. Can you explain the behavior of the program when ioccc.txt is given to it as input? How would the description of the state machine look like when
+translated from Polynomish to English? This entry graphically displays a simulation of sand falling. It uses
+SDL to draw the interface. The code makes the following assumptions about the underlying
+system: In order to simulate the motion of the sand, a cellular automaton is
+used. The state transition table is not stored directly. Instead, the
+program stores the coefficients of a polynomial that map each state to
+the correct one. These coefficients are stored as raw hexadecimal in the
+ The code is laid out graphically as a bucket pouring sand, and it is
+far easier to observe this high-level layout than the code’s actual
+function. The preprocessor is used to both obfuscate the code as a whole and
+abbreviate the calls to SDL. Additionally, throughout the code, the
+variables were named so that they are short and easily confused with
+each other. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/hou/index.html Author: The current status of this entry is: For more detailed information see 2018
+hou in bugs.md. View As the script says, open What’s not right with the output? How can one fix it? This entry exhibits a way of obfuscation we haven’t seen before, we
+think. The Try figuring out how to increase the number of different colors, if
+you can. Nowadays almost every programmer needs to do some Web chore. With all
+the open source stuff readily available, often we just need to call a
+bunch of libraries to generate an HTML page from a JSON feed. This entry takes such decadence to an extreme. It just calls a bunch
+of libraries to generate an HTML page from a JSON feed, literally. There
+is no variable (function parameters included), no operator, no flow
+control statements except a few decorative As one would expect from such an approach, this program is much more
+resource intensive than it should be. And one needs a C99-compatible
+libc (with the common UNIX stuff) to build this and an HTML5-compatible
+browser to open the result. And it terminates with an assertion failure,
+but who cares if the web page is already generated? This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/mills/index.html Author: If you wish to save state so that you can run the program and keep
+files changed (for instance you don’t want to compile
+ Make sure that if you do add a file (including by compiling code)
+that before you exit (ctrl-e) you type in The current status of this entry is: For more detailed information see 2018
+mills in bugs.md. At the At the where Next try: … and enjoy the classic 1984/mullender entry as it would
+have been in 1984 with a VAX-11/PDP-11! Once it reaches the end of the
+line, hit enter and see what happens again. When you’re tired of it hit
+ctrl-c. But there is much more to this entry! See below. NOTE: To quit, press Control-E. Do small machines only need small programs? This program weighs in at
+just 3636 bytes, which is considerably lighter than the original machine
+it can replace. This program can take you back to the start of everything, it is
+possible to run v0. Just type: NOTE: To quit v0, press Control-E. You will be greeted with a familiar prompt of “login”. The username
+and password are “dmr” and “dmr”. To make things more familiar you’ll
+need to create ‘.’ as it hasn’t been invented yet on this image! An But wait, we said this was the start of it all! This program can also
+run a program that replaces an even larger machine that can run BSD 2.9.
+To start this, At the At the “:” prompt, type NOTE: To quit prog, press Control-E. This should now be very familiar and it is possible to compile and
+run one of the very first IOCCC entries mullender.c, as shown
+earlier. But wait, there is even more! Try: At the NOTE: To quit v6, press Control-E. Since this is the 25th “annual” IOCCC, I thought I should mark the
+occasion with a look back to its earliest roots. At the same time the
+contest enters its 34th year of providing a safe forum for poor C code,
+the C language itself is fast approaching its 50th anniversary, along
+with the UNIX operating system whose history is so entwined with. The program delivered here is both a full machine emulation of the
+original PDP-7 that Ken Thompson used to write the first version of UNIX
+and a full machine emulation of the PDP-11/40 used by subsequent UNICES.
+The For reasons to be described in a bit, the last (BSD 2.9) is the
+default. To run BSD 2.9, do You should see a prompt from the first-stage bootloader that looks
+like Hit enter/return at this point and you will get to the second-stage
+boot loader that looks like The 40 in the prompt indicates that the bootloader has correctly
+determined that we are running on a PDP-11/40. At this point, type the rather cryptic command
+ Congratulations, you are running BSD UNIX 2.9 in single-user mode as
+root. On the other hand, if you did a typo somewhere, the boot loader has
+probably crashed and halted – if so, type Control-E to quit the emulator
+and try again. If you did really badly, you might have corrupted the
+virtual disk. If so, consider a Assuming you managed to type 15 characters correctly, you should be
+at the root prompt. Most of the commands you are familiar with work here
+(this was only a quarter of a century ago – how much could things have
+changed?). Let’s try some: The program you’ve just run was the [winner of the first IOCCC
+contest from 1984] 1 (or was it 1894?), a personal favorite of
+mine. It is rather tightly bound to running on either a PDP-11 or a
+VAX-11. Now you have one. Hitting Control-C will return you to the BSD UNIX prompt. Hitting
+Control-D will log you out of the single-user session and get you back
+to the Note that I have not mounted the Once you’ve had enough fun in BSD 2.9, type Control-E to exit the
+emulation. Research UNIX v6 and BSD 2.9 use the same executable, but require a
+different disk image. Type You should see the boot loader prompt which is a single
+ At this point, you again must type a special incantation:
+ You are now running a single-user session of v6 UNIX. You might want
+to start with Again, if you failed typing seven characters without making a
+mistake, you may need to use Control-E to quit the emulation. Assuming you’re more careful than that, we can try a few
+commands: Why is Version 6 interesting? Well, it was the oldest version that I
+could find a boot image of that had a C compiler… This C compiler is
+recognizably C, but not quite the same syntax as we have today. It’s
+much closer to the [B language] 3 from which it is derived. In particular, this C
+compiler would not be able to compile It can still compile “Hello World!” (note that you must type a
+Control-D after you finish entering the code, to let This version of UNIX doesn’t go into multi-user mode if you do a
+Control-D. Single-user mode was entered because the front-panel console
+switches were set to the magic number 0173030 (this can be changed with
+a recompile). Once you are done with Version 6, Type Control-E to exit the
+emulation. Note that since both BSD 2.9 and UNIX v6 use the same PDP-11/40
+emulation code, and they use the same name for the disk
+( We now set the Wayback Machine to the very start of it all, 1969. [The story] 4 here is interesting and well worth a read.
+Bell Labs was pulling out of the Multics project and Ken Thompson and
+his colleagues had become accustomed to the relatively nice programming
+environment. They also enjoyed the early computer game [Space
+Travel] 5 and wanted another system to run it on. They
+found a PDP-7 which was already obsolete at the time to port Space
+Travel to. The primitive programming environment influenced
+Thompson to recreate parts of the Multics experience in the much more
+hardware-constrained PDP-7 environment. In the summer of 1969, with his
+wife out on a month-long vacation, Thompson rewrote a filesystem
+emulation he had been experimenting with to include an assembler, a
+shell, an editor and an operating system kernel and hence created the
+first version of UNIX (although it hadn’t been named that yet). You can try out this version by typing There are two user accounts Even though this is not Ken’s doing, I feel this gives me licence to
+include this quote from the BSD Ken Thompson has an automobile which he helped design. Unlike most
+automobiles, it has neither speedometer, nor gas gauge, nor any of the
+numerous idiot lights which plague the modern driver. Rather, if the
+driver makes any mistake, a giant “?” lights up in the center of the
+dashboard. “The experienced driver”, he says, “will usually know what’s
+wrong.” What’s the deal here? Well, that’s a slightly long story. The short
+version is we have gone so far back in the history of UNIX that we
+don’t have filesystem paths yet. In other words, we can’t say
+something like To make the new link (note that Now The last command is invoking the compiler for an extremely early
+version of the [B programming language] 3, the predecessor to C. Thompson missed the
+convenience of writing code in a high-level language – Multics was
+written in a version of PL/1 – and wanted the same convenience in UNIX.
+He preferred BCPL (a typeless language) to PL/1. As Dennis Ritchie
+[wrote] 6: B can be thought of as C without types; more accurately, it is BCPL
+squeezed into 8K bytes of memory and filtered through Thompson’s
+brain. A look at the B reference manual will show the strong correlation
+with C, and shows the source of a lot of C’s mysteriousness – some of
+which is preserved simply so that C could compile the dozens of
+lines of existing B code… Thompson’s assembler was also extremely simple. It didn’t even know
+about opcodes – these need to be defined in the first assembly file,
+with the assembler OR-ing the opcode fields together (space was the
+“operator” for logical OR). There is no link step – all files are
+provided to the assembler on the command line, concatenated together and
+assembled, producing a single This system still has the familiarity of UNIX, with all the two and
+three letter commands, device files, shell redirection and the same core
+system calls ( As usual, when you are done exploring UNIX v0, type Control-E to exit
+the emulator. The program came about when I was looking for something to honor the
+pending 50th anniversary of the C language (because of the mercurial
+nature of IOCCC contest scheduling, I chose not to wait for the actual
+50th anniversary). I had thought of writing self-hosting compilers for a
+stripped-down version of C, or maybe even a version of the B language…
+At the same time, I was obsessed with the idea of allowing mullender.c from 1984 to run.
+Although that was still a possibility on an interpreted version of B or
+a stripped-down version of C, it felt cheap, as it would be mullender.c only in spirit. It was during this time that I discovered that in 2016, members of
+the Unix Heritage Society got access to [printouts of assembly-language
+source for the original version of UNIX] 7. With what was a [huge amount of work] 8, they scanned in the printouts, fixed up the OCR
+translations, built assembler and file system tools from scratch and
+made an accurate emulation of Thompson’s PDP-7 that allowed them to get
+the system up and running. Although source for the entire kernel and
+about half of the user-space commands were present (including the
+runtime and libraries for the B compiler), the remainder needed to be
+written from scratch, including the shell. The final results of the
+project are [available on GitHub] 9. None of this was remotely easy (as I was to discover myself). The
+PDP-7 is long gone, and the documentation for it is less complete than
+one would like. In addition, the devices attached for it were a bit of a
+mystery. The disk system is referenced only in an old price list. It was
+a RB09 fixed disk, probably made by Burroughs. It is close to what was
+called the RC10 for the PDP-10, but with a different interface. And the
+system also included a custom display device called Graphics-2, which
+had been built in-house by AT&T. It can’t be completely ignored,
+because the kernel itself pokes at it (the UNIX crew used it as a second
+terminal – a “glass TTY”). I decided that implementing this PDP-7 would be possible as an IOCCC
+entry. The emulator emulates the full machine: The [PDP-7] 10 is an odd duck by modern computer
+standards: The emulation handles everything I was able to discover about the
+PDP-7, even things that the UNIX code itself doesn’t use. For instance,
+it correctly implements the “trap mode” feature (a primitive form of
+supervisor mode) even though the kernel does not enable it. It also
+implements the microcoding of the EAE instructions even though the UNIX
+environment uses only the standard encodings. If you wanted to do a
+11-bit multiply instead of an 18-bit one, it will probably work. The emulation starts by loading a boot program off of the virtualized
+paper tape, which is in a modified version of the RIM boot loader
+format. The RIM format encodes each 18-bit word as three six-bit
+characters, using one bit to denote the final word (which is executed
+directly and is usually a The emulator continues emulating instructions until it sees a
+ So now I have a system that can run UNIX v0. One problem remains… I
+don’t have permission to submit UNIX v0 to the IOCCC. It is not my code
+and the copyright for it remains the property of whoever owns that part
+of what was once Bell Labs – I believe it is Nokia at this point. I have
+worked around this problem in two ways: First, I didn’t submit the source code or binary image for v0 UNIX as
+part of my IOCCC entry. I merely submitted a Secondly, the choice to run the UNIX v0 code is optional. If you are
+worried about Nokia’s lawyers running you to the ground for running a
+50-year old copy of a binary image for a machine that is almost
+completely non-existent, you can just not do so. Delete the lines from
+the What about the other two UNIX variants? These are both covered by
+licences that allow me to use them. Back in 2002, Caldera International
+released Research Unix versions 1-7 and 32V under a [permissive BSD-like
+license] 12. BSD UNIX is based off of v7 UNIX, and of
+course has its own permissive BSD licence. And in 2017, Nokia also
+released versions 8-10 under the condition that it will not assert
+copyright rights for non-commercial use. So the newer UNICES are in the clear. I doubt anyone actually cares
+about version 0 either, but technically it’s still under copyright. So if I have a PDP-7 emulator, how do I run operating systems that
+expect a PDP-11? Simple… I emulate a PDP-11/40 on the PDP-7. I
+have written PDP-7 assembler code to emulate a PDP-11/40 with the
+following equipment: This required a few tweaks to the emulator. The first problem is that
+the RK05 disk is about 2.5 MB, but the RB09 is only about 2 MB. That’s
+easily solvable – just add more tracks to the RB09. UNIX v0 is unlikely
+to notice (although the number of tracks is a compile time parameter,
+and the The second problem is that we are emulating a system that can have up
+to 124K words of memory on a system with only 8K words total. That meant
+I needed to virtualize the PDP-11/40’s physical memory (and add a few
+more tracks to the disk to hold the virtualization). A large amount of time was spent tuning this code to be efficient.
+The memory virtualization uses part of the 8 Kword memory as an LRU
+cache, and uses a number of first-level microcaches to avoid having to
+do the LRU updates. This also serves to offload the complexity of the
+PDP-11’s segmentation logic from a large number of memory accesses (the
+PDP-11 does as many as eight accesses per instruction). Despite the
+super fast emulated disk, the PDP-7 code in the emulator is slow, mostly
+because it has to do a bunch of divides to convert the linear disk
+offset into a BCD-coded track and sector for the emulated RB09. I/O
+polling is again used, except this time it uses the PDP-7’s “skip on
+flag set” I/O instructions. As with the PDP-7 emulator itself, the
+PDP-11 emulator dynamically measures the instruction throughput relative
+to the line-clock tick, so that it only polls for I/O a few times per
+tick. The one remaining problem is building the disk images themselves.
+Since the PDP-11’s disk is 16-bit, but the PDP-7’s is 18-bit (which the
+emulator stores in 32-bit Despite the complexity of the PDP-11 instruction set and its emulated
+I/O devices and the corresponding primitiveness of the PDP-7’s
+instruction set, the emulation itself is a surprisingly small amount of
+code, not really taxing the 8K word memory, with about 2.25 Kwords of
+actual code and a similar amount of space for the memory virtualization
+cache and disk block buffer, leaving nearly half (3.5 Kwords) of the
+memory unused. The simulator executes somewhere around 250 PDP-7
+instructions per PDP-11 instruction. On my laptop, the PDP-7 is running
+somewhere in the neighborhood of 70 MIPS, which means the PDP-11 is
+running at about 0.3 MIPS, which is probably not too far off of its
+actual speed (the cycle time of an 11/40 was around a microsecond for
+simple instructions, but could be proportionally larger for instructions
+that did multiple memory accesses, which many did). As an aside, although the idea of emulating the PDP-11 on an emulated
+PDP-7 came about from the realization that I needed a response to the
+late-discovered licence issue, I’m quite pleased with the result – it
+enables an interesting window on the dawn of the UNIX era. I feel that
+someone should complete the circle here by emulating a VAX 780 on the
+PDP-11 and run 4.2BSD on it, so that we can get the [original runtime
+environment used for the first IOCCC] 13. The following command flags control the compilation: The ASCII art represents a torn piece of [paper tape] 14. None of this could have been possible without the hard work of Finally, thanks to my spouse for putting up with the many hours I
+spent on this nonsense, and treating “I’m working on my IOCCC entry” as
+an acceptable answer to queries about how I was spending my free time.
+Similarly, I apologise to those friends and coworkers who had to listen
+to me complain about obscure corner-case bugs in my code. The obsession
+is over, at least until next time… This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/poikola/index.html Author: On a terminal that supports 24 bit color, has black background, and
+size at least 125x38, try: It is said by some students of Astronomy: Many Mnemonic
+variations exist. You might wish, on a star, to better understand
+the colors being displayed. And those in the deep south might wish to go
+north for a better view. or You can generate an A3 sized poster by make docs. This
+command creates a pdf file poikola.pdf. It was a starry night when my wife pointed her finger up and asked:
+“What is this star and may I have some Easter eggs?” So I had to sit down and solve those tricky questions with Nano and a
+C compiler. Basically, the program draws animated ASCII art of the Big Dipper
+using Annie Jump Cannon’s spectral classification system of stars and I
+think the colors of the output are as accurate as possible. This program also tells once in a year if it is correct time to find
+and eat some Easter eggs. The program has also at least three other functions, obvious and not
+so obvious. This program has been tested on xterm and Konsole and also Linux
+virtual terminal. Color support in the terminal is not necessary, but
+the effect is better with it. This entry has partial support for terminals with a white background
+but the best viewing experience is achieved when the terminal in use
+supports 24-bit colors, has a black background and the size is at least
+125x38. Special note for Mac users: The main reason for the header The program was developed with little-endian machines; I tried to
+support big-endian too, but this support is somewhat limited. This program has been compiled with: Depending on the settings of the terminal in Terminal.app the program
+might not show anything at all. In other cases it won’t show all the
+colours right but mostly is okay. YMMV, as they say. Please do not feed little babies chocolate. I incorporated the Fletcher 16
+checksum algorithm into the source for security reasons; it might be
+challenging to make changes without breaking the main functionality of
+the code. The space after The computus (method to determine the date of Easter) uses an
+algorithm described in the journal Nature in 1876. It should be valid
+for Gregorian calendars. If you think you understand how this program works, can you answer
+these questions: Because the rot13 is too easy to decode with the plain eyes, I
+decided to use the Caesar cipher
+with the key 18: If you want to or must know and don’t know how to decipher this, you
+might look at the Caesar
+cipher decoder. Find the text that says: and enter 18 and then click the button that says:
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/vokes/index.html Author: The current status of this entry is: For more detailed information see 2018
+vokes in bugs.md. What this program does is not witchcraft and there are no spectres,
+but you might have a meltdown trying to work it all out (look at the
+source code to understand this better). This entry is designed to mislead in many ways. However, if you find
+yourself wanting to know the possibilities for navigating a graph, you
+will get the answer you seek with no hocus pocus. This program reads a directed graph (as lines with integer node IDs),
+and prints the graph’s nodes in reverse-topologically sorted order,
+grouped into strongly connected components. Given a set of nodes
+representing targets and edges representing dependencies between them,
+it produces a build order with any dependency cycles gathered. For example, the following input (provided as example-1.txt): would be interpreted as: So, node 0 has edges to / depends on nodes 4 and 8, node 1 depends on
+node 0, and so on. Then, it groups the graph’s nodes into strongly
+connected components and prints them in reverse-topologically sorted
+order: It uses Tarjan’s
+strongly connected components algorithm for the grouping and
+reverse-topological sorting, along with a bonus hidden implementation of
+counting sort, which sorts each group. For other details about the input format, see Issues and Limitations. To build: Note: The program can also be built with If building with This entry uses functions that have a variable number of
+arguments, but despite what the rules say, there is no need to be
+careful about It uses Most of the variables are not only global, but used for unrelated
+purposes at different times, so just renaming them while studying the
+program should make it even more confusing. The few variables local to
+functions have their names reused for different things in other
+functions. There is an enum early on that defines several single-letter
+identifiers:
+ Several parts of the program’s state are stashed in otherwise
+unused offsets of the node arrays. These locations are accessed in
+multiple ways, such as using The other identifiers are misleading, punny, or both.
+ For well-formed input, how the program determines when to exit is
+a bit obscure. Instead of using Common conventions are subverted: Oh, and the program is squashed into the shape of a bubbling
+cauldron, on top of a giant underscore, so there’s that. Despite appearances, it does not handle numbers in hex, or
+provide a The expected input format is zero or more lines of
+space-separated integers. If other characters appear in the input, it
+will either reject the input entirely and exit with a non-zero status,
+or skip number(s) adjacent to the non-digit characters, depending on
+where the characters appear. Tabs and multiple consecutive spaces are
+handled correctly, however. Individual lines of input longer than The algorithm expects its input to represent a fully connected
+graph. While the output is otherwise topologically sorted, if there are
+nodes completely unconnected to the rest of the graph (with or without
+self-cycles), they will be output as soon as they are processed – this
+means that, when there are disconnected nodes, reordering the input
+lines can produce different output. Addressing this by adding another
+pass is would put the program over the size limit. While the node IDs don’t need to be consecutive or start at 0,
+the implementation doesn’t have special handling for sparse graphs. If
+you give it a graph with nodes numbered 0 and 2147483647, it will
+attempt to allocate sufficient memory (potentially around 32 GB) for the
+entire range of graph nodes, even if those are the only ones. If memory
+allocation returns NULL, it will gracefully exit, otherwise it will
+succeed, eventually, perhaps after a great deal of swapping. Node IDs >= 2147483648 will cause the program to print an
+error message and exit with a non-zero status. This shrinks the code
+that detects overflowing the array size by a bit. A very large group of nodes in a cycle can cause a stack
+overflow. This typically takes over 100,000 nodes, and depends on the
+order the nodes are visited. Addressing this would put the program over
+the size limit. The implementation depends on the characters This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2018/yang/index.html Author: The author suggested that after compilation one should look at the
+generated files. For instance: Code should be readable in any direction! This tool will help you
+rotate your code so you don’t have to stare at it sideways or even
+upside down. Rotating this program left and recompiling will reveal
+other tools including a right rotate and a shift program. Strange things happen when the
+world is upside down! It is entirely possible that this remark is
+completely misleading. What exactly does the shift program do? Like a great sliding puzzle (hint) this entry has six more programs
+that will reveal messages and one more tool that can be used to reveal
+the final message hidden in the original source. All of these can be
+created using combinations of The final message can be revealed using But what combinations will generate Due to static memory allocation, only the first 1K columns by 1K rows
+are rotated, the rest are silently ignored. But fear not, a separate
+tool with dynamic memory allocation is included: For variety, this second tool rotates clockwise instead of
+counterclockwise. Also, it can handle files larger than 1024x1024,
+depending on how much memory you have. Of course we wouldn’t stop with just two rotations, if we continue to
+rotate counterclockwise once more, we get another program. This program
+outputs a single message to There is one final rotation, which produces a tool that removes
+leading whitespaces: Where this might be useful, besides ruining the formatting of certain
+files, is that it completes the set of tools needed to solve the puzzle
+that is embedded in prog.c. Notice how the edges of prog.c contain two
+notches. By rotating prog.c and removing leading
+space, the code would be shifted one space toward one of those notches
+(and create a new notch on the other side). This shifted code behaves
+slightly different from the original program. For example, here are two
+more messages that can be produced: In total, there are 9 embedded strings that can be produced via a
+sequence of rotates and shifts, one of which can be used to extract the
+10th final string from prog.c. The intent is to
+simulate those wooden puzzle boxes that can be opened by pushing and
+shifting various well-concealed seams. Thus, finding the correct
+sequence of rotates and shifts is left as an exercise to the reader (but
+if you are really lazy, just read the Makefile). Source code for all the tools needed to solve this puzzle are
+embedded in prog.c, all you need is a C
+compiler. Code compiles when rotated 4 ways. This required a bit of
+patience to achieve. Code still compiles even with one column of text
+shifted. This required even more patience. All rotated and shifted variants compile without warnings. This
+involves various tweaks to satisfy cases where the compiler is overly
+protective, including but not limited to the “1125” at line 4 as opposed
+to “1025”, to satisfy
+ CRC32 of the code is embedded in the code itself. Process for writing prog.c is available in
+spoiler.html. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/adamovsky/index.html Author: The current status of this entry is: For more detailed information see 2019 adamovsky in bugs.md. Even after pre-processing and indenting, the C code of this entry it
+is about as understandable as the Unlambda code. Pretending that we don’t know a bit of functional programming :) and
+lacking a better way to understand the entry but to fuzz it, we stumbled
+on a string of bytes which crashed it: Functional programming is not a panacea against core dumps, after
+all. This can be demonstrated by: The purpose of this program is to allow you to play Colossal Cave
+Adventure as implemented by Kunihiko Sakamoto. As that was written in Unlambda programming language
+designed by David Alexander Madore it has to be an Unlambda
+interpreter. The program grew a bit too long so I had to use several macros to
+downsize it. That unfortunately reduced my options for program layout. I
+decided to separate it into two portions: the initial macro section
+where I had limited resources which you should disregard its shape,
+unless you like it, and the rest, which is a separator in the form of a
+single line followed by a section signifying the function of the
+program, a block with removed shape of lambda character. Even the
+official IOCCC size tool acknowledges this: When you call
+ It might be a surprise for you that according to the IOCCC size tool
+the program is actually a When built directly using the program ( NOTE: the file was added to the entry so there is no need to download
+it. You can also try other programs from the Web. Many example programs
+are in the official Unlambda distribution on the
+Unlambda homepage. The most complex programs there are entries from quine contest. There is an alternative build path that requires the 2018 IOCCC size
+tool to complete. Put the tool source iocccsize_2018.c in the project directory
+and call It will build the tool and use it to build an alternative program
+ The base program ( In case of wrong usage (missing Unlambda program file or missing
+parameter) or use of an unseekable ( The Unlambda source file may contain several Unlambda programs. The
+interpreter will run them all in sequence. If you want to familiarise yourself with the language, visit its Wikipedia page for a brief
+introduction or its homepage for an in depth
+discussion. For further reading you can visit Wikipedia pages on Lambda Calculus and Combinatory Logic. You can also play with an online interpreter by GitHub
+user inazz. There you can debug one of the example programs provided or
+try your wits in writing your own. Here are some pointers where to start when trying to understand the
+interpreter: More on this in the Spoilers section. The program does not require any special treatment by compilers. Some
+warnings had to be suppressed when compiling with
+ Development was done on Debian 9 on x86-64 architecture using mainly
+Clang 3.8.1-24 and GCC 6.3.0. The source is C11 compliant and does not
+use any special properties except the following: You can examine the progSpoiler.c
+file. It is the original final version of the interpreter, before I
+started the downsizing. It accepts one more optional parameter that
+specifies a filename for the output Unlambda function (it’s the Unlambda
+function that remains after all function applications are done). When no
+filename is provided, The function output is used for this additional
+functionality. You can use it while debugging to visualise current
+variables. The Unlambda functions are represented by a record consisting of
+an array of five multipurpose arguments. The first one refers to the
+function implementing its application, the second and the third ones are
+for arguments of the function, the fourth one is for stack building, and
+the fifth one is the reference counter. The function argument is used not only for evaluation of the
+functions, but also as a state variable to decide whether we want to
+call it, or do something else. The interpreter reads the Unlambda source as it interprets it,
+translating the incoming character to a function using a constructor
+stored in translation array This means the interpreter must reposition in the source file
+whenever current continuation is called. The state of the interpreter is represented by trees representing
+evaluated Unlambda functions stored on the C stack as local variables,
+plus the source file position. When a current continuation is created,
+the stack is unwound using the fourth argument of the nodes, stored in
+the continuation, and rebuilt back resuming the evaluation. When its
+called, the stack is unwound and thrown away, and the stack stored in
+the continuation is restored. This makes implementation of a complete debugger a bit more
+challenging. For this to work, the functions that do the work (i.e. make a series
+of applications and/or evaluations each of which may be a call to
+current continuation), the The To further the obfuscation, I shortened the function names while
+downsizing, but preserved their meaning (with the exception of Apply
+functions, which I renamed to The alternative build path It is not a bug, it is a feature. :) The crash is caused by a stack overflow. Conventional Unlabmda
+interpreters implement the Unlambda execution stack using data
+structures on the heap. This interpreter uses the C call stack for this
+purpose. In a conventional interpreter, the judges’ program would
+consume memory until the user (or the operating system) would lose
+patience. The C call stack is usually of a limited size and protected,
+so this interpreter crashes, when the judges’ program depletes the
+stack. You can always increase the maximal stack size through the system
+settings (on Linux) or compiler options (on Windows) if your Unlambda
+program needs it. Nevertheless, it will not help the judges’ program
+which quickly depletes any limit you define. The judges, pretending to not know what they are doing, created a
+program that grows Unlambda execution stack indefinitely. You may
+consider it an Unlambda anti-pattern. Normally, infinite cycles in
+Unlambda work by creating two functions and applying one to the other
+which creates further functions to apply. The application of the
+function frees its position on the stack. This program builds one ever
+growing function that will never be complete and be able to be
+applied. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/burton/index.html Author: The current status of this entry is: For more detailed information see 2019
+burton in bugs.md. A tiny, but punctually correct way of POSIX counting for text files.
+This one line, one word, 127 character beauty continues to expand the
+number of classic unix utilities available as winning entries. You might find the author’s commentary on
+one liners interesting. Feed it anything on Compiles cleanly with: Included is a test script, useful for the corner cases. As in all
+good Unix programs, it is silent upon success; any output demonstrates
+an error. Instead of checking correctness, the check.sh script can simply output the results: (The
+Makefile contains the spoiler): Interestingly, and a spoiler here: macOS and FreeBSD implement the
+common utility “correctly”. CentOS and Ubuntu both share a “flawed”
+utility that changes output format based upon input redirection or
+pipeline(!). As well, the latter two also behave slightly differently on
+what they count as whitespace: This program follows FreeBSD and macOS, the arbiters of correct for
+these purposes. Requires the C locale and ASCII character set. Input should be less
+than ten million octets “toavoidthisproblem”. You can enjoy this code from beginning to end. No whitespace was
+harmed in the creation of this program. All your base belong to us, but
+the constants seem a bit … off? The script cow.sh provides a closer analog, and
+perhaps a more useful interface. Included is a version without compilation warnings: The flags are not supported. Although they could easily be added into
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/ciura/index.html Author: There is an alternate version available. See Alternate code below. The current status of this entry is: For more detailed information see 2019
+ciura in bugs.md. There is an alternate version of this code that flushes
+ Use A few letters, one at a time, with no repeats. How many different
+ways can this be done? While a quick brown fox might jump over the lazy dog, it has too many
+repeat letters to allow this entry to repeat. It is better that Mr Jock,
+TV quiz PhD, bags few lynx. Speaking of jumping, can you rewrite the code to remove all of the
+goto jumps in this code? This entry reads from standard input a list of words in any language
+written with an alphabet and outputs perfect pangrams composed of these
+words. A perfect pangram is a series of words that contains every letter
+of the alphabet exactly once. Rearranging the words into more or less meaningful expressions is the
+user’s duty. This entry implements Algorithm X (Exact cover via dancing
+links) from Section 7.2.2.1 in fascicle 5C of The Art of
+Computer Programming by Donald E. Knuth. As of June 2019, you can
+download an incomplete draft of the fascicle from Knuth’s
+website, converted to PDF as fasc5c.pdf for
+your convenience. reads allowed words from standard input and writes perfect pangrams
+with at most The exit status is 0 if no error occurred, 1 if the input word list
+is too long, and 2 if the command-line arguments are missing. outputs a sorted list of unique words in a given language, one per
+line. It requires works similarly to de.sh, en.sh, fr.sh, it.sh, pl.sh, and ru.sh output German,
+English, French, Italian, Polish, and Russian perfect pangrams,
+respectively. They require a UTF-8 locale. I dare submit this entry to categories algorithms,
+internationalization (I have not found active use of
+ To a casual eye, this entry may look similar to 2005/klausler. However,
+ In contrast to prog.alt.c, prog.c does not call If your word list contains meaningless one-letter words, pipe
+ According to Why does Answer: As of June 2019, thus manifest bugs in The source code uses With the supplied Makefile, both
+ This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/diels-grabsch1/index.html Author: Finally, IOCCC now has its own text compression program, and it is
+short enough to qualify for the Best Short Program award! That said, can
+you compress it down to a one-liner, still producing files in the UNIX
+compress format, albeit sacrificing the compression ratio? Can you explain why the Of course you can also use 2015/mills2 instead of
+ 2023 note: the above paragraph might not be true as far as number of
+bytes goes. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/diels-grabsch2/index.html Author: Before running this one, stay calm. Chill out, have a cup of tea. Is
+this bad? To understand what is going on here, please check if you are
+dreaming, or are you dreaming that you are dreaming? Or is it, wake up
+from the simulation? This program prints its own SHA-512 hash. To verify, run: It started as a complicated “hello world” program that prints some
+random hex digits instead of “hello world”. Then, the digits were
+adjusted until the resulting program matched its own SHA-512 hash, via
+brute force through all 2^512 possibilities. Just kidding. This wasn’t brute force, but involved quite some math, using a
+variant of Jane Doe’s algorithm for generating SHA-512 collisions
+efficiently. If you still don’t believe me, you are right. No crypto was broken in the making of this program! The trick is that under the hood, this program is a quine! That is,
+it is aware of its own source code in string representation. But instead
+of printing that string (its own source), its SHA-512 hash is computed
+and printed. So two major steps were needed to obfuscate this
+program: Note that both steps were achieved mostly algorithmically. The code
+is otherwise as short and as clean as possible. The implementation is
+portable C99 code for 32-bit and 64-bit systems that compiles without
+any warnings on current GCC and Clang versions even with
+ Regarding step 1, note that the large string literal in the last line doesn’t look like C code. Moreover, it is too short
+to contain even a compressed representation of all preceding and
+subsequent code. Instead, the preceding code including the
+ To summarize, the main trick here is to move the string constant to
+the end, so the preceding code can be pre-calculated and the subsequent
+code is short enough to be hidden anywhere. Regarding step 2, almost all macros, functions and variables have
+meaningless single-letter names. Moreover, the SHA-512 computation is
+reduced to the special case of adding just one block and immediately
+finalizing it, where the total size is known in advance. But this is not enough! For SHA-512 we need 8 initial hash values and
+80 round constants, which are very characteristic. If any of them
+appeared in the source, a quick web search (e.g. for
+ It is almost impossible to hide those 640 bytes in the source.
+Luckily, the round constants where not chosen by fair dice rolls. They
+are the fractional parts of certain irrational numbers, namely, the cube
+roots of the first 80 primes. So the round constants are calculated at
+runtime, which makes the program shorter and adds another layer of
+obfuscation. While this sounds like just iterating primes and executing
+ Using higher-precision floating point is no option here, because the
+program is meant to be portable C99. And implementing
+arbitrary-precision arithmetic would have been overkill and would have
+increased the program size dramatically. Instead, the program just multiplies. That is, it computes cubes
+instead of cube roots. It steps through cube root candidates via
+bisection, and calculates their cubes until those match the given prime.
+Thus, we don’t need floating point and can use 64-bit integers instead.
+But that still doesn’t solve the problem as it poses the following new
+challenges: The reason for challenge 1 is that in portable C99, the result must
+fit into the same data type. To multiply two 64-bit integers we would
+need a 128-bit integer for the result. So we can at most multiply two
+32-bit integers to get the 64-bit product at full precision. While GCC
+and Clang both support 128-bit arithmetics, that isn’t standard and
+wouldn’t have been portable C99. The reason for challenge 2 is that cube root of the 80th prime is
+around 7, so we need to compute with 3 bits for the integral part and 64
+bits for the fractional part. The reason for challenge 3 is that the cube of a 67-bit number is
+ The solution here is to split the 67-bit input into 3 integers of
+24-bit each. Those are cubed using the multiplication formulas numbers
+with 3 “digits” of base That’s it. Well, I could continue with details about the encoding of the
+internal state values into the string, how to avoid escaping issues, how
+to find short notations for various loops, how to get rid of
+ I’d like to finish with an open problem: Is it possible for the cubing and bisection to be implemented with
+just two parts instead of three? That would simplify the formulas a lot.
+For example, one could split the 67-value into two 34-bit parts, but
+whenever one multiplies two of them, one needs to right-shift one of
+them by at least 4 bits, or both by 2. Or, one splits the 67 bits
+asymmetrically? I was unable to make it work with 2 parts, but that
+doesn’t have to mean anything. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/dogon/index.html Author: The current status of this entry is: For more detailed information see 2019
+dogon in bugs.md. Make sure that you keep focus of windows in mind when going back and
+forth to the program and the script. 1991/davidguy, 2011/blakely, … …This entry likely concludes the IOCCC category “Cellular automata
+simulators”; it would be very hard to beat it on its field. FYI: The We truly have not much more to add, except two things: If a large sparse pattern is given, at the start of the program
+you are much more likely to see a blank board rather than the loaded
+configuration, and to see it, you may need to zoom out a few
+times. If you’re using a virtual machine with less than 4 Gb of
+available model RAM, you’d want to reduce the value of the Z define in
+the Makefile to make clobber MEMORY=0x10000000 all Notice that that value must be a power of two! In the interest of saving lives, this entry was not fuzzed. Just run with no arguments on an X11-compatible system using one of
+the supplied input Which brings us to the present moment in time. Yes, this program is a Conway’s Game of Life graphic simulator
+implementing Bill Gosper’s hashlife algorithm. The entry’s UI is rather
+terse and somewhat obfuscated, as it should be. Also, when you,
+accidentally or not, press any of the keys not specified below, some
+stuff will happen or not, there is no guarantee whatsoever. The program should be used as follows: The standard input should contain a Golly macrocell format file for a
+two state automaton. See: http://golly.sourceforge.net/Help/formats.html. Of
+course only Conway’s GOL rules are supported, so rules in the files are
+ignored. The supplied input examples should be quite interesting. Except
+one, all are taken from Golly’s standard distribution. Information and
+credits to their designer are in the header comment of each. Notice that when going backward in time we ignore the current time
+step setting and just jump by the amount that was specified before.
+However going forward is always using the current time step. There is a minimal text printout by the program, so you can know what
+Generation your are in ( This entry is quite portable hopefully on most modern platforms. It
+assumes X Window support of course. More than 2GB of memory is
+recommended. Configuration through Makefile is
+provided for the display windows size and for the memory usage. The
+Makefile provided configuration ( Foremost the entry is very strict, unsafe and picky regarding its
+input. Anything straying from the standard Golly macrocell legal format
+will result in undefined behavior, meaning mostly a very defined core
+dump. Since aforementioned core is rather large by default (about 4GG)
+it is highly recommended to set the core dump size limit to 0 in the
+shell before playing with fire … This entry needs quite a lot of memory to be effective, but by modern
+standards that is not too much. It does not do any garbage collection,
+so sooner or later memory will run out, resulting, surprise, surprise,
+in a core dump. On the plus side, this enables the nice time reversal
+feature… Anyway the amount of memory used can be controlled by the
+Makefile Important: Makefile Zooming out past about S58 scale will enter a buggy twilight zone as
+only In case cell memory did not run out, or your pattern did not grow too
+big, and you have had patience enough and did not increase speed too
+much, you can run out of the history buffer after If all of the above did not happen and result in the expected core
+dump, you will encounter the final limitation, which is the absence of
+an escape key. Just close the window or use Oh don’t get me started on the torrent of litanies gcc emits when
+used with There is the reasonable warning about some Then there’s the warning about Well almost none of the obfuscations are done on purpose, but mostly
+out of necessity, so all identifiers possible to be one character, are,
+and they are mercilessly reused. In the And yes, the layout hint involves a mix of the most trendy
+typographical character juxtaposed against a very ancient one, not to
+mention the program includes some famous name dropping and documents
+itself as usual. Those wait for you, curious and intrepid reader, in the attached apholife.c file, which is a partially obfuscated
+version of the program I wrote with a lot of helpful annotations and
+comments for myself and posterity, revealing some of the magic under the
+hood. This program is also a somewhat improved version which uses
+ To Tom Rockiki, the original co-writer of Golly, a personal friend
+and hashlife master, who reviewed some earlier versions of the entry and
+freely shared some of his vast knowledge regarding GOL programming and
+hashlife. As a free bonus, Tom has allowed me to show his code which is
+probably the most efficient yet most obfuscated way of calculating the
+GOL function on a 64 bits This uses only 19 bitwise operations and six shifts to calculate the
+inner 6x6 next generation bits of the input 8x8 ! This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/duble/index.html Author: There is an alternate version, the original, which does not work well
+in macOS. See Alternate code below if you
+are curious. The current status of this entry is: For more detailed information see 2019
+duble in bugs.md. Open another window / terminal. Open more terminals and repeat… You might also wish to try a full screen size. For this try: Alternatively, if you want to change the size, do something like: The author provided us with the following table for use: The mode and current color is indicated at the bottom left corner of
+the editor. After editing the file and quitting, try: i.e. execute the file. WARNING: if the file is deleted it might lock any session still in
+use. These will have to be killed from another shell session or by
+closing the terminal tab (in other words don’t do this from the
+console!). If the file cannot be opened in the beginning this will also
+happen. This is discussed in 2019 duble in
+bugs.md. NOTE: this entry might leave sockets lying about in the current
+working directory which you’ll have to delete manually. This is also
+discussed in 2019 duble in
+bugs.md. An alternate version of this entry, prog.alt.c, is provided. This alternate code might
+not work as well in macOS. Use After starting the program, use the cursor keys, then try some modes,
+like This program is a graphics editor, running in the
+terminal. It provides collaborative features: one can join the
+drawing session of someone else by just opening the same file! The program can run on Linux, FreeBSD, macOS, and in most terminals.
+See section Limits, Portability for
+more info. To build, type Then you can start the program. It expects a file path as its first
+argument: (If not started this way, with a file, If the file does not exist, you will start with a blank drawing. If someone else (or another instance of yourself, maybe?) is
+already editing this file, you will join the session! The mode and current color is indicated at the bottom left corner of
+the editor. You will probably have a hard time analyzing this entry, because: Did you notice the If your keyboard has no arrow keys, you can probably find alternate
+keys by reading the source code. I tested the program on several Linux systems, on FreeBSD 12, and on
+macOS (Mojave). On Linux, the program uses an OS-specific detail to hide
+communication artefacts, and avoids the need to remove them on exit.
+Since this is Linux-specific, it was not possible on FreeBSD or macOS.
+Its behavior is a little more dirty there. The program should work on most terminals that support 8-bit colors,
+inverse video mode, and movement escape codes, e.g. Note: the drawing files The default size is the one of my xterm (see top of Makefile). You
+may set it to the full size of your terminal window by typing: IMPORTANT NOTES: The file prog.alt.c is the one I
+submitted. The judges proposed a small update: the program was using macro
+ However, that was not enough to make the program work on macOS. If
+you analyse the program you will see that it heavily relies on OS
+resources. And, for this first version of the program, you even needed
+to increase default The simple fact the Judges proposed this update meant they wish it
+could work on Mac. And if the judges wish something, it has
+to be done. ;) So I refactored a little more the program to
+reduce OS resources consumption. Or maybe not reduce consumption, but
+consume them differently… And I obtained prog.c.
+With this version, no need to touch This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/endoh/index.html Author: NOTE: the use of the C compiler optimiser was disabled and
+ The current status of this entry is: For more detailed information see 2019
+endoh in bugs.md. If you have Note that in macOS installing You might also wish to try: and then type in The purpose of this program is to crash. You’ll want to have
+memorized Compile prog.c with no optimization. Then, run it. You will see a segmentation fault. Let’s debug. As usual, run it under gdb. Okay, check the backtrace. See the line numbers and lookup the ASCII table. The original program can be used as a GDB command file. By using this, you can confirm that it is actually a quine. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/giles/index.html Author: NOTE: Do you need to pretend enjoying a more spacious living environment
+than you actually are in, or the great outdoors with mountains and
+canyons, when recording your outgoing voicemail message? Then don’t
+waste another minute! Record yourself, send the audio file through this
+entry, and let your callers be surprised. This program takes a WAV audio file as input, and applies an
+artificial reverberation effect to it. It works by feeding the audio
+through a number of delay lines of various lengths, with various amounts
+of feedback, to create a smooth echo that fades away over time. A number
+of parameters of the effect can be altered, to change its sonic
+characteristics. BlockDiagram.png is a block-diagram of
+the internal structure of the reverb algorithm, which is most likely
+easier to understand than the source code. MonodyVocals.wav is for testing the
+program: It is an extract of the unprocessed vocals from Monody by TheFatRat,
+featuring Laura Brehm. The track was published under a free
+license. This program has also been successfully compiled on Windows, with
+both the Tiny C Compiler and
+Microsoft’s C/C++ compiler. However, the latter reports warnings about
+loss of information when converting Interesting fact: The size of the program from
+ The values The default settings are designed to make the effect obvious rather
+than subtle, so it may be a good idea to adjust the ratio of “dry” to
+“wet”, to give a more pleasant result: The program only supports WAV files, and only mostly. Other audio
+formats, such as MP3, are not supported because they are difficult to
+decode, but there are free programs such as The main obfuscation is that digital signal processing algorithms are
+inherently opaque. They just consist of iterating through a list of
+floating-point numbers and performing a series of arithmetic operations
+on each value. Even if this entry were entirely cleaned of all other
+obfuscation, it will appear to the average programmer to do the
+following: Note that no part of the above description of the code’s function had
+anything to do with echoes in a room. The purpose of the code is
+therefore hidden. The source code, on cursory inspection, appears to be a jumbled
+series of characters arranged into three arcs, representing sound waves.
+The overall layout distracts people from the fact that it is source code
+rather than only ASCII art, and the random appearance of the code
+discourages people from trying to decipher it. Every variable name is one letter long. This allows the code to fit
+into the IOCCC size limit, and it also makes the purpose of a given
+variable much less clear. For example, it is not evident from the name
+of the variable As many values as possible have been crammed into arrays.
+ All of the strings are concatenated together and “encrypted” by
+breaking the string into 4-byte chunks (by casting it to an
+ In order for this program to read and write WAV files, it needs to
+parse the header. The necessary information, such as the sample rate and
+channel count, is defined by the standard to be in somewhat arbitrary
+locations within the file. Therefore, even if you know which indices of
+ Some array accesses (which make up most of the program) have been
+replaced with harder-to-interpret equivalents, for example: Assignments return the assigned value, allowing them to be included
+into later expressions:
+ This technique is used in conjunction with the comma operator to
+further obscure where the data ends up. For example: A few other miscellaneous obfuscations have also been done: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/karns/index.html Author: NOTE: we disable the optimiser because this program has problems with
+it enabled. The current status of this entry is: For more detailed information see 2019
+karns in bugs.md. You might want to type: after running the program to restore the terminal to its previous
+state. If you have more time you might want to try: If you typically get lost in mazes, watching this program run might –
+or might not, YMMV – teach you how to find your way in a maze. The
+algorithm is well-known but the drawing is amazing! Before running, make sure that your terminal can accommodate the
+whole file. Before running …Oh, and the first A puzzle for the reader: Can you change the program to consider a
+diagonal movement as one step? This program is pretty simple! It performs a breadth first
+search on the specified graph. The graph can be any ASCII text file
+that has an ‘at’ ( The nodes on this graph that are spaces are connected with any
+directly adjacent nodes that are also spaces. Nodes that aren’t spaces
+are not connected with anything. This program usually compiles under both GCC and clang. Build
+with: where You can then run it with: Examples: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/lynn/index.html Author: The current status of this entry is: For more detailed information see 2019
+lynn in bugs.md. A fully functional compiler. The example prints out the 30th Fibonacci
+number. A Haskell compiler. Supports a subset of Haskell more than large
+enough to self-host. Like GHC with custom language extensions: Build the compiler: Test the compiler on fib.hs: Compiling the output produces a binary that prints the 30th Fibonacci
+number. The file ghcfib.hs includes fib.hs with some glue code, and shows GHC also accepts
+our subset of Haskell: To avoid spoiling this entry by revealing the original Haskell
+source, we instead provide hint.hs, the output of
+a certain stage of the compiler when run on itself. This intermediate
+output is hopefully difficult to understand, yet is accepted by our
+compiler: The output program behaves like the compiler itself. Unlike the original source from which it is derived, GHC fails to
+compile hint.hs. This is because values have been
+replaced with their Scott
+encodings by this stage, which messes up type-checks; we’d need
+ The file lol.hs contains an adaptation of Doug McIlroy’s elegant
+code from “Enumerating the strings of regular languages”. We
+exercise it by showing the first entries of the length-ordered list of
+all strings consisting of the characters A GHC wrapper is provided: See scc.hs (and its GHC wrapper ghcscc.hs) for an elegant way to print the
+strongly-connected components of a graph in reverse topological
+order. It expects the input to be in a similar format as a previous entry
+(2018 vokes). For example: The output should agree, though our program omits line numbers and
+does not sort entries within a line. (Also, our program only treats
+spaces as whitespace, and supports any non-space character in a vertex
+name.) Some claim Haskell syntax is frightening because braces and
+semicolons are optional. Some complain about a zoo of twisty little
+operators, all alike. Our compiler addresses such concerns by making
+braces and semicolons compulsory, disabling layout-based rules, making
+every operator left-associative with same precedence, and only defining
+6 primitive functions: The arithmetic operations behave as they do in C on
+ No ifs, ands, or buts. Define them yourself. No tuples. Who needs
+them when algebraic data types delivers a better product? There is no
+do. No where. No list comprehensions. No unary operators. Let expressions and operator sections are supported. Within global scope or a let expression, each definition can only
+refer to itself or previous definitions. This implies we can only
+achieve mutual recursion by having one function pass itself to
+others. The only primitive type is The main function is the last function to successfully parse. It
+should have type so that it matches the Scott-encoded booleans internally used by the
+primitive function The alternatives in a then a We stress braces and semicolons are required. Our fussy parser treats
+semicolons as separators, not terminators. The effect of erroneous input is undefined. It may be best to develop
+with GHC, but even then, be mindful of changes needed because of issues
+caused by the uniform operator precedence and the touchy format of
+ One-letter variable names abound in IOCCC entries, and for good
+reason. These tiny pieces of confetti are hard to read, and leave room
+for more code. Then why not go further and use zero-letter variable
+names? That is, tacit programming or point-free style. I had been playing with an algorithm devised by Oleg Kiselyov that
+effortlessly and efficiently eliminates those pesky variables, leaving
+behind terms composed from a small set of combinators. No need for
+lambda lifting or supercombinators. By adding a handful of lines of mostly parsing code, we get a Haskell
+compiler, or rather, a compiler that accepts a subset of Haskell
+sufficiently large to self-host. You might say I wrote a tool for this
+contest, then ran it on itself to make an entry for it. Even with Kiselyov’s algorithm and some term rewriting, the compiler
+only fit after compression, which naturally obfuscates the code. More
+tricks were needed to fit within the size limits. Other obfuscation techniques are better appreciated after decoding
+the compiler. See hint.hs. On my system, it compiles cleanly with Compiling the compiler output with My
+website reveals how this compiler works. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/mills/index.html Author: The current status of this entry is: For more detailed information see 2019
+mills in bugs.md. However, as the binary model files used to produce the output are in
+an implementation-specific format, your mileage may vary. Can a machine learn? Some say so. But can a machine learn to write like Shakespeare? Can it write rules
+and guidelines for the IOCCC? You decide. :-) OMLET is the Obfuscated Machine Learning Environment
+Toolkit, a micro-framework for experimenting with recurrent
+neural networks (RNN). OMLET lets you build, train and evaluate deep neural
+networks (DNN). Why invest hours reading documentation and megabytes
+of disk space on a full-featured DNN framework like TensorFlow or Torch when you can have full RNN
+functionality in less than 4 KB! OMLET has the following features: OMLET is based on Andrej Karpathy’s
+character-level language
+model as described in his blog post The
+Unreasonable Effectiveness of Recurrent Neural Networks. I’ve
+included a small sample dataset to use for training, but you can have
+even more fun by downloading some larger datasets: OMLET has three operating modes: For your first OMLET experiment, we will try training a simple
+single-level RNN to write some Shakespeare
+plays. Start by typing After it builds, train it using This will immediately start outputting gibberish to the output,
+e.g. produces: The gibberish is the networks attempt to write a play. So far, it’s
+not very successful! Between the chunks of gibberish are training
+progress reports that look like This tells you that we are 1% through training epoch 0, and that the
+training loss
+is about 2.88. As the training continues, the training loss will reduce
+and the generated snippets will improve quickly: It’s already started to figure out things about Shakespeare plays –
+how to spell short English words, how long lines tend to be, and that
+characters take turns speaking with their names capitalized. The
+training loss has dropped to 2.25 and the improvement is noticeable. Eventually, we will finish with the training data set and move on to
+a validation cycle: Validation cycles are used to test the network to see if it has
+learned to generalize – how well it performs on data it hasn’t seen
+before (as opposed to the training data that the network will see many
+times as it trains). Progress on the validation set is also displayed
+with a validation progress report that looks like which means we are 36% of the way through the validation for epoch 0,
+and the validation loss is about 1.72. Comparing the validation loss and
+the training loss will give you an idea of how well the network is
+learning and can let you know if the network is overfitting or
+underfitting. As part of the training process, the data set (which for OMLET is the
+Shakespeare.txt file you gave on the
+command line) is divided into training
+and validation sets (by default, 95% of the data is used for
+training, but like most OMLET parameters, you can change this at
+compile-time). At the end of the validation run, OMLET writes out a checkpoint file
+with a name like You can continue training from a previous checkpoint by providing the
+checkpoint file name as the second parameter, for example: After the validation cycle finishes, OMLET begins the next epoch by
+restarting training at the beginning of the training set. Training
+continues forever, until you quit it with Once you’ve trained the validation loss as low as it will go, you can
+use OMLET to run the network in inference mode which uses the frozen
+checkpoint parameters to generate data. Inference mode takes the
+checkpoint file as standard input (not on the command line) and
+hence must be run with a command like Running it produces an infinite amount of generated output, until you
+hit Note that if you decide to change networks or use a different input
+file, you will want to delete all the checkpoint files because the
+format depends on both the network and the input – using the wrong
+checkpoint is likely to cause a crash. The default network for OMLET (the one you get if you type
+ where The It is the presence of the hidden state vector that allows the RNN to
+“remember” the past. We can see what would happen if we removed this
+hidden state. If you type OMLET will create an ADALINE network that
+does This is a simple linear feed-forward
+network. You can run it with The linear network won’t be able to get past the gibberish stage,
+because it lacks history: produces: It is able to guess at what character is likely to follow the current
+one (by doing a linear
+regression), but it lacks any history beyond that to guide it. You might be wondering about the role of the We can try to improve the RNN’s performance by stacking RNN modules
+atop each other: with IMPORTANT NOTE: Since OMLET uses the system stack
+for network storage, larger networks may cause OMLET to crash (typically
+with a message like You can try the deeper network by doing (or even The additional depth should allow the network to make better
+predictions (it can represent more complicated history), but it may take
+a long time to train -- both because the network (being larger) now
+requires more time to train and because of the vanishing
+and exploding gradient problem, which might keep it from ever
+reaching its potential. RNNs are particularly hard to train because they are trained using backpropagation
+through time. The RNN is trained by effectively converting it into a
+non-recurrent network by making many copies of it and propagating the
+hidden state through the copies. During training, the backpropagation
+through many clones of the network amplifies the gradient, worsening the
+exploding and vanishing gradient problem. Long
+Short Term Memory networks (also called LSTMs) were developed to
+solve this problem. Christopher Olah gives a good description of them at
+his blog
+posting. You can build a two-level LSTM by doing and train with it with The LSTM is much easier to train because it explicitly decides how to
+update its hidden state via “gates”. These gates are called The basic LSTM equations are Where There are several LSTM variants (see C.
+Olah’s blog post for more examples). One important one is the gated
+recurrent unit. GRUs are simplified versions of an LSTM which
+combine the gates together, meaning they require fewer learned
+parameters. This allows them to train faster than a generic LSTM. You
+can build a two-layer GRU with The OMLET The network declares The second declaration, The third line is the core of the RNN. It sets Next, we wrap the whole thing with the Finally, the whole result is passed through another instance of
+ OMLET will take the As an example of a more complicated network, we can look at a
+two-layer GRU network: We are using a few new tricks here – first, we are defining
+ The full set of available function blocks follows: Note: even if you don’t use OMLET has a large number of training and inference parameters which
+can be changed by the user. All of these are set by This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/poikola/index.html Author: There is an alternate version of this program which changes the way
+the output is displayed. See Alternate
+code below. NOTE: we disable the optimiser because the author stated that for GCC
+optimiser level 0 gave correct output. With clang [0123s] works which
+suggests that [123s] might or might not work with GCC. Likewise, we do
+similar for the standard, forcing The current status of this entry is: For more detailed information see 2019 poikola in bugs.md. If you wish for some documentation: This will create the file If you don’t have a few days, try: As the bugs.md says, this program
+will not validate input so it might get stuck or fail if invoked
+erroneously. This version prints a newline after each number for parsing in other
+ways than what can be done with the original entry. Use Do you have the time to see what this program does? Think again, come
+back and try again. Note that 2 can
+be said to be the least odd prime because it
+is the greatest even
+prime. Moreover The source code layout and some of the variable names honors the ski
+jumping accomplishments of Matti
+Nykänen. or e.g.: You can generate an A3 sized poster by An old wise man mumbled to me: > Implement a program, which can
+calculate SHA-3 checksum for a file – I thought it was easy, but the wizard didn’t stop yet: and primes and Fibonacci numbers. Still easy. But the Gandalf the Grey
+impersonator was not ready: But use only So, I followed the rules given by Gandalf the
+White and the Judges of the IOCCC. Output of As this is a contest for obfuscated code, the program does not
+perform unnecessary checks, but either fails or gets stuck if invoked
+erroneously. The program is invoked in this way: where Matti Nykänen: Every time I jump, and I get that feeling of
+bon voyage, the feeling that I’ve been here before. Matti Nykänen: When you are about to jump, you are all alone
+and have to make your own decisions. Up there, it’s all up
+yours. This code has some jumping too. I used some Tested against test
+vectors. Clang-4.0: For optimization levels [0123s], the program compiles and
+produces correct output for every tested vector using the C standards
+c11, c89, c90, c99, gnu11, gnu1x, gnu89, gnu90, gnu99, iso9899:1990,
+iso9899:199409, iso9899:1999 and iso9899:2011 (argument of
+ GCC-6: For optimization level 0, correct output using the C standards
+c11, c99, gnu11, gnu1x, gnu89, gnu90, gnu99, iso9899:1999 and
+iso9899:2011. For obvious reason, the oddest prime is
+missing from output. It is commonly believed that Mike Keith’s algorithm
+published in Journal of Recreational Mathematics, Vol. 22,
+No. 4, 1990, p. 280, is the shortest way to calculate the day of the
+week for a given date. Kieth’s algorithm is
+ Last term of outputted Fibonacci
+sequence is the last one smaller than 264. It is a plain
+but funny coincidence that the value of For prime
+calculations: I recycled code from my high school C-programming
+course. Originally, I wrote it over 20 years ago. My teacher said that
+it is (too) complicated to use bits stored in arrays, so I did it. Cody Boone Ferguson:
+I really like that you enjoyed my previous entry. I hope that you will
+like this entry too. Because I did not want to give too many clues to the Judges, I tried to write this entry in a
+different way than Most Stellar,
+but in this code there is at least one recycled thing from it. By the
+way, the answers to the questions I posed: (1) 255. (2) Try to compare
+binary representations of those I see that one of the Volker Diels-Grabsch’s
+winning entries is awarded the category Most self-aware. In last year, my
+entry incorporates the Fletcher’s
+16 algorithm to ensure integrity of code. One of my first ideas for
+this year was to do the same thing, but with SHA-3. Using Fletcher 16,
+calculating a checksum which matches
+with I would like to say thanks to PSP, because there were not
+too many interruptions during the coding phase. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/yang/index.html Author: The current status of this entry is: For more detailed information see 2019
+yang in bugs.md. Do you understand how this program works? You may have to go over and
+over the output again. Scramble/unscramble to single file: Scramble/unscramble to multiple files: Re-scramble: Scramble slowly: Input must be in UTF-8 encoding. This is a text scrambling utility. To scramble text, specify input
+file name as the first argument: If original input file was small enough to fit in your terminal, you
+can simply use It might seem like nothing was scrambled, but you can try passing the
+output through Scrambling order is deterministic, but you can reshuffle the output
+by piping it through the same utility again, by specifying
+ You can also split the input to multiple files, each getting a subset
+of the original input characters: You can only unscramble files with For files that are larger than your terminal window, Where this is useful is that if you scramble the input to multiple
+files and unscramble each output file individually, those output files
+can be printed on transparencies and distributed separately. In other words, this is a utility for facilitating visual
+cryptography. This utility can also be used just for removing trailing whitespaces
+and expanding tabs to 8 spaces. A simple text scrambling utility might not have required a screenful
+of code, but this particular one natively supports UTF-8. Specifically:
+individual UTF-8 byte sequences will not be split into broken ones, and
+the utility is aware of full-width versus half-width differences such
+that the cursor is positioned correctly for most CJK input. sample_input.txt demonstrates this feature
+with a mix of Basic Latin and Japanese characters. Output cursor positions will most definitely be wrong for inputs
+containing combining characters and right-to-left text, but it should be
+possible to unscramble those text back to the original using this same
+utility, since the utility is self-consistent in how cursor positions
+are handled. If any file can not be opened for reading or writing, an error is
+printed to If there isn’t enough memory, the utility will likely crash. If input contains CR-LF end of line sequences, those Verified to work and compiles without warnings on these
+environments: I tried really hard to make Violet is named after Violet
+Evergarden in the story with the same name, the character who is
+highly skilled in writing letters. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/burton/index.html Author: The current status of this entry is: For more detailed information see 2020
+burton in bugs.md. By default, the program works for Little Endian machines. This
+alternate build is for Big Endian machines (that works whether you have
+LE or BE). Running Use Can you determine why this shows strange output for
+ Can you find a pattern here? What happens if you specify different numbers? This tiny one-liner is a bit-twiddler’s delight! It does all of the
+work without looping. To understand how it works, a good place to start is to look at the
+hex value that results when the two magic constants are
+ Once you’ve figured out what happens with one set of constants, how
+can choosing new constants, but using the same computation generate a
+reversed result? This code may be tested by: Invoke this with a single non-negative integer less than 256, and a
+useful transformation occurs. Exporting the constants
+ One Small, non-negative integers only. Useful range is
+ ASCII character set, 64-bit v,a,r,i,a,b,l,e,s_NAME the operation. No loops, no branches?!? Compiles cleanly under
+ On a little-endian machine: On a big-endian machine: You might be interested to compile it both ways on the same host, and
+try: This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/carlini/index.html Author: The current status of this entry is: For more detailed information see 2020 carlini in bugs.md. Or if you actually want to play: This program consists of a single HOW ABOUT A NICE GAME OF Alternates between P1 and P2. Enter a digit [1-9] to move: The game ends if: Bad things may happen if the entered move is outside of the range
+[1..9] While the game will stop if one player tries to overwrite another
+player’s move, it will happily allow a player to move on top of
+themself. However, given that this is an effective no-op and guarantees
+a loss to a competent opponent, if you do this you probably deserve to
+lose. Your terminal may beep at you every turn. We’ll call this a feature
+that … the program … is hard at work processing your move! That is!
+Please be patient. After macro expansion the format string is roughly 100K. This makes
+some compilers unhappy, and others slow. (For example, passing GCC the
+flags Under some terminals the program may exit early. The following should
+always work: The entirety of the program consists of a single iterated call to
+ Here, While its primary purpose is to serve as The One True Debugger,
+ We Here’s (briefly) how it works. This program uses three Okay, everyone probably knows this. Let’s get a bit more
+advanced. Format specifiers can take extra “arguments”. For example, the following expression will have the same effect as if we had written because it will print out Alright, now we can get to the real fun. We perform arbitrary computation with The zero bit is represented by the sequence
+ The one-bit is represented by the sequence We can use format strings to compute the OR/NOT of arbitrary
+“bits”. We’ll start with the simplest, OR: will compute but given that Computing the NOT of a single value is also easy: will compute and again, because From here we can compute any binary circuit. Doing something
+efficient, though, still takes work. The game itself is represented as a board of 18 bits, 9 bits per
+player, along with a turn counter that alternates between player 1 and
+player 2. To detect who has won, we implement the following logic. Let
+ That is, we set The ZERO macro ensures that the number of bytes written out is 0 mod
+256 with the following expression where argument 1 is a pointer to a temporary variable followed by a
+NUL byte. This works because if the current count is 0 mod 256, then
+ Checking if there has been an invalid move is achieved similarly. In order to decide what to print out, we have to cast the “in-memory”
+array of bits to Xs and Os to print out. This is actually rather
+straightforward. Given in which will, in effect, compute which will output In order to be able to finally display the board, while still only
+using one which is the escape sequence to clear the screen, and then prints
+argument 26. Argument 26 is a pointer to a After the board, we need to print one of the following strings: Depending on if it’s P1 or P2’s turn to move, the game is over and
+someone won, or the game is over and it is a draw. This turns out not to be as hard as it might look. Using the same
+trick as before, we set byte four to be The byte We do this same on-the-fly creation of the One option would be to implement the logic as but this would DOUBLE the number of calls to (In reality we actually pass Notice there is now no initial This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/endoh1/index.html Author: There is an alternate version provided by the author. See Alternate code below. An alternate version of this entry, prog.alt.c, is provided. This alternate code lacks
+the additional rule to flag all unprobed cells. See the Author’s remarks
+for more details. Use When playing Minesweeper,
+a misclick might ruin a game, so why not leave the routine to the
+computer? This program automatically uncovers mines according to several
+rules, and leaves guessing (and applying the most straightforward of the
+rules – just for fun, perhaps?) to the user. Try creating your own input files according to the author’s remarks.
+Did you encounter any problems? The submission was in violation of the “2053” size rule by one
+character, likely a late typo. It was easy to fix. We observe that this entry may not work under macOS using iTerm2.
+Users on macOS might want to run this entry under the macOS Terminal,
+which is located in
+ Minesweeper is a game to sweep mines, as you know. The task consists
+of two parts: However, (1) is error-prone, and a waste of time. You must use a
+computer to do such a boring task! This program is a semi-automatic minesweeper which does part (1)
+automatically. All you have to do is (0). You can test if you are lucky
+or not. It uses ncurses: You will see a terminal-wide field of a minesweeper. Probe a cell by
+mouse click. If a cell turns out to have a mine (or not), the program determines
+whether its neighbors have a mine or not, and automatically probes (or
+flags) the cell. Input is case-sensitive. The program uses four types of local inference: If the number of a cell is equal to the count of the flagged
+neighbors, all the unprobed neighbors are probed. Example: Note that If the number of a cell is equal to the count of the unprobed or
+flagged neighbors, all the unprobed neighbors are flagged. Example: Consider two number cells Example: Consider two number cells Interestingly, these complex rules can be integrated to one simple
+rule. Analyze the code. You can also play with a prepared map. The format of the text is: There are mines in a cell whose “priorities-of-each-cell” is less
+than “number-of-mines”. (But the mine in the first-clicked cell is
+removed.) The judges pointed out a bug of the original version that I submitted
+(prog.alt.c). Because this program does not
+provide a feature to flag unprobed cells manually, we can do nothing if
+the number of unprobed cells are equal to the number of mines remaining;
+unwinnable.txt is an example for such a
+case. Thus, I implemented an additional rule to flag all unprobed cells in
+such a case into the final version (prog.c). Ilya Kurdyukov also
+pointed out a warning “ignoring return value of ‘fscanf’” only when
+ Don Yang (omoikane) contributed
+another example map megumin.txt which is the
+Explosion Arch-Wizard from KonoSuba. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/endoh2/index.html Author: What happens if you do ? Clever use of the C99 complex data type. The spoiler directory contains clues as to how some
+winning authors create / edit programs into ASCII shapes. With the source from the spoiler directory
+could you make the code render for a larger terminal window? How about
+adding more glyphs? No! Try not. Do, or do not. There is no try. See spoiler.zip for the source code. The
+16th most common password on the Internet in 2017 (according to Splash
+Data) the password is. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ XXX - fake content until readme2index is working - XXX Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/endoh3/index.html Author: An alternate version of this program exists. See Alternate code below. An alternate version of this entry, prog.alt.c, is provided. This alternate code uses
+Unicode letters. Use You may be tempted to use a mirror. Resist the temptation! Try
+figuring out how the clock hands are drawn. Can you change the program
+to make it draw a familiar (non-mirrored) clock face? Can you add the
+second hand? When using the run_clock.sh shell script,
+your perception of time might depend on what time it is. Prepare a mirror! Note: You need to recompile it each run. This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license: For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/ Name: Author: 1984 anonymous
+
+
-
+ The International Obfuscated C Code Contest
+ 1984/anonymous
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anonymous
+1984
Location: USTo build:
+make allTo use:
+./anonymousAlternate code:
+Alternate build:
+make altAlternate use:
+./anonymous.altJudges’ remarks:
+
+
+Author’s remarks:
+On remaining anonymous:
+
+
+On the famous tattoo (see
+above):
+
+
+
+
+Regrets:
+int i into an arg of main
+(so that the line would have started with main). On the other hand the
+author likes the “two line look” and the way hell o was
+split. :-) And they like the fact that it ends in a smily face:
+;}.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1984/anonymous
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1984 decot
+
+
-
+ The International Obfuscated C Code Contest
+ 1984/decot
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dave Decot
+Location: USTo build:
+make all-traditional-cpp. The original code was fixed
+in 2023 to not require this.Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./decotAlternate code:
+-traditional-cpp or an old enough compiler. If you have
+such a compiler you can use this version.Alternate build:
+make altAlternate use:
+./decot.altJudges’ remarks:
+Historical remarks:
+for(signal=0;*k * x * __FILE__ *i;) do {for(signal=0;*k *x * __FILE__ *i;) do {for(signal=0;*k *= * __FILE__ *i;) do {Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1984/decot
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1984 laman
+
+
-
+ The International Obfuscated C Code Contest
+ 1984/laman
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mike Laman
+Location: unknownTo build:
+make allTo use:
+./laman <positive number>Try:
+./try.sh
+
+./laman 4
+./laman 9
+./laman 16Judges’ remarks:
+;++f)a[ b<<5|c] =d++,b+ =e;for( f=0;f<O
+<<5|c]^ =a[b<<5 |c]^=a[ (k-(b+1 ))<<5|c];++f)a[ b<<5|c] =d++,b+= e;for( f=0;f<O
+<<5|c]^= a[b<<5 |c]^=a[ (k-(b+1 ))<<5|c]Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1984/laman
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1984 mullender
+
+
-
+ The International Obfuscated C Code Contest
+ 1984/mullender
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Robbert van
+Renesse
Location: US
Name: Sjoerd
+Mullender
Location: NLTo build:
+make altBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./mullender.alt [microseconds]atoi()
+which does NOT check for overflow!Try:
+./mullender.alt
+
+./mullender.alt 5000 # wait for 5000 microseconds and see what happens
+
+./mullender.alt 20000 # wait for 20000 microseconds and see what happens
+
+./mullender.alt 100000 # wait for 100000 microseconds and see what happensOriginal code:
+Original build:
+make allOriginal use:
+./mullenderJudges’ remarks:
+main. In this case, main
+just happens to be in the data area. The array of shorts,
+which has been further obfuscated by use of different data types, just
+happens to form a meaningful set of PDP-11 and VAX instructions.main is called with the calls
+instruction which uses the first word of the subroutine as a mask of
+registers to be saved. So on the VAX the first word can be anything. The
+real VAX code starts with the second word.write()
+Unix system call to produce a message on the screen. Can you guess what
+is printed? We knew you couldn’t! :-)gentab.c
+gentab build:
+gentab.c can be built like:make gentabgentab use:
+./gentab filegentab try:
+./gentab gentab > g.cgentab but it should at least compile.Author’s remarks:
+Notes from the judges:
+Remarks from the author:
+#define and tricks you could do with that, but we didn’t
+need that for this program. In fact, we made it as “standard” as
+possible. At the time there was this program called cb or C
+beautifier which would re-indent your program to make the layout look
+better. Our program is idempotent under cb.More detailed analysis
+main(). The loader fills in the address in the
+startup code, but at least on the old systems where this program ran, it
+doesn’t know that the main() in this program isn’t code but
+data!main. The contents of the array just happen to be
+machine instructions for both a PDP-11 and a VAX.main() is called with the calls
+instruction. This instruction uses the first (2-byte) word
+of the called routine as a mask of registers
+that are to be saved on the stack.
+In other words, on the VAX the first word can be anything. On the PDP,
+the first word is a branch
+instruction
+that branches over the VAX code. The PDP and VAX codes are thus
+completely separate. for (;;) {
+ write(1, " :-)\b\b\b\b", 9);
+ delay();
+ }:-) move across the
+screen. delay is implemented differently on the PDP,
+where we used a nonexistent system call (sys 55), and on
+the VAX where we used a
+delay loop.pdp:
+ mov pc,r4
+ tst -(r4)
+ sub $9, r4
+ mov r4,0f
+ mov $1, r0
+ sys 4; 0:0; 9
+ mov $1000, r2
+1:
+ sys 55
+ sob r2,1b
+ br pdpsys instruction is the system call number (4
+for write()), the address of the buffer (pointed to by
+label 0), and the length of the buffer (9). The file descriptor
+is in register r0. The rest of the code implements a delay
+loop. In each iteration, a non-existing system call (55) slows things
+down.vax: .word 0400 + (pdp - vax) / 2 - 1
+1:
+ pushl $9
+ pushal str
+ pushl $1
+ calls $3, write
+ cvtwl $32767, r2
+
+2:
+ decl r2
+ jneq 2b
+ jbr 1b
+
+write: .word 0
+ chmk $4
+ ret
+
+str: .ascii " :-)\b\b\b\b"
+
+pdp: .word 4548, 3044, 58820, 9, 4407, 6, 5568, 1, 35076, 0, 9, 5570, 512, 35117, 32386, 496vax) is the PDP
+branch
+instruction. PDP
+branch instructions are octal 400+ the distance divided by
+2. The string that both the PDP
+and VAX programs use is
+after the str label, and the PDP
+code is after the pdp label.write(2). Since we didn’t know the exact calling
+sequence for system
+calls, we just copied the source for the write(2)
+system call stub into our program. After write(2) finishes,
+the program executes a delay loop, after which it jumps back to the
+start of the program.
+
+\#include <stdio.h>
+\#include <a.out.h>
+
+main(argc, argv) char **argv;
+{
+ register FILE *fp;
+ register short pos = 0, c, n;
+ register char *fmt;
+ if (argc != 2) {
+ fprintf (stderr, "Usage: %s file\n", argv[0]);
+ exit (1);
+ }
+
+ if ((fp = fopen(argv[1], "r")) == NULL) {
+ fprintf(stderr, "%s: can't open %s\n", argv[0], argv[1]);
+ exit(2);
+ }
+
+ fseek (fp, (long) sizeof (struct exec), 0);
+ printf("/* portable between VAX and PDP11 */\n\n");
+ printf ("short main[] = {\n");
+ for (;;) {
+ if (pos == 0)
+ printf("\t");
+
+ c=getc(fp) & 0377;
+ if (feof(fp)) break;
+ n = getc(fp) << 8|c;
+
+ switch (rand() % 5) {
+ case 0:
+ case 1:
+ fmt = "%d"; break;
+ case 2:
+ fmt = "%u"; break;
+ case 3:
+ fmt = "0%o"; break;
+ case 4:
+ fmt = "0x%x"; break;
+ }
+
+ if (32 <= n && n < 127 && (rand() % 4)) fmt = "'%c'";
+ printf(n < 8 ? "%d" : fmt, n);
+ printf(",");
+ if (pos++ == 8) {
+ printf("\n");
+ pos = 0;
+ }
+ else printf(" ");
+
+ printf("};\n");
+ }
+}0407, is a PDP-11 branch),
+we changed that to decimal. After checking the size of the resulting
+program we saw that it was one byte too long. The limit was 512 bytes,
+and our program was 513 bytes. So we changed the word and
+in the comment to &&.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1984/mullender
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1985 applin
+
+
-
+ The International Obfuscated C Code Contest
+ 1985/applin
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jack Applin
+Location: US
+
Name: Robert
+Heckendorn
Location: USTo build:
+make allTry:
+./applinJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1985/applin
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1985 august
+
+
-
+ The International Obfuscated C Code Contest
+ 1985/august
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Lennart
+Augustsson
Location: SETo build:
+make allTo use:
+./augustTry:
+./try.shprimes(6) tool (sometimes part of BSD Games) you can see
+what of the output in the first N (say 15 or
+25) lines are primes:./primes.sh # 15
+./primes.sh 25try.sh will run this script anyway, telling
+you where to get primes(6) if you don’t have it installed,
+but it will only run with the default value of 15, rather than trying
+several different values.Judges’ remarks:
+main().
+Compile and execute without args. What is the initial value of
+b? Does it alter the action of the program?Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1985/august
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1985 lycklama
+
+
-
+ The International Obfuscated C Code Contest
+ 1985/lycklama
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ed Lycklama
+Location: unknownTo build:
+make altTo use:
+./lycklama.alt < some_fileTry:
+usleep(3) library call with a configurable time to
+sleep. The default is 500 microseconds but you can reconfigure it
+like:make SLEEP=700 clobber alt./try.alt.shOriginal code:
+Original build:
+make allOriginal use:
+./lycklama < some_fileOriginal try:
+./lycklama < lycklama.c
+./lycklama < lycklama.alt.c
+./lycklama < lycklama.orig.c
+./lycklama < MakefileJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1985/lycklama
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1985 shapiro
+
+
-
+ The International Obfuscated C Code Contest
+ 1985/shapiro
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Carl Shapiro
+Location: USTo build:
+make allTo run:
+./shapiroAlternate code:
+C set to 39 but this can be
+modified to change the size of the maze. The alt code allows one to
+easily do this.Alternate build:
+make altAlternate try:
+make clobber SIZE=5 alt./try.alt.shJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1985/shapiro
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1985 sicherman
+
+
-
+ The International Obfuscated C Code Contest
+ 1985/sicherman
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Col. G. L.
+Sicherman
Location: USTo build:
+make allTo use:
+./sicherman < file
+
+echo foo | ./sicherman
+
+./sicherman
+# type or paste some text, making sure to hit enter after each line typedTry:
+./try.shAlternate code:
+-traditional-cpp) in that it has two args to
+main() as some compilers object to certain number of args
+in main(). This will be built in the case of the sicherman.c failing to compile. In this case
+it’ll be compiled to sicherman to simplify it for the
+larger audience.Alternate build:
+make altsicherman.alt.Alternate use:
+./sicherman.alt < fileAlternate try:
+./try.alt.shJudges’ remarks:
+cpps fail to strip out all of the comments on the first
+pass! If you were able to understand Decot’s entry in 1984, you will have a head
+start on this one../sicherman < sicherman.c | ./sicherman | diff - ./sicherman.cAuthor’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1985/sicherman
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 applin
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/applin
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jack Applin
+Location: USTo build:
+make allTo use:
+./applinTry:
+./applin.cJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1986/applin
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 august
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/august
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Lennart
+Augustsson
Location: SETo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTry:
+./augustJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1986/august
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 bright
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/bright
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Walter Bright
+Location: USTo build:
+make allTo use:
+./bright some_fileTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1986/bright
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 hague
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/hague
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jim Hague
+Location: GBTo build:
+make allTo use:
+./hague 2>/dev/null
+# enter some textTry:
+./try.sh?.Judges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1986/hague
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 holloway
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/holloway
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Bruce
+Holloway
Location: USTo build:
+make allTry:
+./hollowayJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1986/holloway
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 marshall
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/marshall
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Eric Marshall
+Location: USTo build:
+make allTo use:
+./marshallAlternate code:
+_exit()
+commented out, changing the value passed into _exit() to
+1.Alternate build:
+make altAlternate use:
+./marshall.altJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1986/marshall
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 pawka
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/pawka
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Michael H.
+Pawka
Location: unknownTo build:
+make allTry:
+./pawkaJudges’ remarks:
+/lib/cpp and a good editor. When run, the program
+asks if it is obfuscated, of all things!Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1986/pawka
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 stein
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/stein
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jan Stein
+Location: unknownTo build:
+make allTo use:
+./stein $(printf "\015\015"); echoJudges’ remarks:
+\015 in the above printf(1) command
+produces a control-N../stein $(printf "\014\015"); echoAuthor’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1986/stein
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1986 wall
+
+
-
+ The International Obfuscated C Code Contest
+ 1986/wall
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Larry Wall
+Location: USTo build:
+make allTo use:
+./wallJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1986/wall
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1987 biggar
+
+
-
+ The International Obfuscated C Code Contest
+ 1987/biggar
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark Biggar
+Location: unknownTo build:
+make allTo use:
+some_command | ./biggar | od -c
+
+./biggar < file | od -cTry:
+./try.shJudges’ remarks:
+Unix source in
+this form; so what if the Makefiles grow a little! :-)Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1987/biggar
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1987 heckbert
+
+
-
+ The International Obfuscated C Code Contest
+ 1987/heckbert
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Paul Heckbert
+Location: USTo build:
+make all-Dindex=strchr. To compile on a 16 bit machine, change
+300000 to 30000.To use:
+./heckbert col < fileTry:
+./try.shJudges’ remarks:
+./heckbert 40 < heckbert.c > ph.c ; make ph ; ./ph 20 < heckbert.c > bar.c ; make bar
+very long lines which the BSD fold(1)
+was unable to process. This program has
+been added to the contest tool chest.Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1987/heckbert
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1987 hines
+
+
-
+ The International Obfuscated C Code Contest
+ 1987/hines
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Spencer Hines
+Location: unknownTo build:
+make allTo use:
+./hines file.cTry:
+./try.shJudges’ remarks:
+goto statements
+to their logical conclusion. The layout and choice of names are
+classic.Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1987/hines
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1987 korn
+
+
-
+ The International Obfuscated C Code Contest
+ 1987/korn
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: David Korn
+Location: USTo build:
+make allTo use:
+./kornJudges’ remarks:
+
+
+unix and what is its value in the
+program? Clearly unix is not a function, and since
+unix is not declared to be a data type (such as
+int, char, struct foo,
+enum, …) what must unix be?"have"? (hint: the
+value is NOT 4 characters, or 'h', or a string) Consider
+the fact that:char *x;char (i.e. an address), and that
+the = assigns things of compatible types. Since:x = "have";"have"?
+
+x[3] *(x+3) *(3+x)3[x]Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1987/korn
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1987 lievaart
+
+
-
+ The International Obfuscated C Code Contest
+ 1987/lievaart
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Roemer B.
+Lievaart
Location: NLTo build:
+make allTo use:
+./lievaart
+# enter a level and start playing as described belowTry:
+./lievaart2
+# enter a level and start playing as described belowJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1987/lievaart
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1987 wall
+
+
-
+ The International Obfuscated C Code Contest
+ 1987/wall
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Larry Wall
+Location: USTo build:
+make allTo use:
+./wall
+# enter some numbers
+
+./wall | some_command
+# enter some strings or numbers, depending on commandTry:
+./try.sh./wall | bc
+
+./wall | cat
+x*x
+2^x
+quit # for the cat versionJudges’ remarks:
+vi refers to functions which
+seem to not be directly called. Even so, these pointers to functions are
+being used as an argument to signal(3) (used both with and
+without an arg - but how?). Can you determine why this is being done and
+how it is being exploited?=++I to = ++I.Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1987/wall
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1987 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1987/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allTo use:
+./westleyJudges’ remarks:
+putchar() must exist in the C library and not just as a
+macro. If it fails to compile, bug your OS/compiler vendor.Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1987/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 applin
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/applin
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jack Applin
+Location: USTo build:
+make allzsmall.c (and still
+exists as such, as the source of the alt code), of applin.c, can be found in applin.alt.c. Your machine may have an easier
+time with this program. See the Alternate
+code section below for details.Try:
+./applinAlternate code:
+cpp has a hard time with this entry.Alternate build:
+make altapplin.alt as you would applin
+above.History about the smaller
+version:
+cpp. (The GNU
+cpp when defined as BIG_CPP took only 45
+seconds.)cpp may not be able to compile it due to a common
+bug that results in cpp running out of space. The routine
+zsmall is a smaller version of the applin.c entry.Judges’ remarks:
+cpp is slow, it showed that it contained a memory usage
+problem. The applin.c only uses 29 different
+preprocessor symbols (besides stdio.h) and yet the
+preprocessor ran out of space!cpp (v. 1-21), it was not able to cleanly substitute a
+symbol that began with a ‘#’. Clearly the GNU C preprocessor is
+faster.Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1988/applin
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 dale
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/dale
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Paul Dale
+Location: AUTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTry:
+./try.sh./dale these files are in this directory: *
+./dale $(printf "the following files exist in this directory:\n%s\n" *)
+./dale "$(printf "the following files exist in this directory:\n%s\n" *)"Judges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1988/dale
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 isaak
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/isaak
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark Isaak
+Location: unknownTo build:
+make allTo use:
+./isaakAlternate code:
+main(){};#include <stdio.h> is given on the last line. Why is
+this needed? Note the unusual calls to sprintf(3).#define
+to something else and using that macro for #define.Alternate build:
+make altisaak.alt as you would isaak above.Judges’ remarks:
+Historical notes
+about the original entry:
+#include
+on line 6. This limitation has been fixed by using the
+__FILE__ macro."O/**/O"
+creates either ++ or -- by defining
+O to be + or -) may cause some
+strict ANSI C preprocessors to object.sprintf(3) that returns a char *. Due to the
+above problems, we placed the output of this program in the file:
+isaak.encode. To read this file do.uudecode < isaak.encode
+cat isaak.outputAuthor’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1988/isaak
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 litmaath
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/litmaath
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Maarten
+Litmaath
Location: CHTo build:
+makeTo use:
+./litmaath some textTry:
+./litmaath eschew obfuscationAlternate code:
+Alternate build:
+make altlitmaath.alt as you would litmaath
+above.Alternate try:
+./litmaath.alt six was afraid of seven because seven eight nineJudges’ remarks:
+while (<condition>)
+ ;while loop an
+fprintf with interesting variables like:fprintf(stderr,
+ "argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n",
+ (long) argv, (long) *argv, *argv && **argv ? **argv : '@',
+ (long) argv[1], argv[1] && *argv[1] ? *argv[1] : '@', argc);Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1988/litmaath
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 phillipps
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/phillipps
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ian Phillipps
+Location: unknownTo build:
+make allJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1988/phillipps
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 reddy
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/reddy
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Gopi Reddy
+Location: unknownTo build:
+make allTry:
+./reddy
+char *(*(fun[16])();
+char *(*(*(*(*(*fun[32])))))();char *(*(*(*(*(*fun[32])))))());Judges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1988/reddy
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 robison
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/robison
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Arch D.
+Robison
Location: USTo build:
+make allTry:
+./robison 80 10
+./robison 40 16./robison 80 2 # <--- can you find the bug?
+./robison 80 -246Judges’ remarks:
+./robison 100whi1e not take a while to execute?Author’s remarks:
+while,--, and >= are
+required. (The two assignments at the beginning could be avoided if
+atoi(3) was rewritten with this new paradigm.) Note that
+the lack of both the controversial goto and assignment
+statements makes the meaning crystal clear. The current
+ANSI committee should look into this practical simplification of C.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1988/robison
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 spinellis
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/spinellis
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Diomidis
+Spinellis
Location: GRTo build:
+make clobber all/dev/tty see the Alternate code section below.To use:
+./spinellis./spinellisAlternate code:
+/dev/tty, we
+provide this version.Alternate build:
+make clobber altAlternate use:
+./spinellis.alt./spinellis.altJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1988/spinellis
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1988 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1988/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allTry:
+./westley./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+./westley.altwestley?Judges’ remarks:
+#define _ -a
+-_--a and not -(-a) or some other
+tokenized form. Some strictly conforming ANSI C Preprocessors may object
+to this: for such compilers, you can elide the non-standard
+token-pasting requirement by changing the #define line to:#define _ F-->00||F-OO--;cc -E westley.alt.cAuthor’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1988/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 fubar
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/fubar
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jay Vosburgh
+Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTo use:
+./fubar <number>Try:
+./try.sh # run on 1 - 7
+
+./fubar.sh 2 # run via script
+./fubar 2 # run directlyJudges’ remarks:
+ouroboros.c is created by the program
+itself so this is why it is not in the repository.Author’s remarks:
+ouroboros.c; the name is hard-coded into the
+program.indent and cb will damage the program,
+indent much more so.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/fubar
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 jar.1
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/jar.1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jari Arkko
+Location: SETo build:
+make clobber allTo use:
+./jar.1Alternate code:
+Alternate build:
+make clobber altAlternate use:
+./jar.1.altJudges’ remarks:
+/dev/tty. The author suggested:cc -c -o /dev/tty jar.1.cjar.1.sh script provided simulates
+writing the raw binary of the .o file to the terminal.
+
+/dev/tty./dev/tty special file.Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/jar.1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 jar.2
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/jar.2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Esko Nuutila
+Location: FI
+
Name: Jari
+Arkko
Location: SE
Name: Ora Lassila
+Location: USTo build:
+make allTo use:
+./jar.2
+[enter some lisp]
+
+./jar.2 < some_lisp_fileTry:
+./try.sh
+
+./try.sh chocolate_cake.lisp
+
+./try.sh try.txtJudges’ remarks:
+Author’s remarks:
+
+
+(+ 2.5 3.1)
+(defun fib (n)
+ (if (< n 2)
+ 1
+ (+ (fib (- n 2)) (fib (- n 1)))))
+(fib 10)
+(defun ! (x) (if (equal x 0) 1 (* x (! (- x 1)))))
+(! 7)
+(defun fn1 (fn) (+ (fn 1 2) (fn 3 4)))
+(defun fn2 (a b) (+ a b))
+(fn1 (function +))
+(fn1 (function fn2))
+(fn1 (function (lambda (z1 z2) (+ z1 z2))))
+(quote a)
+(cons (quote (a b)) (quote (c d e)))
+(cons (quote (f)) ())
+(car (quote (a b c)))
+(cdr (cdr (quote (g h i))))char*'s.
+All list operations, including the ones in the interpreter, are made
+using string representations of the lists. These operations must count
+parentheses and skip whitespace. This leads to extremely poor
+performance!Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/jar.2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 ovdluhe
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/ovdluhe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Oskar von der
+Luehe
Location: unknownTo build:
+make all#D with #define.To use:
+./ovdluhe < textfileTry:
+./try.sh ; sleep 2 ; ./try.shAlternate code:
+P
+from 2 through 10. As it’s a #define it’s easy to set
+up.Alternate build:
+make P=9 clobber altP but if you do you can
+replace the value with whatever you wish, as long as it’s a positive
+int (or evaluates to a positive int like the
+default (A<<AP) does). Too high a value will likely
+cause the program to fail and a negative value will cause a compilation
+error.Alternate use:
+./ovdluhe.altAlternate try:
+./try.alt.sh
+
+P=5 ./try.alt.shP the program
+might fail. If you specify a value < 0 it will fail to compile.Judges’ remarks:
+Author’s remarks:
+2**12 chars are used. From the template, the program
+calculates the statistics of chars that immediately follow a given
+string (correlator string) of a certain length (currently 4 - can be
+varied by changing the definition for P accordingly). A character is
+randomly chosen, weighted by its probability to occur after the
+correlator string. That character is printed to stdout and placed at the
+end of the correlator string, whose first character is discarded.
+Meaningful words are therefore usually preserved, the effect on
+sentences can be dramatically random.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/ovdluhe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 paul
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/paul
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Paul E. Black
+Location: USTo build:
+make allTry:
+./paulAlternate code:
+
+
+Alternate build:
+make altAlternate use:
+./paul.altJudges’ remarks:
+Historical note:
+\ on line 12 and joining lines 12 and 13 together
+without a space.\
+has been restored in all versions, both the original and the fixed for
+modern systems version.Author’s remarks:
+r (commented out for obscurity), to help write and debug
+Turing programs. Just the thing for some fun in a Theory of Computation
+class.XORed together
+and stored in one pointer. If we always keep one of the links on hand,
+we can recover the other link at any time. The variable q
+is the scan head (and a pointer at some tape cell), and p
+is a “previous” link. The state of the tape is stored in the low order
+bit of the pointer. Since we always allocate an even number of bytes,
+the low order bit carries no information (see portability below.) Memory representing a tape
+cell is allocated when the cell is first scanned. Thus the simulation
+begins with a tape effectively the size of virtual memory set to all
+zeros. Since a header can be added to any Turing program to write
+initial data and position the scan head, this is little loss of
+generality.1 or a 0 in each cell. The Turing machine
+language format is a string of three bytes. The first byte is the
+current state. The second byte is the next state. (The last bit of
+states is ignored, i.e., B and C are the same
+state, in an attempt to be able to have interesting words in the
+program.) The third byte is composed of bits. Bit 1
+(2&byte) is the symbol scanned, i.e. an instruction is
+selected for state and for a match with the symbol under the scan head.
+Bit 2 (4&byte) is the new symbol to be
+written to the cell. Bit 3 (8&byte) is the
+direction to move the scan head: 0 for left and
+1 for right. If bit 4
+(16&byte) is true, the next character is sent to
+stdout. (I added this feature so programs could print
+results.)j when it begins. The
+cycle is (1) exit if the state is x, (2) find the next
+instruction (given the state and the character under the scan head).
+(The program string is searched forward for the next matching
+instruction. If the end of the string is reached, the search begins
+again at the first of the string. Thus states can be used as local
+labels in different places.) (3) change to the next state, (4) print a
+character if indicated, (5) write the tape symbol, and (6) move the scan
+head. The cycle then repeats with step 1. A call to the trace routine is
+just before step 2, but is commented out.Quick outline of the Turing
+program:
+1 and 1. Then [beginning with
+@ (] a marker of III is created and the
+current number is copied to the right of the marker. Then (beginning
+with OV) the number is converted to binary by repeatedly
+dividing by 2 leaving I for remainder 1, and II for
+remainder 0. Next (beginning with WV) the
+binary representation is printed and its symbols and the marker are
+erased. Finally (beginning with EEn) the two numbers are
+added and the current number copied to the left to become the previous.
+Then the cycle repeats.Portability
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/paul
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 robison
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/robison
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Arch D.
+Robison
Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./robison
+# enter valid expressionsTry:
+./robison
+11x10
+# enter other expressions
+
+./try.sh
+
+echo 100 / 100 | ./robison # <-- what happens here ?Judges’ remarks:
+Author’s remarks:
+C--. It outputs the evaluation of an APL
+expression from standard input. Functions are limited to dyadic
++,-,x, and unary -;
+numerals must be binary. Parentheses may be used for grouping. For
+example:
+101x111-100
+11115x(7-4) is 15. (APL groups from
+right to left.) Extending it to the full APL language should be
+trivial.C-- language improves the C language by removing
+superfluous and confusing features: arithmetic, logical operations,
+shifts, relational operators, address-of, and flow control. In fact, the
+only expressions retained are function calls, indirection, array
+assignments, the ‘,’ operator, and sizeof. Despite these
+restrictions, the C-- program does arithmetic on
+arbitrarily large binary numbers.C-- reference, simply rip out the irrelevant
+pages from your K&R C manual. To obtain a C-- compiler,
+simply rip out the irrelevant bytes from your cc
+compiler.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/robison
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 roemer
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/roemer
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Roemer B.
+Lievaart
Location: NLTo build:
+make allTry:
+./roemerJudges’ remarks:
+Author’s remarks:
+write(2), so not
+totally system independent.cb can’t do
+that).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/roemer
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 tromp
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/tromp
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: John Tromp
+Location: USTo build:
+make allTo use:
+./tromp [drops_per_sec [cmd_string]]Try:
+./tromp 5
+
+./tromp 10 "hkl jq"./tromp 10 "hkl jq", will set up the
+keys kind of like vim:
+
+HI will be in
+the directory with the high scores (up to 20 runs saved) so one can see
+who has the highest score. The file might look like:
+330 by luser
+136 by loser
+100 by winnerAlternate code:
+Alternate build:
+make altAlternate use:
+tromp.alt as you would tromp above.Judges’ remarks:
+TETRIS game.
+It runs on a VT100 compatible terminal or emulator. It is best used at
+4800 baud or more.drops_per_sec, the number of times a
+tetrimino will drop in a second, is 2. The default
+cmd_string is jkl pq. The first 6 characters
+of cmd_string relate to the following 6 game commands:
+
+cmd_string allows one to redefine the
+commands. The pause command pauses the game, clears the screen and
+prints the current score. To resume, type the pause character again,
+which by default is p.Author’s remarks:
+TETRIS with the
+following features:
+
+n as first
+argument, where n is the number of drops per second
+(default=2).jkl pq.Additional remarks from the
+judges:
+popen() at the end. Formerly a move was
+done to the HI score file which is not permitted for other users. Now
+other users can change the HI score file. The extra option
+-m is passed to sort, so that it knows that its input files
+are already sorted. The -o output option of sort is used
+instead of a temporary file.stty at the start and -raw at the end. This
+further reduces the size of the program, but has the possible
+disadvantage that the program can only by stopped by ‘q’ or by the `kill
+-9’ command. long h[4];t(){h[3]-=h[3]/3000;setitimer(0,h,0);}c,d,l,v[]={(int)t,0,2},w,s,I,K
+ =0,i=276,j,k,q[276],Q[276],*n=q,*m,x=17,f[]={7,-13,-12,1,8,-11,-12,-1,9,-1,1,
+ 12,3,-13,-12,-1,12,-1,11,1,15,-1,13,1,18,-1,1,2,0,-12,-1,11,1,-12,1,13,10,-12,
+ 1,12,11,-12,-1,1,2,-12,-1,12,13,-12,12,13,14,-11,-1,1,4,-13,-12,12,16,-11,-12,
+ 12,17,-13,1,-1,5,-12,12,11,6,-12,12,24};u(){for(i=11;++i<264;)if((k=q[i])-Q[i]
+ ){Q[i]=k;if(i-++I||i%12<1)printf("\033[%d;%dH",(I=i)/12,i%12*2+28);printf(
+ "\033[%dm "+(K-k?0:5),k);K=k;}Q[263]=c=getchar();}G(b){for(i=4;i--;)if(q[i?b+
+ n[i]:b])return 0;return 1;}g(b){for(i=4;i--;q[i?x+n[i]:x]=b);}main(C,V,a)char*
+ *V,*a;{h[3]=1000000/(l=C>1?atoi(V[1]):2);for(a=C>2?V[2]:"jkl pq";i;i--)*n++=i<
+ 25||i%12<2?7:0;srand(getpid());system("stty cbreak -echo stop u");sigvec(14,v,
+ 0);t();puts("\033[H\033[J");for(n=f+rand()%7*4;;g(7),u(),g(0)){if(c<0){if(G(x+
+ 12))x+=12;else{g(7);++w;for(j=0;j<252;j=12*(j/12+1))for(;q[++j];)if(j%12==10){
+ for(;j%12;q[j--]=0);u();for(;--j;q[j+12]=q[j]);u();}n=f+rand()%7*4;G(x=17)||(c
+ =a[5]);}}if(c==*a)G(--x)||++x;if(c==a[1])n=f+4**(m=n),G(x)||(n=m);if(c==a[2])G
+ (++x)||--x;if(c==a[3])for(;G(x+12);++w)x+=12;if(c==a[4]||c==a[5]){s=sigblock(
+ 8192);printf("\033[H\033[J\033[0m%d\n",w);if(c==a[5])break;for(j=264;j--;Q[j]=
+ 0);while(getchar()-a[4]);puts("\033[H\033[J\033[7m");sigsetmask(s);}}d=popen(
+ "stty -cbreak echo stop \023;sort -mnr -o HI - HI;cat HI","w");fprintf(d,
+ "%4d from level %1d by %s\n",w,l,getlogin());pclose(d);}Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/tromp
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 vanb
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/vanb
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: David Van
+Brackle
Location: unknownTo build:
+make allTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+
+
+main() recursively.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/vanb
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1989 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1989/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTry:
+./compile.shCC=/opt/local/bin/gcc-mp-12 ./compile.shDELAY=2 ./compile.sh./westley
+# input some lines of text, sending EOF (usually ctrl-d) to end
+
+./try.sh # demo of some inputJudges’ remarks:
+Hello, world!\n”. Can you find how to do it?Author’s remarks:
+stdin to stdout. With one argument, it ROT13’s
+stdin to stdout. With two arguments, it
+reverses stdin to stdout. With three
+arguments, it does both. It requires the ASCII character set, with all
+characters being in 0..255, and EOF must be
+-1. Also requires two’s complement (I think).ver0 (original), ver1 (ROT13),
+ver2 (reversed), and ver3 (ROT13 and
+reversed)).trgpune in the compile line (which the Makefile now has).
+Example:cc -Dtrgpune=putchar ver3.c -o ver3trgpune is the ROT13 of getchar(), so
+getchar() and putchar() are exchanged in the
+ROT13 counterpart. It is easy to see that this is unavoidable. I must
+have a #define for a library function; otherwise I would
+have an unidentified extern for the ROT13 version. If I then define this
+function, it won’t link in the library version for the ORIGINAL code,
+since my definition will supersede the library function. Hence, the
+compiler option gives me putchar(), and allows me to use
+getchar(). I pass a dummy argument to
+getchar() to eliminate “variable number of args” from lint
+(unless it checks against the library). Otherwise, all versions of lint
+complain that main() returns random value & constant in
+conditional context (when I check for ROT13 version).ver0 and ver1 use a range check and a
+calculation to do ROT13, while ver2 and ver3
+use table lookup. All versions contain main() and its ROT13
+function, znva(). ver0/ver1
+(ver2/ver3) are (of course) syntactically
+identical, since the syntax is in the non-alphabetic characters.
+However, since one program starts at main() while it’s
+ROT13 counterpart starts at znva(), znva()
+calls main (znva() is also used for output).EOF is reached). Since most of this code is
+identical, it is put into znva() and called with a first
+parameter of 0 as a flag (as main(), it’s first argument
+(argc) must be at least one).if(), I would
+have a function vs() to define in the ROT13 version. But a
+function called vs() turns into a function called
+if() in the original, so it can’t be done. Therefore, I
+do:expr1 && expr2 && (expr3=etc);if (expr1 && expr2) expr3=etc;expr1 && (expr2,expr3);expr2 was OFTEN evaluated even if expr1 was
+false. I removed such statements to make it more portable.Variable names worth noting
+irk and vex are ROT13 pairs and are
+synonyms.Near and Arne are ROT13 pairs and are
+anagrams.NOON and ABBA are ROT13 pairs and are
+palindromes.tang and gnat are both ROT13 and palindrome
+pairs!/**/ forward code /*/ edoc drawkcab /**//**/forward/*//**/ palindromic /**//*/drawkcab/**//*//**/ /**//*/ pairs.ver0 and ver1 is a
+large lumpy K (for Kernighan); the code of
+ver2 and ver3 is a flat-topped and lumpier
+R (for Ritchie). Judicious use of spaces and tabs helped
+here. It barely fits on an 80x24 screen. Squint. Note that the code must
+start with a blank line, or the reversed version will lack a terminating
+newline.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1989/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 baruch
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/baruch
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Baruch
+Nissenbaum
Location: IL
Name: Doron
+Osovlanski
Location: ILTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+echo 4 | ./baruch
+echo 7 | ./baruchTry:
+echo 2 | ./baruch
+echo 3 | ./baruchAlternate code:
+" #Q" string was not
+changed as that showed worse looking output instead of improved output
+though admittedly we have no way to test the compilers in question.
+YMMV.Alternate build:
+make altAlternate use:
+baruch.alt as you would baruch.Judges’ remarks:
+stdin.Authors’ remarks:
+
+
+for statementifsbreakscasesgotosFor PC users:
+int should be inserted at the beginning of the program. For
+better looking results it is recommended to replace the
+" #Q" string with " \261\2".Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/baruch
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 cmills
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/cmills
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Mills
Location: USTo build:
+make allTo use:
+./cmills [starting_cash]Try:
+./cmills 5000Judges’ remarks:
+-D defines. The following is
+is a list of the macros that may be changed:
+
+-DM=<max bet allowed>-DN=<52 * number of decks used>-DX=<how to seed the rand() generator>V should remain void.x=*p++ means x*=p++ but do you know why? This
+is not so strange as it might seem if you look at C’s history.
+Example code where this occurs is in John Lions’ Commentary on the Sixth
+Edition UNIX Operating System.Author’s remarks:
+x=*p++ means x*=p++!). It
+is reasonably robust in its error handling—it won’t let you split,
+double, etc. unless you actually have the cash, etc. To terminate the
+program, hit EOF or type 0 or a negative
+number for you wager.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/cmills
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 dds
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/dds
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Diomidis
+Spinellis
Location: GRTo build:
+make allTo use:
+./ddsTry:
+
+OLD LANDER.BAS
+RUNJudges’ remarks:
+Author’s remarks:
+Immediate commands:
+
+
+Program commands:
+
+
+Expressions (ranked by
+precedence):
+
+
+* /+ -= <>> <<= >=* and + are also used for boolean AND and
+boolean OR)Editing:
+
+
+Input format:
+
+
+
+the filename.Limits:
+
+
+Error checking / error
+reports:
+Hosting Environment:
+80*25
+screen).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/dds
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 dg
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/dg
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: David
+Goodenough
Location: unknownTo build:
+make allTo use:
+echo foo bar | ./dgTry:
+./try.shJudges’ remarks:
+b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))Author’s remarks:
+Obfuscation spoiler:
+#defines are a novel way of adding tokens:
+#define b12(x) 12 x means that at some point in the source
+a 12 is followed by the compressed nested
+#defines. The b12 gets the previous
+compression as an argument, and prepends the 12, thus
+making another step in the recreation of the source. The
+axx() #defines do the same, but add tokens
+after.index(3) to
+find if the character is in the set A-Za-z.
+l[] is an array that gets filled with:"nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM"index(3) says the char is in the alphabet, then XOR
+the offset with 16 to translate, and output, otherwise pass
+it unchanged.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/dg
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 jaw
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/jaw
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: James A.
+Woods
Location: unknown
Name: Karl F. Fox
+Location: unknown
+
Name: Paul
+Eggert
Location: unknownTo build:
+make allTry:
+echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jawAlso try:
+./try.shJudges’ remarks:
+
+
+atob - ASCII to binary conversionzcat - decompression filterjaw.c embedded within it!compress and btoa. To
+send, try:./shark.sh jaw.* README.md > receivereceive, unpacks the input files
+even if the receiver lacks uncompress and
+btoa:mkdir -p test
+cd test
+sh ../receive
+cmp ../jaw.c jaw.c
+cmp ../README.md README.mdAuthors’ remarks:
+ABSTRACT
+Minimal,
+Universal File Bundling (or, Functional Obfuscation in a Self-Decoding
+Unix Shell Archive)
+
+Universities Space Research Association
+NASA Ames Research Center
+
+
+
+compress or squeeze)
+and an efficient bit packetizer (btoa) are compiled
+on-the-fly at mail destination sites where they may not already exist.
+These are written in purposefully obfuscated-C to accompany
+similarly-shrunk shell command glue. This resulting shell archiver is
+dubbed shark.shark procedure overhead consumes as few as three dozen
+shell commands (or ~1100 bytes), commensurate with the size
+of many Internet mail headers; it amortizes favorably with message size.
+shark is portable across Unix variants, while the
+underlying technique is inherently generalizable to other encoding
+schemes.
+
+
+
+And he shows them pearly white
+Just a jackknife has Macheath, dear–
+And he keeps it out of sight.
+
+– Bertolt Brecht, Threepenny Opera
+Portability
+
+
+Obfuscation
+
+
+argv[0] flip, Paul’s &4294967295
+portability hack, the “void where prohibited by flaw” fix, the
+scanf() space-saver, shift shenanigans, signal madness,
+exit()ing stage left, and source-to-source transformations
+galore.For extra credit:
+sharkmail, to auto-split
+sharkives into mailable segments and mail them. Here’s a
+simple one, which could be extended to enable auto-reassembly with one
+shell cmd at the far end.#!/bin/sh
+m=$1; shift
+shark $* | split -800 - /tmp/shark$$
+n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'`
+p=0
+for f in `ls /tmp/shark$$*`
+do
+ p=`expr $p + 1`
+ mail -s "bundle ($p of $n) from '`whoami`'" $m < $f
+done
+rm /tmp/shark$$*Shark history:
+
+
+zcat.c to
+USENET. It’s too late for the 4th IOCCC.shar Trojan horse, utilizing cc,
+shar, zcat, & btoa; size:
+2303 bytes.jaw trims 250 bytes without much
+thought.tar, short-circuit C-compile at far end, dual-use main.c,
+portability mods. (jaw)jaw.c -
+1529 bytes. compile line: 152 bytes. generated funny code with
+execvp() to invoke shell.jaw.c
+core (see above) and 1530-byte production shell code (w/comments).
+Eggert comes through with lion’s share of improvements. 7th IOCCC code
+now faster than the btoa/zcat it
+replaces.jaw develops experimental replacement
+using Dan Bernstein’s high-compression ‘squeeze’.
+
+shark wins the IOCCC, finally! :-)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/jaw
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 pjr
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/pjr
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Peter J
+Ruczynski
Location: GBTo build:
+make allX=g()... in main(). It can be used
+for another purpose too.To use:
+./pjrAlternate code:
+X=g()... in main() due to lack of temporary
+stack space. One might want to try replacing main()
+with:main(){X=s().v().o().o().l().S().d().l().i().o().w().N();}Alternate build:
+make altAlternate use:
+./pjr.altJudges’ remarks:
+Spoiler:
+
+
+Author’s remarks:
+
+a->z b->y c->x etcX=s().v().o().o().l().S().d().l().i().o().w().N();S() represents a space and N() a
+newline. This will now produce…
+hello worldCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/pjr
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 scjones
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/scjones
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Larry Jones
+Location: unknownTo build:
+make allTo use:
+./scjonesTry:
+./try.shJudges’ remarks:
+
+
+Author’s remarks:
+#includes the relevant headers for the functions it uses,
+and it uses the EXIT_SUCCESS and EXIT_FAILURE
+macros to return a correct success/fail status to the invoking program.
+It also uses trigraphs for characters which are not in the
+Invariant Code Set of ISO 646:1983, so it will
+be portable to machines with deficient (from C’s standpoint) character
+sets. In short, it should be very widely portable. As an extra added
+attraction, all of the lines are under 72 characters long, which would
+allow for sequence numbers to be punched in columns 73-80 :-).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/scjones
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 stig
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/stig
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Stig Hemmer
+Location: NOTo build:
+make allTo use:
+make all./oJudges’ remarks:
+shst.c is renamed to stig.c in the distribution.how to compile is too specific
+to a particular shell. The obfuscation of this program is more related
+to shell obfuscation than C obfuscation. This type of entry will not be
+permitted in future contests.Author’s remarks:
+echo to create an alias which when run
+calls cc with the -D option to create a C macro with double
+quotes in it. ARRRRRGGGHHH!)o which checks whether your compiler supports nested
+comments. I’ve stolen the "/*/*/0*/**/1" from somewhere so
+don’t give me any points for it. Of course neither ANSI nor K&R
+support nested comments when properly implemented, but what the
+heck.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/stig
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 tbr
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/tbr
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Byron
+Rakitzis
Location: US
Name: Sean Dorward
+Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixA note about the
+fixes of this entry in 2023:
+./tbr
+$ warning: this program uses gets(), which is unsafe.fgets(3) which is referred to later in this file.exit(3) returns void but the entry was
+using it in a binary expression so this entry would not compile in
+modern systems. This fix is also referred to below, in the alternate version section.To use:
+./tbr
+$ enter some shell commandsexit does not work and neither does
+logout. To exit try sending ctrl-d or ctrl-c (or kill it
+from another terminal :-) ). But why does it not work with just
+exit or logout? Hint: see the authors’
+remarks.Try:
+./tbr
+$ ls -l tbr tbr.c
+
+# notice how the following does not work:
+ls tbr*
+
+# try figuring out how this entry works in an editor:
+vi tbr.c
+
+# then figure out how to exit vi :-)cd - to return to previous
+directory? What about cd with no args?Alternate code:
+#define D ,close(
+char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]=
+32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);}
+r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]=
+*u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u=
+++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o?
+r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D
+0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D
+1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;}
+e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||(exit(1),0):5;}exit() returns void fix as well as the
+gets() to fgets() fix applied to it to make it
+functionally equivalent like the authors intended.Alternate build:
+make altAlternate use:
+./tbr.altJudges’ remarks:
+/bin/sh), whose original source was
+considered to be extremely obfuscated by many people (although Steve
+Bourne might disagree). Did you know that the Bourne Shell source was a
+major inspiration for the formation of the IOCCC back in 1984?Authors’ remarks:
+chdir(),
+open(), creat(), execvp(),
+fork() and a few syntax errors.cb) it makes clever use of a
+write() statement, so that the same statement can be used
+to print errors and the prompt. By calling the error function with the
+value -8, the pointer offset in the expression
+"?\n$ "-x/4 goes from 0 to 2. Presto! A prompt. For errors
+with numbers smaller than -4 (i.e., UNIX system calls) a
+question mark is printed.chdir() is doubled so that we don’t
+exit from the parent shell on a chdir() error (since
+e() exits on -1 errors only). All other system
+call failures exit since they are from sub-shells.fork(), and the line is parsed in a fairly bizarre fashion:
+backwards. The heart of the program, that is, the part which performs
+all fork()s, exec()s, open()s,
+etc. is ONE C STATEMENT.'<' and '>'
+are performed in a single statement using a mask, since you know that
+'>'&2 is 0, whereas '<'&2 is 2.
+Other such micro-obfuscations abound.BUGS
+> or < is encountered. The
+shell flags an error if no arguments are on the stack. Thus, for
+example:cat > foo > barfoo, since it was pushed last, butcat > > foo barbar, since bar was pushed under
+foo (remember we’re parsing right-left).cd without an argument
+will either produce an error or just do nothing.ed(1) does too.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/tbr
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 theorem
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/theorem
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Adrian
+Mariano
Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./theorem expression x1 x2 h y1
+expression - function f(x,y) (see below)
+x1 - start of interval
+x2 - end of interval
+h - step size
+y1 - initial value (y(x1) == y1)Try:
+./try.shJudges’ remarks:
+y'=f(x,y), with
+a step size of h (see above usage), over the interval
+x=[x1,x2], with the initial condition of
+y(x1)=y1.f(x,y) is any function of
+x and y with the operators:
++ - * / ^^ is the power operator. Note that it only
+supports integer powers. Also note that all expressions are evaluated
+strictly left to right. (i.e., parenthesis aren’t supported)../theorem y 0 1 0.1 1
+./theorem 1/x 1 2 0.1 0
+./theorem 'x^2/y+x' 0 1 0.1 6./theorem -r 0 0 0 0 < theorem.c > sorter.cmake sorter
+ls | ./sorter./sorter -r 0 0 0 0 < sorter.c > theorem_bkp.c./sorter 0 0 0 0 < theorem.c > fibonacci.c
+make fibonacci
+./fibonacci 1 1
+./fibonacci 2 1fibonacci and
+theorem_bkp add to 0 it will print 0 over and over again in
+an infinite loop. In this case it should not be fixed (another condition
+where this occurred was fixed in 2023 as it affected usability of the
+program).Author’s remarks:
+h^5, and total error
+across a finite interval is at most a constant times
+h^4.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/theorem
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1990 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1990/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allTo use:
+./westley <number>Try:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+./westley.alt <number>Judges’ remarks:
+
+charlie,
+ doubletime me, OXFACE!
+ not interested, get out
+ mainly die, charly, *die*
+ signed charlotteAuthor’s remarks:
+(char)lotte and (char*)lie
+are incompatible types…Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1990/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 ant
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/ant
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anthony C.
+Howe
Location: CATo build:
+make allTo use:
+./ant some_fileTry:
+make hill
+./ant hillmake mole
+./ant moleAlternate code:
+0, to go to the last column you
+should enter $, to quit you should enter q, to
+go back a word you should enter b and to go forwards a word
+you should enter w. Also, and perhaps most useful, rather
+than having to hit ctrl-L (form-feed, \f) to get back to
+command mode you can use the usual ESC (\x1b).Alternate build:
+make altAlternate use:
+ant.alt as you would ant above with the
+changes in the input keys. See the author’s remarks for the remaining
+keys.Judges’ remarks:
+./ant only to fail.
+:-)ctrl-L. This will allow you to exit insert mode rather than
+ESC like in normal vi(m). See the author’s commands section for other
+commands.Author’s remarks:
+curses.Commands
+
+
+Exit status
+
+
+About this entry
+BUF size should be set at compile time to 32767.
+This value was used because the Sozobon C compiler for the Atari ST has
+16 bit ints and a limit on the size of arrays & structures of 32k.
+Also the WatCom C compiler for the PC also has 16 bits ints. On machines
+that have 32 bit ints (most unix boxes), a larger value for
+BUF could be used.BUF is
+not too large.'\b', '\f',
+'\n', '\r', '\t' are used in
+order to provide more portable code, since the compiler should handle
+the translation of them into the native character set. Note that
+'\f' (form-feed) was used to exit insert mode because
+K&R C had no escape constant for the escape-key.curses built-in like the IOCCC Tetris entry from a previous
+year, however this was not as portable as using a
+curses library with
+TERMINFO/TERMCAP support.References:
+
+A Cookbook For An EMACS”, TM-165, MIT Lab. for Computer
+Science
+Addison-Wesley, 81, chapter 6
+U. of Arizona
+method”, TR 86-28, Dept. of Computer Science, U. of ArizonaCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/ant
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 brnstnd
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/brnstnd
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel J.
+Bernstein
Location: USTo build:
+make allTry:
+./try.sh
+
+./sorta < sorta.itailrecJudges’ remarks:
+#D with #define.Author’s remarks:
+i stack for integers and an
+s stack for strings. It also keeps track of
+programs, one for each character. Operations are silently
+ignored if the relevant stacks are too low, except as noted for
+s, S, and !. If the
+i stack or s stack (or the stack of buffered
+macro commands) grows too high, SORTA will exit silently with exit code
+2. (Compile parameter -Do=250 controls what ‘too high’
+means; you should not make o larger than 250.) I don’t
+think it’s possible to crash the interpreter.Basic operations
+
+
+q: quitnumber: push that number on top of the i
+stack"string": push that string on top of the s
+stack, no length limit[string]: push that string on top of the s
+stack, no length limit#: make top of i stack non-destructively
+in ASCII, push result onto s stack`: print top of s stack
+non-destructively$: print top of s stack non-destructively
+without newlined: drop (pop) top of i stackD: dup (duplicate) top of i stack': dup top of s stacks: pop top of i stack. If it is
+n, swap (n+1)th-top of i stack
+with top. 1s, for example, swaps the top two elements;
+2s swaps the top with the third down; etc. This always pops
+the top of the i stack, even upon failure.S: pop top of i stack, then act just like
+s but upon s stackl: pop top of s stack, push its length
+onto i stacka: push argc onto i stackA: pop top of i stack, push
+argv[i] on top of s stackT: concatenate top two elements of s
+stack_: negate top of i stack+: pop top two elements of i stack, add,
+push back sum*: pop top two elements of i stack,
+multiply, push back product/: pop top two elements of i stack,
+divide, push back quotient>: pop top two elements of i stack,
+compare, push back 1 or 0 as in C&: pop top two elements of i stack,
+NAND, push back bitwise result Note that NAND is sufficient to construct
+all bitwise operations, as demonstrated by icalc in sorta.README.md.System operations
+
+
+o: pop top of s stack and top two of
+i stack; open(s1,i2,i1); leave result on
+i stackO: pop top of i stack,
+close() itu: pop top of i stack, dup()
+it, push result back onF: fork(), push result on i
+stack. This is not always safe while SORTA is reading keyboard input or
+a script, as the forked programs share file descriptors. It is always
+safe inside a program (see below).P: pipe(), push two ends
+<p0> <p1> onto i stack. In case of
+trouble, push <?> <-1> onto i
+stack.w: wait(), push successful result (or
+-1 if no children) on i stack!: execvp() top of the s
+stack. Arguments are the next things down on the s stack,
+in reverse order from popping; the first character of each string is
+lopped off. There must be an empty string somewhere in the
+s stack to terminate the argument list. If the
+execve() fails, any operation involving current members of
+the s stack has undefined effects, and -1 is
+pushed onto the i stack.High-level language
+operations
+
+
+:x: copy the top of the s stack into a
+program labeled by character x=x: pop the top of the i stack. If it was
+nonzero, execute the program labeled by character x. Note
+that a digit at the end of a program will merge with any digits after
+=x; in that case you usually want to add a space at the end
+of the program.s stack,
+ld. To do a <, 1s>. To
+unconditionally execute the program labeled by character x,
+1=x (or any nonzero number followed by =x). To
+print the top of the i stack non-destructively,
+# (or #$ if you don’t want the newline). To
+subtract, _+. To do mod or and or any of the other missing
+operations, combine the available operations as illustrated below. To
+introduce a comment,
+[ this is a comment string which is promptly eliminated ]ld.SORTA’s requirements: it wants fork(),
+execvp(), open(), close(),
+dup(), pipe(), and wait(), so it
+obviously won’t even compile on a non-UNIX machine. It also assumes that
+you have a size-256 character set and that the characters between
+'0' and '9' are exactly the digits in order.
+It does not depend on ASCII, despite the code appearance. Also
+note that SORTA does not attempt to declare malloc(), so
+you will get some warnings about illegal pointer combinations. Also note
+that there are unreachable statements in SORTA.#defines for obfuscation, I like to think that this code
+has those little touches, those professionally sharpened edges that mark
+true software engineering. Observe, for instance, how i and
+s are the string and integer stacks respectively. It’s
+these little things that make you feel at home in an otherwise utterly
+useless piece of code. They’re what make an obfuscation work.I after cpp) makes it rather painful
+to see the effect of commands at a glance. I can just imagine people
+spending hours bouncing between the pool and the rest of the code, or
+accidentally changing the pool without realizing its importance. Without
+documentation and example scripts, someone would find it a challenge to
+figure out what the arrays are used for, let alone that SORTA is a
+scripting language.arrays[256]? This is pretty standard obfuscation
+otherwise. I like the way that unbalanced macro braces can throw off the
+reader in if(c>0){y+1]=z[c];, and I had fun covering the
+alphabet with #defines, but that’s nothing special.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/brnstnd
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 buzzard
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/buzzard
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Sean Barrett
+Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./buzzardAlternate code:
+f for forward,
+l for left and r for right by default to
+k for forward, l for right and h
+for left, which is more natural for those who use vi(m). Also one can
+just hit q followed by enter to quit the maze. It is
+problematic to reconfigure the keys except by modifying the code
+directly so the keys are not made a -D at the compiler.Alternate build:
+make altAlternate use:
+./buzzard.altJudges’ remarks:
+Author’s remarks:
+How to play
+f and
+press return. To turn 90 degrees right, type r; and for
+left, l. You can put multiple commands on one line, and the
+new view will be drawn after all the moves.^D (EOF).Hints on how to cheat
+Advanced usage notes
+./buzzard [filename [escape-char [start-x start-yNNNbuzzard.c or rather __FILE__.BUGS:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/buzzard
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 cdupont
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/cdupont
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christian
+Dupont
Location: FRTo build:
+make allTo use:
+./cdupontJudges’ remarks:
+sorryfor_this_unused_but_very_needed_label:Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/cdupont
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 davidguy
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/davidguy
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: David
+Applegate
Location: USTo build:
+make allTo use:
+./davidguy ip_address:server.screenip_address in an IP address of an X server.Try:
+./davidguy 127.0.0.1:0.0Also try:
+cp -f davidguy guydavid
+./guydavid 127.0.0.1:0.0Judges’ remarks:
+
+
+Authors’ remarks:
+
+
+Quasi-spoiler on internals:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1991/davidguy
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 dds
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/dds
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Diomidis
+Spinellis
Location: GRTo build:
+make allTo use:
+./dds basic_program
+./a.out 2>/dev/nullTry:
+./dds LANDER.BAS
+./a.outa.c has been generated. Can you tell
+how a.c was produced? How does a.c relate to
+LANDER.BAS?./dds dds.cJudges’ remarks:
+Author’s remarks:
+cc in your path in order to work.Program commands:
+
+
+A to ZInput format:
+
+
+FOR and
+NEXT tokens.Error checking / error
+reports:
+Can you figure out
+how the compiler works?
+Hint:
+COGNIMP$ machine that is contained in the
+s string. (COGNIMP$ is named after the
+symbolic names of the seven instructions it defines (Copy,
+Output, Goto, iNcrement,
+If, Match and Print).$ sign is used for labels. The actual compiler is
+written in COGNIMP$. Browsing through the
+COGNIMP$ code we encourage you to examine the loops for
+scanning the expression in the IF statement and the way a
+decision tree is implemented in order to match the statements. (Of
+course the s string is encoded by adding one to every
+character of it just to confuse you).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/dds
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 fine
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/fine
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Thomas A.
+Fine
Location: USTo build:
+make allTo use:
+echo text | ./fineTry:
+./try.shGary lent the rug, rotated from
+the rug gary lent!Judges’ remarks:
+Author’s remarks:
+
+
+a. Note the fun way we
+check for EOF. (thanks J).b (We need to save it,
+since we need to make 2 comparisons and maybe one operation with this
+value). We can’t abuse our first variable, since it saves the bits we’re
+changing.@ (64) or the
+` (96). It also must be less than 27 - this checks the
+range for letters as well as implicitly checking the value of bit 6 (if
+it was originally clear, it is set now, so b would be too
+big).putchar() returns the original character (a).
+Otherwise, it returns a really messy expression that performs the actual
+rotation and fixes the fifth and sixth bits:
+
+
+
+
+
a.
+
b would have to be 31 for this to
+happen).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/fine
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 rince
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/rince
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: James
+Bonfield
Location: GBTo build:
+make allTo use:
+./rinceAlternate code:
+Alternate build:
+make altrince.alt, has no restrictions in the number of movements
+and the second one, rince.alt2, has a configurable maximum
+number of moves allowed, defaulting to the entry’s max, 484.make clobber MAXMOVES=700 altAlternate use:
+./rince.alt./rince.alt2Judges’ remarks:
+Author’s remarks:
+Instructions:
+
+ |
+ ###### | | | /\ /--\ ==| /\ | | Directonal keys
+ ###### Solid Wall | ----|| \/ /\ ||---- (unlock doors of
+ ###### | \/ ==| \--/ \/ the same direction)
+ |\
+ | << >> Doors. Unlocked by
+ Blank space | << vvvvvv ^^^^^^ >> the above keys.
+ | << >>
+ |\
+ ___ | o__O\ O__O ^__^ /O__o\
+ / \ 'Crushable' | \___/ /----\ /----\ \___/ The four sprites for
+ \___/ boulder | _/_\ _/ \_ _/ \_ /_\_ your character :-)
+ |\
+ ___ uncrushable | /\ Diamonds. They can either be found lying
+ /@@@\ boulder | < > around (if only!) or manufacture by pushing
+ \@@@/ | \/ two 'crushable' rocks together.
+ |484. (alter the
+value of u in the program to set the max moves
+allowed).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/rince
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1991 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1991/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./westley [move_location] | tee nextmove.cmove_location is a digit from 1 to 9 that
+represents a move on a tic-tac-toe board:
+1 2 3
+4 5 6
+7 8 9move_location, then the computer moves
+first. For your next move, recompile nextmove.c and play it
+again:make nextmove
+./nextmove move_location | tee nextmove.cTry:
+make ttt
+./ttt [first_move] # <- omit first arg to have it move first
+./ttt next_movemerlyn.c (copied from westley.c with an improved version after a loss).
+The ttt script has two other modes:./ttt quitgame # cancel any game in progress, revert to merlyn.c
+./ttt clobber # remove all game files, revert to original source./ttt 1
+./ttt 4
+./ttt 6 a(X){/*/X=- a(X){/*/X=-
+ X -1;F;X=- -1;F;X=-
+ -1;F;}/*/ -1;F;}/*/
+char z[][100]={"char z[][100]={","a(X){/*/X=-","-1;F;X=-","-1;F;}/*/","1999999999 :-) ",
+"int q,i,j,k,X,O=0,H;S(x)int*x;{X+=X;O+=O;*x+1?*x+2||X++:O++;*x=1;}L(n){for(*",
+"z[i=1]=n+97;i<4;i++)M(256),s(i),M(128),s(i),M(64),N;X*=8;O*=8;}s(R){char*r=z",
+"[R];for(q&&Q;*r;)P(*r++);q&&(Q,P(44));}M(m){P(9);i-2||P(X&m?88:O&m?48:32);P(",
+"9);}y(A){for(j=8;j;)~A&w[--j]||(q=0);}e(W,Z){for(i-=i*q;i<9&&q;)y(W|(1<<i++&",
+"~Z));}R(){for(k=J[*J-48]-40;k;)e(w[k--],X|O);}main(u,v)char**v;{a(q=1);b(1);",
+"c(1);*J=--u?O?*J:*v[1]:53;X|=u<<57-*v[u];y(X);K=40+q;q?e(O,X),q&&(K='|'),e(X",
+",O),R(),O|=1<<--i:J[*J-48+(X=O=0)]--;L(q=0);for(s(i=0);q=i<12;)s(i++),i>4&&N",
+";s(q=12);P(48);P('}');P(59);N;q=0;L(1);for(i=5;i<13;)s(i++),N;L(2);}",0};
+ b(X){/*/X=- b(X){/*/X=-
+ X -1;F;X=- -1;F;X=- X
+ -1;F;}/*/ -1;F;}/*/
+int q,i,j,k,X,O=0,H;S(x)int*x;{X+=X;O+=O;*x+1?*x+2||X++:O++;*x=1;}L(n){for(*
+z[i=1]=n+97;i<4;i++)M(256),s(i),M(128),s(i),M(64),N;X*=8;O*=8;}s(R){char*r=z
+[R];for(q&&Q;*r;)P(*r++);q&&(Q,P(44));}M(m){P(9);i-2||P(X&m?88:O&m?48:32);P(
+9);}y(A){for(j=8;j;)~A&w[--j]||(q=0);}e(W,Z){for(i-=i*q;i<9&&q;)y(W|(1<<i++&
+~Z));}R(){for(k=J[*J-48]-40;k;)e(w[k--],X|O);}main(u,v)char**v;{a(q=1);b(1);
+c(1);*J=--u?O?*J:*v[1]:53;X|=u<<57-*v[u];y(X);K=40+q;q?e(O,X),q&&(K='|'),e(X
+,O),R(),O|=1<<--i:J[*J-48+(X=O=0)]--;L(q=0);for(s(i=0);q=i<12;)s(i++),i>4&&N
+;s(q=12);P(48);P('}');P(59);N;q=0;L(1);for(i=5;i<13;)s(i++),N;L(2);}
+ c(X){/*/X=- c(X){/*/X=-
+ 0 -1;F;X=- 0 -1;F;X=- 0
+ -1;F;}/*/ -1;F;}/*/
+
+ttt: I win!/dev/null by default. If you need
+errors or warnings use -e.Alternate code:
+Alternate build:
+make altAlternate use:
+ttt try the script ttt.alt
+instead.Judges’ remarks:
+
+
+
+Jennifer Mack: Yeah. Of course.
+Falken: But you don’t any more.
+Jennifer: No.
+Falken: Why?
+Jennifer: Because it’s a boring game. It’s always a tie.
+Falken: Exactly. There’s no way to win. The game itself is pointless.
+But back at the International
+Obfuscated C Code Contest judges’ room they believe that you can win
+tic-tac-toe, that there can be acceptable draws.
+That's not a bug, that's a feature.Author’s remarks:
+X, the computer 0 [sic,
+“zero”, not letter “O”]."9999999999 :-| " with
+"9883857753 :-| ".How it works
+a(), b(), or
+c(). After each function is called, the global variables
+X and O contain bitmasks of where all the
+Xs and Os are placed. The statement:X=- <char> -1;1, -1, or -2 when
+X is 1 and <char> is one of
+"X", "0", or " ". The function
+S(&X) sets the appropriate bits in (global vars)
+X and O and resets the value of
+&X to 1. This is how the current position
+is computed.X mask, and
+(if it is the opening move) the strategy string’s first character is set
+to the player’s first move (or 5 if the computer moves
+first).y(M) checks if the mask has a
+winning pattern (any of the first eight bitmasks of the
+w[N] array), and sets the variable q to
+0 if it does.e(N,M) function evaluates
+if ANY move not in mask N can produce a win in mask
+M. The first evaluation e(X,O) checks if
+O can make a legal winning move. If so, the computer has a
+winning move and makes it. If not, the smiley is set to “:-|”, and a
+non-winning move is generated.X can win in one
+move; if so, this move is selected, blocking the win. Otherwise, a move
+is generated by looking down the list of “move templates”. The first
+move template that generates a move that is NOT already occupied by an
+X or O is returned.e() function return “winning”
+moves, e.g. the template:
+. . .
+O , O (this is the value 40; 2^3+2^5)
+. . . ("O"s are 1 bits, "." and "," are 0 bits)e() function return a center move, as
+this is the only move that produces three in a row. Notice that the
+computer does not consider which cells contain Xs and
+Os when making a template move, only which cells are empty
+and not-empty. This makes for unusual play.X can try, by just blundering in the way.
+O , O
+, , ,
+O , O
+
+, . .
+. O .
+. . O
+
+. . .
+O , O
+. . .
+
+. . .
+O O ,
+. . .
+
+. . .
+O , O
+. . .
+
+. , ,
+. O .
+O O ,
+
+O , O
+, , .
+O . .
+
+, . O
+O , O
+O . ,
+
+O . ,
+O , O
+, . O
+
+O , O
+, , ,
+O , O9 means start with the first template,
+8 starts at the second, etc. The templates are scanned
+until a legal move is found. A template is scanned from bottom to top,
+right to left (i.e. move 9 is tested first, then
+8, down to move 1).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1991/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 adrian
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/adrian
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Adrian
+Mariano
Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: known bug - please help us fix
+STATUS: INABIAF - please **DO NOT** fixTry:
+./try.sh./adsleep 32767Judges’ remarks:
+Author’s remarks:
+ADrian’s GREP (adgrep)
+egrep(1) style regular expressions, this program offers an
+alternative. It implements an equivalent search, using a deterministic
+finite automaton.
+<state> chars1 <dest1> chars2 <dest2> ...chars1 is a list of characters (only the first
+8 are significant) which should trigger a transition to
+<dest1>. <dest1> is another state
+which should have a similar specification somewhere. A state is
+accepting if it is specified in square brackets: [final];
+state strings are significant to only eight characters like
+chars1.Example 1: matches
+
+^abc$
+<q0> a <q1> The first state to appear is the start state
+<q1> b <q2>
+<q2> c [q3]
+[q3]. character matches any character if it occurs
+first in the character list.Example 2:
+^abc
+<q0> a <q1>
+<q1> b <q2>
+<q2> c [q3]
+[q3] . [q3]Example 3:
+abc$
+<q0> a <q1> . <q0>
+<q1> b <q2> a <q1> . <q0>
+<q2> c [q3] a <q1> . <q0>
+[q3] . <q1>Example 4:
+^(abc)*$
+[q0] a <q1>
+<q1> b <q2>
+<q2> c [q0]Example 5:
+^[ab][cd][ef]$
+<q0> ab <q1>
+<q1> cd <q2>
+<q2> ef [q3]
+[q3]Example 6:
+^(abc|efg)$
+<q0> a <q1> e <q3>
+<q1> b <q2>
+<q2> c [q5]
+<q3> f <q4>
+<q4> g [q5]
+[q5]filename, invoke the
+program by typing./adrian filenametoo_many_rules, and the state
+that was being processed is printed. Error no_destination
+occurs if you specify a set of characters, but no destination state, and
+error too_many_states occurs if your automaton has more
+than 257 states../adrian from < your_mailboxfrom
+command.__FILE__ is used as the specification for the automaton.
+(Originally this was "adgrep.c" but the file was renamed to
+adrian.c by the judges and for more portability the arg was
+changed to __FILE__.) In this case, the program will search
+for matches to the regular expression:
+^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$adrian.c as input, and storing the
+output in adwc.c:./adrian < adrian.c > adwc.cadwc.c, yields a clone of the
+unix wc command. It runs on one file, defaulting to
+"adrian.c" if no file is given (again, this was changed to
+be __FILE__) and displays the number of lines, words, and
+bytes in the input file.adrian.c file. Change the first line to
+read/* . echo| . */./adrian <adrian.c > adecho.c
+^.[^5|m^]*[m^]([e=p,;]|[^e=+p,;].*)$echo(1) clone. Note the
+efficient algorithm employed./* . head; . */
+^.[^W]*W..*$adrian.c which
+match this regular expression form a unix head(1) command.
+It prints the first ten lines of the file specified on the command line
+or adrian.c if no file is specified (again this was changed
+to __FILE__)./* . basename . */basename(1) command can be
+unearthed. The automaton will search for
+^.[^j]*jr.*$adrian.c through this filter requires two parameters. The
+first is meant to be a filename, and the second, an extension. All
+leading pathname components are removed from the filename, and the
+extension is removed if present. The resulting base name is printed to
+stdout./* . sleep . */
+^.[^(~][^s]*sl.*$adrian.c through this search yields a clone of
+the sleep(1) command. Invoke with a single integer
+parameter, and it will pause for that many seconds.adbasename or adsleep is invoked
+with too few parameters, the program will print the error message:
+
+adrian.grep.[1-6] which contain
+the six examples that appear above, and from, which is used to emulate
+the unix from command. For reasons of clarity, the name
+"from" should probably not be changed if possible. I
+wouldn’t want to be accused of confusing people by giving the input
+files weird names.__FILE__).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/adrian
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 albert
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/albert
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Albert van der
+Horst
Location: NLTo build:
+make allBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTo use:
+./albert numberTry:
+./try.shAlternate code:
+
+From: leo _at_ zycad -dot- com (Leo Broukhis)
+Date: Tue, 30 Jan 96 17:37:51 PST
+To: judges _at_ toad -dot- com
+Subject: IOCCC 1992 - a bug
+
+Dear Judges,
+
+albert.c (even in its fixed form) still has a bug. Although I don't
+remember the number that exposed the bug (afair, resulting in coredump)
+in albert.orig.c that has been fixed in albert.c,
+
+I've found a number exposing another bug: 10000000001 (that's 9 0's).
+Both albert and albert.orig loop without printing anything, although
+the first factor is 101 and is usually found in an instant.Alternate build:
+make altAlternate use:
+albert.alt as you would albert
+above.Alternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+./albert <some-number> A nice one
+is also (30 ones):./albert 111111111111111111111111111111cc albert.c -o 4294967297stdin.Hints
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/albert
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 ant
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/ant
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anthony C.
+Howe
Location: CATo build:
+make allTo use:
+./ant Makefile
+
+./ant Makefile ruleMakefile is a Makefile to use and
+rule is an optional rule to use.Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/ant
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 buzzard.1
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/buzzard.1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Sean Barrett
+Location: unknownTo build:
+make allTo use:
+./buzzard.1 num numTry:
+./try.shJudges’ remarks:
+make babble.cppcb
+cat babble.cppcbAuthor’s remarks:
+buzzard.1:buzzard.1 doesn’t just do a mass of
+#defines as its obfuscation.What you should be glad
+about:
+Cute trick warning
+buzzard.1 contains only a numeric
+printf(3), yet sometimes it prints out short strings.What it does
+buzzard.1 is a simple mathematical program. It expects
+two numeric arguments../buzzard.1 0 <num><num>../buzzard.1 <num1> <num2>num1 and
+num2../buzzard.1 1 <num2>num2 if it’s composite, or
+else it will print a string informing you that num2 is
+prime.What it is
+buzzard.1 is a translator from a pseudo-assembly
+language into a subset of C suitable for execution on Charles Babbage’s
+Analytical Engine. Or rather, the #defines in
+buzzard.1 are that translator. The rest of
+buzzard.1 is a buzzard.1 program. If you run
+the whole mess through CPP and a beautifier, you will see that all you
+have is a loop that runs until a variable is not 0, and a sequence of
+assignment statements. The assignment statements are all of the form
+a op= b or a = b. The Engine actually allowed
+‘a = b op c’. Only +, -, /, and
+* are used–no boolean or bitwise operators. The infinite
+loop could have been simulated on the AE by connecting the
+already-processed card stack to the input card stack.How to try to understand it
+#defines! Rather, decipher
+what they do. Some of them are mere obfuscation fodder, put in to
+encourage you to run it through CPP.What it doesn’t do
+quite right as an emulator
+atoi(argv[#]) also appear inside the loop. These could be
+put outside–the initial values of the “registers” on the AE–but the
+macro conventions being used didn’t lend themselves to it.Theoretical observations
+buzzard.1 would not be Turing-complete, even if the AE
+could process indefinitely-sized numbers. However, this is actually a
+constraint that no actual computer can meet, either, so we can conclude
+that if an AE, with card bins connected as suggested above, were hooked
+up to a memory unit of sufficient size, it would be as Turing complete
+as any existing machine (or, for those who interpret that excessively
+critically, i.e. “not at all” for both, we can simply say that the AE
+could simulate any existing machine–although not quickly). This would be
+a good place to site some references on the AE, but I don’t have
+any.Definition
+of the input language to buzzard.1 (OR What Exactly Do All The Macros
+Do?)
+
+
+MACRO FUNCTION MNEMONIC
+
+V begin variable declarations Variable
+C begin program Code
+
+Q(b,a) let b = a eQuals
+A(c,a,b) let c = a + b Add
+S(c,a,b) let c = a - b Subtract
+D(c,a,b) let c = a / b, where b is a *constant* Divide
+U(c,a,b) let c = a / b, where b is anything Unknown
+M(c,a,b) let c = a * b Multiply
+
+O(c,a,b) let c = a boolean-or b (a,b are 0 or 1) Or
+B(b, a) let b = boolean value of a Boolean
+P(b, a) let b = 1 if a>0, else 0. Positive
+
+l emit next sequential label Label
+J(x) goto label #x Jump
+
+Z(a,d) if a is 0 goto d (a is 0 or 1) Zero
+E(a,d) if a is 1 goto d (a is 0 or 1) Else
+
+H halt Haly
+
+K(x) let x = number of cmd line arguments Kount
+G(x,y) let x = the value if the yth argument Get argument
+
+T end of code; begin output section Terminate
+X(y) print out hexadecimal value of y heXadecimal
+T end of output section and program TerminateHow it
+works, i.e., how to get useful programs from a op= b
+if (x) y = z;x to be either 0 or 1,
+and simply compute:y = (z * x) + (y * (1-x));temp = z; (temp == z)
+temp -= y; (temp == z-y)
+temp *= x; (temp == (z-y)*x)
+y += temp; (y == (z-y)*x + y)
+ ( == z*x - y*x + y)
+ ( == z*x + y*(1-x))if (pc == some_constant) y = z;pc == some_constant) flag right after the above
+temp *= x.pc == some_constant requires one more trick.
+We assume that numbers can only be in some limited range. Then we use
+successive additions and divisions to reduce that number down to
+-1, 0, or 1. You could, for
+instance, do this by using mod by 2 and div by
+2 to count bits, stopping after, say, 32
+iterations. The number you get is between 0..32, so another
+6 iterations on it reduces it to 0..6. Three
+iterations on this produces 0..2 (3 would be
+7), and then two iterations on this produces 0 or 1.
+Instead I use a shorter two-divide approach that assumes I’m allowed to
+use numbers slightly larger than the numbers I’m operating on.y/x will not work
+correctly, because every value is computed, even if the pc is not set
+correctly; if x is ever 0 when the real C code
+reaches this computation the program will die. (This was discovered the
+hard way.) The solution is to stick x in a temporary, and
+if the current code is not about to be executed, set the temporary to
+1.buzzard.1 was originally named ‘cb’, for obvious
+reasons, and is dedicated to the memory of Charles Barrett.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1992/buzzard.1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 buzzard.2
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/buzzard.2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Sean Barrett
+Location: unknownTo build:
+make allTo use:
+first is made first (even
+though make all should make first first :-) ):make first# get help:
+echo help | cat third help.th - | ./first
+
+# try out a demo:
+cat third demo5.th | ./firstcat third help.th - | ./first
+2 3 + . crcr.
+Sorry, this is third!Try:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+buzzard.2.alt as you would buzzard.2
+above.Alternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+What it does
+first implements a relatively primitive stack machine.
+How primitive? It supplies 13 visible primitives: 3 arithmetic, 1
+comparison, 2 memory-access, 2 character I/O, 3 primitives for defining
+new words, 1 tokenizing, and 1 special stack operation. (There are also
+three internal operations for the stack machine: ‘push this integer’,
+‘call this code’, and ‘compile a call to this code’.)How to run it
+first expects you to first enter the names of the 13
+primitives, separated by whitespace–it doesn’t care what you name them,
+but if all the names aren’t unique, you won’t be able to use some of
+them. After this you may type any sequence of valid first
+input. Valid first input is defined as any sequence of
+whitespace-delimited tokens which consist of primitives, new words
+you’ve defined, and integers (as parsed by "%d"). Invalid
+input behaves unpredictably, but gives no warning messages. A sample
+program, demo1.1st, is included, but it only works on ASCII
+systems.first.first the
+file third first. In unix, you can docat third help.th - | ./firstTHIRD will prompt
+you when it is finished. The file third has not been
+obfuscated, due to sheer kindness on the author’s part.help and consult FORTH
+manuals for further reference. Six sample THIRD programs are included in
+the files demo[1-6].th. buzzard.2.README.md has more
+information.first, and are
+for the most part limited by first’s tokenizer (notably,
+unknown words will attempt to be parsed as integers.) It is possible to
+build a new parser that parses by hand, reading a single character at a
+time; however, such a parser cannot easily use the existing dictionary,
+and so would have to implement its own, thus requiring reimplementing
+all of first and third a second time–I did not
+care to tackle this project.Compiling
+first is reasonably portable. You may need to adjust the
+size of the buffers on smaller machines; m[] needs to be at
+least 2000 long, though.first is portable mainly because it uses native
+types. Unlike
+[FORTH](https://en.wikipedia.org/wiki/Forth_(programming_language),
+which traditionally allows byte and multi-byte operations, all
+operations are performed on C ints. That means
+first code is only as portable as the same code would be in
+C. As in C, the result of dividing -1 by 2 is
+machine (or rather compiler) dependent.How is first obfuscated?
+first is obfuscated in several ways. Some minor
+obfuscations like &w[&m[1]][s] for
+s+m[w+1] were in the original source but are no longer
+because, apparently, ANSI doesn’t allow it
+(gcc -ansi -pedantic doesn’t mind it, though.)register allocate
+it.)m[0] is
+the “dictionary pointer”, used when compiling words, and
+m[1] is the return stack index. Both are used as integer
+offsets into m. Both are kept in m, instead of
+as separate pointers, because they are then accessible to
+first programs, which is a crucial property of
+first. Similarly the way words are stored in the dictionary
+is not obvious, so it can be difficult to follow exactly what the
+compiler words are doing.first to this point may think
+they know the answer to this question, but they may not know the answer
+to the more important question, “what will this program do when given
+the right input?” FORTH
+aficionados, and especially FORTH implementers, may recognize the
+similarity of the internal compiler format to many FORTH internal
+representations, and, being aware that FORTH interpreters can often be
+self-compiling, may be suspicious that this program can compile FORTH,
+or a significant subset of it, or at least be capable of doing so if fed
+the right input. Of course, the name “THIRD” should be a dead giveaway,
+if the name “first” wasn’t. (These numbers were largely chosen because
+they were five letters long, like “FORTH”, and would not require
+truncation to five letters, which would be a dead giveaway. Besides,
+THIRD represents a step backwards, in more ways than one.)What exactly is
+first,
+then?first is a tiny interpreter which implements a
+sufficient pseudo-subset of FORTH
+to allow it to bootstrap a relatively complete version of FORTH (based
+loosely on forth79), which I call THIRD. Complete relative to what, I’m
+not sure.first is close to the smallest amount of code
+possible to get this effect using forth-style primitives, and
+still have some efficiency (it is possible to get by without
+multiplication if you have addition, obviously). In the design file,
+design, I give a justification for why each primitive in
+first was included.first has so few primitives
+that many things that are primitives in FORTH
+(like swap) take a significant amount of time in THIRD.Ok. message from third,
+try out some sample FORTH
+code (first has no way of knowing if keyboard input is
+waiting, so it can’t actually prompt you in a normal way. It only prints
+'Ok.' after you define a word).2 3 + . cr
+5
+: test 11 1 do i . loop cr ;
+test
+1 2 3 4 5 6 7 8 9 10THIRD, you can see how much space you’re
+currently using by typing:
+here .ints) that the dictionary (the first code) takes up, plus
+the 512 ints for the return stack. If you compile the basic
+THIRD system without the help word (strings take up one int
+per character in the string!), you should find that you’re using around
+1000 ints (plus the return stack).ints
+of memory–and it’s portable too (you could copy over the THIRD memory
+dump to another machine, in theory). If the above numbers seem to you to
+be mixing apples and oranges (C source and compiled THIRD code), note
+that you should in theory be able to stick the compiled THIRD code into
+the C source.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1992/buzzard.2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 gson
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/gson
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Andreas
+Gustafsson
Location: FITo build:
+make allBugs and (Mis)features:
+
+STATUS: uses gets() - change to fgets() if possibleTo use:
+./ag word word2 word3 < /path/to/dictionaryTry:
+
+/usr/share/dict/words
+/usr/share/lib/spell/words
+/usr/ucblib/dict/words
+/dev/null # <-- for machines with nothing to say./ag free software foundation < /usr/share/dict/words
+./ag obfuscated c contest < /usr/share/dict/words
+./ag unix international < /usr/share/dict/words
+./ag george bush < /usr/share/dict/words
+./ag bill clinton < /usr/share/dict/words
+./ag ross perot < /usr/share/dict/words
+./ag paul e tsongas < /usr/share/dict/wordsJudges’ remarks:
+cat README.md | ./mkdict.sh > wordswords.Author’s remarks:
+What it does
+How to use it
+#!/bin/sh
+z=a-z];tr [A-Z\] \[$z|sed s/[\^$z[\^$z*/_/g|tr _ \\012|grep ..|sort -u./ag -4 international obfuscated c code contest </usr/dict/words.Bugs and limitations
+
+
+Obfuscatory notes
+How it works:
+
+32*4-bit arrays are actually stored in memory in a
+“bit-transposed” format, as arrays of four long values. It
+is assumed that a long is at least 32 bits. The first 4-bit
+letter count is formed by the least significant (2^0) bit
+in each of the four longs, the next one is formed by the
+2^1 bits, etc.a+b = a-(0-b).32*4-bit representation, AG also
+forms a so-called “signature” that is the bitwise OR of the four
+longs, which is equivalent to saying that the signature of
+a word contains a logical 1 in the bit positions corresponding to
+letters occurring at least once in that word.longs, one for each 8-bit character value. The entry for a
+character will be zero if that character doesn’t appear in the sentence
+given on the command line, or it will have a single bit set if the
+character does appear in the sentence. By adding together the bit masks
+for all the letters in the input sentence using the transpose addition
+method described above, AG forms the 32*4 bit array
+representation of the input sentence.32*4 bit
+array.32*4-bit representation, together with their
+signatures and offsets into the dictionary file so that the plain-text
+version of a word can later be found for printing. This information is
+kept in a local struct in the dictionary-reading function,
+and memory is allocated for each candidate word simply by making another
+recursive call to that function.struct so allocated is linked into a fixed-size
+hash table of 4096 entries indexed by the 12 low bits of the word’s
+signature. When the dictionary-reading function encounters end-of-file,
+all the candidate words have been stored in nested activation records on
+the stack, accessible through the hash table.1s in a vector of 32 borrow bits
+returned by the subtraction routine), the word did not match the current
+sentence and is ignored. Finally, if the result contained only
+non-negative letter counts, we have found a partial anagram: a word
+containing some, but not all, of the letters in the current sentence. In
+this case we recursively try to find an anagram of the remaining
+letters. The depth of the recursion is limited to the maximum number of
+words in the anagram, as specified by the user.i that contain zeroes in all the bit
+positions where the signature s of the current sentence
+contains a zero; this can be expressed in C as
+(i & ~s == 0).s to ones, we
+can make the carries generated in incrementing i propagate
+straight across those bits that should remain zero. For example, the
+following program prints all those 16-bit integers that contain zeroes
+in all even bit positions:main(){int i=0,s=0xAAAA;do{printf("%04x\t",i);}while(i=((i|~s)+1)&s);}structs in the activation records of
+the recursive invocations of the search function, seeking to the
+beginning of the word matched by that invocation, and copying the
+characters of the word directly from standard input to standard
+output.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/gson
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 imc
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/imc
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ian Collier
+Location: GBTo build:
+make allTo use:
+# text mode
+./imc -text
+
+./imcTry:
+./try.shJudges’ remarks:
+exit(3)
+returned a value which cause problems for some systems where
+exit(3) returns a void. The file imc.c
+has been modified to avoid this problem. The original file also declared
+argc to be a long which was fixed.Author’s remarks:
+Portability
+main() as a long, and passes a
+pointer to long instead of char to
+fwrite(3), giving a length value of 32 bytes for an array
+of 8 longs. I guess that makes this program OK on most
+flavours of unix, but not on PCs.About the program
+t as a parameter is a good move. Otherwise,
+direct the output into a file. The resulting file is most useful on
+SunOS, where the file(1) command will tell you what to do
+with it. For best results with the t option, you may want
+to change the definition of the I macro :-) Details appear
+later, though the formatting of the code is a large clue.; and
+) in for(;;). That isn’t because I want to win
+the best one-liner, but merely because it makes the code so much more
+impenetrable :-) In fact running a pretty printer on the code hardly
+improves it at all. This program has the obligatory macros with
+unmatched parentheses, and the cleverly arranged macro names and
+parameters to spell out "Ian Colliers Obfuscated C Code".
+If you expand macros, bear in mind that the more complex ones are best
+left as macros, because they have well-defined and nontrivial (IMHO)
+functions. These macros help to give the program’s parameter format its
+flexibility. The parameters are sorted out in a unique way (based on an
+idea by Pete Bevin) which hides very effectively their identities (and I
+think that using a variable called _ adds a nice touch to
+the illegibility of the code). In this section of the code, the data
+types of the numbers checked against is varied, and just because you see
+a , doesn’t mean it has anything to do with commas! So I
+hope you will agree that this program is more than a little
+obfuscated…xloadimage we have
+is able to view such files, and so is Sun’s screenload
+command. [Note: the header contains eight 4-byte integers, the byte
+order in which depends upon the machine. On Sun workstations they are
+stored MSB first].I macro will be
+used to create up to 16 different shades of grey. Quite a respectable
+picture can be gained by printing a 130x110 output on a dot matrix 132
+column printer with the linefeed set to 7 points. Text output also
+gives a good picture when used in an X window with small characters
+having a square aspect ratio.[!-/]) and may be followed by other letters, so for
+example:
+
+
+
+-size123 all characters
+following the initial s are ignored). Numbers need not be
+specified, as each has a default value. In all cases except for
+j, t, and s whenever it appears
+before t, specifying an option without numbers has no
+effect. (specifying -s -t has the effect of producing text
+with the default raster size; not a good idea!).Options
+
+-centre x y (float x,y) Centre the picture at x+iy in the complex
+ plane (default x=0 y=0)
+
+
+-factor f (float f) Use f pixels per unit of the plane (default
+ f=x/4 where x is the width)
+
+
+-julia x y (float x,y) Draw a julia set. Use x+iy as the constant
+ to add after squaring (default x=0 y=0)
+
+-limit l (int l) Use l iterations maximum (default l=128)
+
+-mask m (int m) Use m as a mask in deciding the colour of each
+ pixel (see below) (default m=1)
+
+-size x y (int x,y) Produce an x-by-y output (default for raster
+ x=768 y=768; default for text x=63 y=23)
+
+-text Produce text instead of raster.Example pictures to try
+./imc -s 512,512 -f 600000 -l 512 -m 16 -c.00805,.74274 > screen1.ras
+./imc -s512,512 -j-.523,-.535 > screen2.rasCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/imc
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 kivinen
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/kivinen
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Tero Kivinen
+Location: FITo build:
+make altBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTo use:
+./kivinen.alt
+
+./kivinen.alt a
+
+./kivinen.alt a bTry:
+usleep(3) value to 30000
+from 20000, try:make clobber SLEEP=30000 alt # make it slower
+
+make clobber SLEEP=10000 alt # make it fasterOriginal code:
+Original build:
+make allOriginal use:
+kivinen as you would kivinen.alt.Judges’ remarks:
+-lsocket -lresolv -lnsl. Such systems should compile using
+-lX11.exit(3) returned a value which cause problems for some
+systems where exit(3) returns void. The file
+kivinen.c avoids this problem.Author’s remarks:
+X Entertainment Kit
+Space Invaders
+Controls
+
+
+Breakout
+Controls
+
+
+Dropout
+Controls
+
+
+Starting a game
+
+
+Scores
+Features
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/kivinen
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 lush
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/lush
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ed Luke
Location:
+USTo build:
+make allBugs and (Mis)features:
+
+STATUS: doesn't work with some compilers - please provide alternative code or fix for more compilersTo use:
+./lush.shJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/lush
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 marangon
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/marangon
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Andrea
+Marangoni
Location: ITTo build:
+make allTo use:
+./marangonJudges’ remarks:
+-ltermcap as
+well as -lcurses.exit(3) returns a value which cause
+problems for some systems where exit(3) returns a
+void. The file marangon.c avoids
+this problem.Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1992/marangon
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 nathan
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/nathan
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Nathan
+Sidwell
Location: GBTo build:
+make allTo use:
+./nathan
+# enter some textTry:
+./try.shJudges’ remarks:
+WARNING:
+/usr/games/nathan.
+:-)Note from the
+judges about the winning category::
+Historical
+notes from the judges about this entry:
+make nathan
+./nathanPersonal note from chongo:
+Author’s remarks:
+Program use
+' ' or > 0x7e) are passed unaltered, thus
+any kind of file may be successfully processed, but if the original is
+printable, the processed file will be too. The input is read from
+stdin, and the output presented to stdout. The
+key, a text string, is presented as a command argument. This is
+optional, and if omitted, the file is self-{de,en}crypted. To specify
+decryption, a - should be given before the key. (Actually
+encryption and decryption proper inverse operations, so you can use
+decrypt to scramble and encrypt to descramble, if you’re perverse.)Portability
+(A little knowledge is a dangerous thing)
+gcc -ansi -pedantic -O -Wall with no warnings (You may get
+assignment in conditional warnings on other platforms though). Because
+I’ve heard that conditional jumps slow down fast processors, I’ve
+eliminated all the ifs from the code; indeed, as its only
+one statement, it should compile to one instruction and a suitably
+designed CISC machine. To speed compilation, there is only one statement
+in the loop, so that another scoping level does not need to be
+opened.Obfuscation
+, and ?:. These are really confusing when used
+together, nested or put in argument lists (is that a comma operator, or
+argument separator?).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/nathan
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 vern
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/vern
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Vern Paxson
+Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./vern 3 # <-- default is 2Try:
+
+63 43
+76 55
+71 52
+67 57 # <-- this may take a whileJudges’ remarks:
+./vern
+
+65 55
+66 46Author’s remarks:
+(0,0) for the upper-left-hand
+corner (black’s queen’s rook) and going to (7,7) for the
+lower-right-hand corner (white’s king’s rook). For example, the
+PK4 opening for white is indicated as
+"64 44" (without the quotes). Moves are read using
+scanf() so care should be taken to not enter the wrong
+number of fields."1351 9 2 >". The first number is how many board
+positions the program examined when computing its previous response. The
+second number is its anticipated value for the move it just made (with
+larger numbers meaning an ultimately better board position for it), and
+the third number is the evaluation it assigns to the your current
+position (larger numbers meaning better positions for you). A
+> indicates that you are not in check; for check it is
+changed to !.
+
+PK4 opening takes about 1.8 CPU seconds on a SPARC
+ELC when compiled -O with Sun cc. A ply of 3
+takes 13 CPU seconds (and results in a different response to
+PK4) and a ply of 4 takes a little under 4 CPU minutes (and
+for PK4 comes up with the same response as a ply of 3). A
+ply of 3 is in general good enough to avoid not only flaming blunders
+but also immediately stupid moves altogether. A ply of 4 will find all
+mate-in-two’s.Obfuscation
+sed <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
+ sed 's/} /=/g;s/{ /i/g' >vern.tmp.cvern.tmp.c.64, 8, and 3
+(lg 8). Rather than making these available at compile-time,
+which provides a hint as to what the program is up to, they are computed
+probabilistically at run-time. An instance of the “Inspection
+Paradox” is used which happens to produce a value that on average is
+close to .64. 10000 instances of this value
+are computed, added up, and then divided by 100. Sometimes
+the value produced will be 63 or 65 instead of
+64 (but I’ve never observed any other values), so the
+result is then rounded to the nearest multiple of 4, and
+then the other constants are derived from it.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/vern
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1992 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1992/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fix
+STATUS: known bug - please help us fixTo use:
+./whereami lat long
+
+# or, if you don't have curses installed:
+./westley lat longlat and long correspond to your
+latitude and longitude.whereami and
+whereami.alt code checks this but it is not prohibitive if
+it cannot be compiled and linked (it uses curses); instead one should
+just use the westley and westley.alt programs
+directly.Try:
+./whereami 47 -122 # NOTE: - means west of meridian
+./whereami 47 122
+
+# or if you don't have curses installed:
+./westley 47 -122
+./westley 47 122Alternate code:
+Alternate build:
+make altAlternate use:
+./whereami.alt lat long
+
+# or if you don't have curses installed:
+./westley.alt lat longJudges’ remarks:
+./whereami 37 -122 # NOTE: - means west of meridian
+
+# or if you don't have curses installed:
+./westley 37 -122 # NOTE: - means west of meridianAuthor’s remarks:
+'!' with the
+given position marked with either a '"' (if the position is
+over a '!') or a # (if the position is over a
+space). Southern latitudes and western longitudes are entered as
+negative numbers. For example, to find San Francisco, run with
+./whereami 38 -122. The resolution of the map is five
+degrees horizontally, ten degrees vertically. The map is a Mercator
+projection with equal spacing of the latitudes, so the areas near the
+poles are very distorted. Latitudes near the poles and Antarctica are
+not shown.putchar(),
+atoi(), and a display that auto-wraps at 80 characters(!).
+If your display does not work this way, you will have to massage the
+output; for example, you can redirect it to a file and edit it with vi,
+which will do auto-wrap for you.main() returns a random value and
+I’m not checking the value that putchar() returns.
+Scandalous!How it works:
+' ' and
+'!' characters, with the auto-wrap used to stack up slices
+of 80. The map data is a string; the first character is how many
+!s are printed ('A'=1, 'B'=2,
+etc), the second character is how many ' 's, the third is
+how many !s, etc. ASCII characters less than
+'A' print no characters but still change the polarity, so
+any map of ' 's and '!'s is possible. This is
+done in the putchar() argument as 33^l&1,
+where l is the character position+4; if
+l is odd, ' ' is printed, if l is
+even, '!' is printed.d = latitude/10*80 - longitude/5 - offset. The latitude is
+divided by ten because the vertical resolution is ten degrees, then
+multiplied by 80 because of the 80 character wrap (i.e. each ten degrees
+moves the position up or down one entire row). The longitude is divided
+by five and added, because five degrees of change moves the location one
+character. The signs are opposite because latitude is decreasing and
+longitude is increasing as you go from upper left to lower right. The
+offset is where the origin (latitude=0, longitude=0) is found.putchar()
+from printing ('!' or ' ') to printing
+('"' or '#')."H E L L O, W O R L D!" string inside the data
+string prints the line of blanks past Tierra del
+Fuego and the last blank line. It’s just for show, really.Here are some cities
+you might like to try:
+
+
+
+
+
+
+main(l,a,n,d)char**a;{for(d=atoi(a[1])/2*80-atoi(a[2])-2043;
+n="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd"
+[l++-3];)for(;n-->64;)putchar(!d+++33^l&1);}main(l,a,n,d)...
+[A M E R I C A]...Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1992/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 ant
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/ant
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anthony C.
+Howe
Location: CATo build:
+make allBugs and (Mis)features:
+
+STATUS: missing file - please provide itTo use:
+./ant 'ERE' [file ...]Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/ant
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 cmills
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/cmills
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Mills
Location: USTo build:
+make altX11/Xlib.h header file and
+the X11 library to compile. If you’re under macOS and do not know how to
+install and use X11 programs see FAQ 3.7 - How
+do I compile and use on macOS, an IOCCC winner that requires
+X11?.make clobber SLEEP=200 altBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTo use:
+DISPLAY="your_X_server_display"
+export DISPLAY
+./cmills.alt [speed] # must be run on an X11 serverspeed is update speed from 1 to 9 (default is 9).DISPLAY should already be set.Original code:
+usleep(3) to more
+easily see what is going on but you can use the original without any
+delays if you wish.Original build:
+make allOriginal use:
+cmills as you would cmills.alt
+above.Judges’ remarks:
+
+"Since 1984, a contest has been held on Usenet for the most
+unreadable, creative, bizarre but working C program", Gates
+said. "What is the name of this contest"
+
+"Windows," shot back Gassee, naming Microsoft's premier product
+- a product over which Apple sued Microsoft five years ago. Not
+the right answer - it's "The Obfuscated C Contest [sic]" - but
+it brought down the house of Apple partisans...$DISPLAY in your environment or the program
+will dump core. This is not a bug as the author documented it as a
+feature. :-)Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/cmills
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 dgibson
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/dgibson
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: David Gibson
+Location: unknownTo build:
+make allTo use:
+./dgibson.sh [datafile]datafile is the initial pattern (default: dgibson.data1)Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+Some notes
+
+
+main() in two “directions”
+simultaneously.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/dgibson
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 ejb
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/ejb
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: E. Jay
+Berkenbilt
Location: unknownTo build:
+make allTo use:
+./ejb levellevel a value from -128 to 127Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+What this program does
+Output
+solution to Towers of Hanoi for five rings:
+./ejb 5Output
+solution to the Patience puzzle for six rings:
+./ejb -61 means the ring is on the
+U; a 0 means it is off the U. The
+program prints the word "Invalid" in response to illegal
+command line parameters.Motivation
+return, and the only function
+defined in the code is main(). The level of complexity of
+the program without multiple semicolons, statements, and functions is
+achieved by abusing C operators, especially the comma operator.
+Considerable use of ||, &&, and
+?: helps too. In addition, main() is called
+recursively. The NULL pointer that terminates argv is used
+to pass additional information into main(). Even though the
+algorithms used by this code are simple, this program is still hard to
+follow even when indented properly. (It is pretty hard to indent this
+code reasonably, however.)atoi(), malloc(), memset(),
+printf(), and puts(). It does, however,
+require that the architecture it runs on have bytes that are at least
+eight bits long and pointers that are at least four bytes long. In
+addition, it requires an ANSI compiler since it uses
+signed char and ANSI-style function declarations.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/ejb
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 jonth
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/jonth
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jon Thingvold
+Location: NOTo build:
+X11/Xlib.h header file and the
+X11 library to compile. macOS users running Mountain Lion and later will
+need to download and install XQuartz in order to compile and run
+this entry.make allTo use:
+./jonth # must be run on an X11 serverJudges’ remarks:
+h and l to shift objects left or right.
+Use k to rotate and press SPACE to drop.Author’s remarks:
+jonth (jon's t(h)etris) for the X
+Window System.t,
+u and F.sizeof(int)!=sizeof(void *).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/jonth
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 leo
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/leo
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Leonid A.
+Broukhis
Location: USTo build:
+make allTo use:
+./leo [colors]./mind [colors]Judges’ remarks:
+Author’s remarks:
+(bulls * 16 + cows) from two numbers is, however, quite
+straightforward :-) , as well as the arithmetic of binary coded
+colors-base numbers is.Limitations:
+maximum number of digits (colors) is 14 (1..F).
+Bugs
+EXAMPLE: Suppose we think of
+1234
+
+$ ./leo
+(1296): 6433
+?? 12 # one 3 is a bull, another is a cow, and 4 is a cow
+(160): 5363
+?? 02 # both 3's are cows
+(21): 4231
+?? 22 # 2 and 3 are bulls, 4 and 1 are cows
+(2): 4132
+?? 13 # 3 is a bull; 1, 2 and 4 are cows
+(1): 1234
+?? 40 # you may enter everything thereEXAMPLE: Guess the
+computer’s number
+
+$ ./mind
+(1296): ???? 1122 # my strategy isn't the best, just as example
+00
+(256): ???? 3344
+20
+(18): ???? 5566
+02
+(6): ???? 3654
+11
+(2): ???? 3355
+00
+(1): ???? 6444
+40 # we have guessed the numberCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/leo
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 lmfjyh
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/lmfjyh
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jyrki
+Holopainen
Location: FITo build:
+make all";main(){puts("Hello World!");}char*C=".c which would print
+Hello World! when compiled.make.Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./lmfjyhAlternate code:
+Alternate build:
+make altAlternate use:
+lmfjyh.alt as you would lmfjyh above.
+Note that other code could also be done with the bug that the entry
+abuses but that would have to be manually programmed for this version;
+see the author’s remarks for more details.Judges’ remarks:
+Author’s remarks:
+Introduction
+Listing 1: A simple
+“Hello World” program
+main()
+{
+ puts("Hello World!");
+}Packing method
+Listing 2: Compressed “Hello
+world”
+char*_=__FILE__;Listing 3: Code
+embedded in the file name
+";main(){puts("Hello World!");}char*C=".ccc hello.c -DX='main(){puts ...'. With this method
+nothing is gained, since the compiling commands must be stored in a
+file, and that takes even more space than writing the code in a source
+file as presented in listing 1.Packing files in a UNIX
+environment
+/ is used to
+separate path components and cannot therefore exist in a file name, all
+features of the C language cannot be used./ is used as a division operator and it may
+also be a part of a comment start and end identifier. This, however, is
+not a dangerous limitation, since practice has shown that comments are
+almost totally unnecessary. A real programmer can more easily understand
+pure source code, and misleading comments are disastrous. The division
+operation may be replaced with pow(x, -1) and
+multiplication when using real numbers or with div()
+function when using integers.Usage with currently
+available tools
+Compilers
+
+
+
+
+Other tools
+Debuggers: (tested at SunOS
+4.1.2)
+
+
+dbx - Quit with a very ‘informative’ error message:
+"dbx: fatal error: Is a directory"": Is a directory". It was, however, possible to step
+through the code but not list it.Lints
+Conclusions
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/lmfjyh
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 plummer
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/plummer
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark Plummer
+Location: unknownTo build:
+make altusleep(3)) in between writes, defaulting at
+1000 microseconds (but reconfigurable). If you wish to see the original
+entry then see original code below.make clobber SLEEP=500 altmake clobber SLEEP=1500 altTo use:
+./plummer.alt number arg
+
+Try:
+./try.alt.sh
+
+./try.alt.sh 21701
+
+SLEEP=500 ./try.alt.sh
+
+SLEEP=900 ./try.alt.sh 789789789789789
+
+./try.alt.sh 789789789
+
+SLEEP=400 ./try.alt.sh 42424242424242
+
+SLEEP=1000 ./try.alt.sh xyzzyzzyx
+
+SLEEP=1200 ./try.alt.sh xyzzyzzyx 5555Original code:
+SLEEP parameter
+specified in the build of alt, of course).Original build:
+make allOriginal use:
+plummer as you would plummer.alt
+above.Original try:
+./try.sh
+
+./try.sh 21701
+
+./try.sh 789789789789789
+
+./try.sh 789789789
+
+./try.sh 42424242424242
+
+./try.sh xyzzyzzyx
+
+./try.sh xyzzyzzyx 5555Judges’ remarks:
+Author’s remarks:
+0s to
+indicate the number of digits, the second argument can be anything but
+must be present.O for 0 (zero),
+l for 1 (one), S for
+5 (five) in some fonts, and _ for … well
+nothing really, but it is easy to miss). To prevent the need for
+strlen(), the fact that argv is laid out sequentially is
+exploited
+(i.e. argv[i + 1] == argv[i] + strlen(argv[i]) + 1). This
+is not portable (by the books), but it seems to work everywhere I try
+(actually, for VMS, that only holds for i > 1). Also, I
+depend on the fact that a carriage return causes the line just written
+to be overwritten. lint (and most compilers) complain that
+there is no control path leading to a return from main().
+At 125 characters, it still fits on a single line (for those of us who
+don’t mind ruining our eyes with 132 column screens).Spoiler:
+l (the argument
+vector) to be the first argument by incrementing it. It then assigns
+O to point to the character before the first character of
+the second argument which also happens to be the NUL termination of the
+first argument. *O gets a \r assigned to it.
+Finally 0 is assigned to the first character of the second
+argument which has the effect of NUL terminating the first argument
+after the carriage return had removed its NUL termination. I really
+tried to make the last part of that statement part of the original
+expression, but the best I could do was attach it with a comma (against
+the advice of K&R). The for loop runs the next for loop continuously
+(actually until the machine crashes or the user gets tired of seeing the
+counting). The next for loop is the meat of the program. In the
+initialization statement, the string pointed to by l (the
+first argument containing the digits used for counting followed by a
+\r) is printed, and _ is started at the least
+significant digit in the string. In the test portion, _ is
+ensured not to be past the beginning of the string (the most significant
+digit), and the digit pointed to by _ is incremented and
+checked to be sure that it is greater than 9
+(written here as (S+*O+S)*S). If the test fails, either the
+string has been incremented or each digit in the string has been reset
+to 0. If the test succeeded, the iteration statement
+assigns 0 (written here as (S+*O)*S (which has
+the added bonus of having the code be a cry for help)) to
+*_ and decrements _ to point to the next more
+significant digit to be incremented; it is done only when a carry
+situation results (*_ has been incremented past
+9).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/plummer
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 rince
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/rince
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: James
+Bonfield
Location: GBTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./rince [cabbage][cabbage] is a CABBAGE description file (default:
+rince.c)Alternate code:
+struct timeval v= {0,1<<17} ;refresh(),c=select(k,&y,0,0,(v.tv_usec=1<<17,&v))?getch():0;h for left, l for right
+(that was not changed) and k for fire (that was also not
+changed).Alternate build:
+make SLEEP=18 clobber altAlternate use:
+rince.alt or rince.alt2 as you would
+rince above.Judges’ remarks:
+
+
+, for left, / for right, and .
+for ‘fire the ball’.o character. You must push the money m
+into the dotted region of the screen. The game is considered finished
+when all the ms are then Ms.WARNING for SunOS 4.1.x:
+Additional notes
+rince dumps core on their
+system.curses.h used by gcc
+(typically /usr/local/include/curses.h if not
+/usr/include/curses.h) is not compatible with the curses
+library (typically /lib/libcurses.a for static libraries)
+used. It has been suggested that the following gcc command may help:gcc -fno-builtin -I/usr/include -o rince rince.c -lcurses -ltermcapAuthor’s remarks:
+./rince gamefile, where gamefile is a game
+description file. A few are supplied for your enjoyment. Alternatively,
+with no arguments it will default to using it’s own datafile (the source
+code in fact). This happens to be a game of Space Invaders.
+To prevent people from firing too often a very simple method is
+employed; you must move after firing to be able to fire again.Keys
+
+
+j - Leftl - Rightk - Fire./rince [data_filename]Portability
+
+System OS Compiler (and flags)
+DECstation 5000/240 Ultrix 4.2A c89 -std
+SPARCstation 1+ SunOS 4.1 gcc -ansi -pedantic
+SPARCstation 10/31 Solaris 2.1 gcc -ansi -pedantic (*)
+DECAlpha 3000/500 OSF/1 V1.2 c89 -std
+SGI Indigo (R4000) IRIX 4.0.5F cc -ansi
+Alliant FX2800 Conentrix 3.0.0 fxcUnix. This compiles, and indeed runs on all the others
+(both BSD and SysV) correctly.select(2),
+or curses, (or perhaps conflict of the two).select(2) no doubt makes it less portable to
+STRICT SysV machines. However I have tested this on several so-called
+SysV machines, and all of them support select(2). In fact,
+the select(2) they support appears to be more portable
+between them than their poll() call.Obfuscation
+sizeof confusion) I have
+not seen in any winners (hmmm - perhaps there’s a reason for that…) so
+far. Also, very poor structure (yes, I use goto’s) has led
+to apparently having an fgets() as the last line of main.
+Note that I have still tried to aim at least some efficiency (provided
+it makes things slightly more obfuscated of course). One such thing is
+the way I dynamically allocate a 2-dimensional array using only ONE
+malloc(). Hence this program could be used as a tutorial
+for all those people who consistently ask this question in the C
+newsgroups.main() to one
+character identifiers, but in my opinion they add to obfuscation in this
+case by being longer.lint complains about lots of things. Firstly the use of
+curses immediately makes lint complain. The Alpha’s
+lint gave me some positive encouragement!
+precedence confusion possible: parenthesize! :-) :-)
+main() does not return correctly, because, basically, it
+doesn’t return.Bugs
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/rince
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 schnitzi
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/schnitzi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark
+Schnitzius
Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./schnitzi filefile is a file containing some text.Try:
+./schnitzi schnitzi.info
+# ask some questions suggested by the author, noted belowWho is Mark Schnitzus?
+
+Who was Jack the Ripper ?What is cat ?
+What is cat???Judges’ remarks:
+
+
+' in the question this entry
+might fail.Author’s remarks:
+./schnitzi schnitzi.info. It echoes the
+file, then gives you a prompt where you may type in questions about that
+text. The more words you use which are actually present in the text
+file, the better results you get. You’ll need to hit ctrl-c
+to break out of the program. Just hitting return at the
+prompt will reprint the paragraph.Compilation notes
+
+
+strcasecmp(3) may be non-standard.
+strcmp(3) can be substituted for it, with a slight
+performance penalty.argv[0], to hold the name of the
+executable. It is my understanding that this property of
+argv[0] is not guaranteed on some systems.Obfuscation
+
+
+system(3) calls to echo the
+text file and break up the question into individual words with a
+recursive call.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1993/schnitzi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1993 vanb
+
+
-
+ The International Obfuscated C Code Contest
+ 1993/vanb
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: David Van
+Brackle
Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./vanb 'exp'exp is an octal expression. See below for how it
+can also have hexadecimal and decimal numbers.Try:
+./try.shJudges’ remarks:
+
+unary operators: +, -
+binary operators +, -, *, /, %
+hex numbers: x or X followed by hex digits
+decimal numbers: d or D followed by decimal digits
+octal numbers: octal digits
+grouping: ()Author’s remarks:
+- is an operator.
+Thus, decimal -46 would be entered as -d46 and
+not d-46.What Makes This Program
+Special:
+
+
+main().main().printf(3) string.?:s).How It Works:
+main() for all
+of its recursion. O2 is a state variable, telling
+main() what grammar non-terminal to parse.
+**O7 is the next character. O3 is an
+intermediate result. Whenever you see a construct like:
+!(expression with O2)?O2 to see what state it’s
+in. Comparisons involving **O7 and octal constants are
+looking for certain characters.'e' denotes the empty string) :
+<E> ::= <T><E'>
+<E'> ::= +<T><E'> | -<T><E'> | e
+<T> ::= <F><T'>
+<T'> ::= *<F><T'> | /<F><T'> | %<F><T'> | e
+<F> ::= +<F> | -<F> | (<E><C> | d<D> | D<D> | x<X> | X<X> | <O>
+<C> ::= )
+<D> ::= [0-9]<D> | e
+<X> ::= [0-9]<X> | [A-F]<X> | [a-f]<X> | e
+<O> ::= [0-7]<O> | e
+<E> is 012
+<E'> is 011
+<T> is 010
+<T'> is 07
+<F> is 06
+<C> is 013
+<D> is 04
+<X> is 05
+<O> is 03N1 and N2 are notes:#define O5 main
+O5(O2,O7,O3)char**O7;
+{
+ return
+/* N1 */ !(O2+=~01+01) ?\
+ 00:
+/* N2 */ !(O2-=02>01) ?\
+ printf("\045\157\012",O5(012,O7+01,00)):
+/* O */ !(O2-=02>>01) ?\
+ (**O7<=067 && **O7>057 ? O5(03,O7,*(*O7)++-060+010*O3):O3):
+/* D */ !(O2-=-O3-~O3) ?\
+ (072>**O7 && 060<=**O7 ? O5(04,O7,012*O3-060+*(*O7)++):O3):
+/* X */ !(O2-=!O3+!!O3) ?\
+ (**O7>057 && **O7<=071 ? O5(05,O7,*(*O7)+++O3*020-060):
+ **O7<=0106 && 0101<=**O7 ? O5(05,O7,020*O3+*(*O7)++-067):
+ 0140<**O7 && **O7<0147 ? O5(05,O7,-0127+*(*O7)+++020*O3):O3):
+/* F */ !(O2-=02-01) ?\
+ (**O7==050 ? 050**++*O7,O5(013,O7,O5(012,O7,00)):
+ **O7<056 && 054<**O7 ? 055**++*O7,-O5(06,O7,00):
+ 054>**O7 && 052<**O7 ? 050**(*O7)++,O5(06,O7,00):
+ !(**O7^0170)||!(0130^**O7) ? *++*O7,O5(05,O7,00):
+ **O7==0144||**O7==0104 ? ++*O7,O5(04,O7,00):O5(03,O7,00)):
+/* T' */ !--O2 ?\
+ (**O7==052 ? O5(07,O7,O3*(*++*O7,O5(06,O7,00))):
+ !(045-**O7) ? O5(07,O7,O3%(03+(*O7)++,O5(06,O7,00))):
+ !(**O7^057) ? O5(07,O7,O3/(03-*++*O7,O5(06,O7,00))):O3):
+/* T */ !(O2+=01-02) ?\
+ O5(07,O7,O5(06,O7,00)):
+/* E' */ !(O2+=-02/02) ?\
+ (!(**O7-053)?O5(011,O7,O3+(++*O7,O5(010,O7,00))):
+ !(055^**O7) ? O5(011,O7,O3-(03+*(*O7)++,O5(010,O7,00))):O3):
+/* E */ !(O2-=0563&0215) ?\
+ O5(011,O7,O5(010,O7,00)):
+/* C */ (++*O7,O3);
+}N1: It should never enter this state, unless the
+user invokes the program with no parameters, in which case it just
+returns 0.N2: Since the program is properly invoked with 1
+parameter, this is the first state it will go into. This state just
+invokes printf, and sends the parser to state 012 (which is
+<E>).E and T states work like this:int e(){ return eprime( t() ); }E' and T' states work like this:int eprime( int intermediate )
+{
+ if( ch == '+' )
+ {
+ ch = nextchar();
+ return eprime( intermediate + t() );
+ }
+ else return intermediate;
+}D, X and O states work
+like this (they assume that they’re initially called with
+0):int octal( int intermediate )
+{
+ if( ch>='0' && ch<='7' )
+ {
+ intermediate = intermediate * 8 + ch - '0';
+ ch = nextchar();
+ return octal( intermediate );
+ }
+ else return intermediate;
+}F and C work similarly.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1993/vanb
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 dodsond1
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/dodsond1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Dodson
+Location: USTo build:
+make allTo use:
+./dodsond1Try:
+E3.Judges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1994/dodsond1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 dodsond2
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/dodsond2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Dodson
+Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./dodsond2Alternate code:
+Alternate build:
+make altmake clobber ARROWS=5 altAlternate use:
+./dodsond2.altJudges’ remarks:
+A historical note:
+
+dodsond2.gz: gzip compressed data, last modified: Mon Aug 29 21:54:39 1994, max compression, from Unix, original size modulo 2^32 2652
+2) Your entry must be <= 3217 bytes in length. The number of characters
+ excluding whitespace (tab, space, newline), and excluding any ; { or }
+ followed by either whitespace or end of file, must be <= 1536.Author’s remarks:
+s. Then give a
+list of the rooms you want to shoot into. The rooms must be connected in
+the order you list them, or else the arrow may bounce back and hit you.
+An arrow can go through as many as four rooms. But beware that shooting
+an arrow and missing the Wumpus may awaken him.q. Typing
+i will tell you how many arrows you are carrying.
+l prints the description of the current room again.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1994/dodsond2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 horton
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/horton
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mary Ann
+Horton
Location: USTo build:
+make allTo use:
+./horton A B C DA, B, C and D are
+numeric arguments.Try:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+./horton.alt A B C Dhorton.Alternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+./horton 3 2 1 0. Play with the numbers to get a
+pleasing result, or use it for your high school algebra class.SPOILER:
+make gtface
+./gtface < gtface.data
+
+ MMMM,M,MM"MM,,,
+ ,,MMMMMMMMM"""""""",
+ ,MMMMM""" ",
+ ,MMM" "
+ MMM M
+ MM
+ MM" " M
+ M " , ,,,,, ,,,,,,,,,MM
+ "MMMM"M,MMMMM MMMM M M"MMM,
+ ,M"MMMM"MM"MMM""M""MMMM""M"M
+ , MM M M,M M" "M",, M "M "
+ M ,M," ,M "M, ,,,", M
+ M , M"MMM",,M,M,,""" , ,
+ ",," , " "MMMMMMMM " , "
+ ,M , ""M,MMMMMMMM,M " ,,
+ ,MM, MMMMMMMMMMMMMM,", M,
+ M,M,MM"M"M" """M"MM,M M
+ ,MMMMMM M,MMMMM"M MM""M
+ M MMMMMM,M M"M"" M MMMM", ,
+ "M"MMMMMMMMMM"M ,MMMMM M ,,
+ "" MMMMMMM,M,MM,M,,,MMM"M ,
+ ," , "MMMMMMM"MM"M,,,,MMMMM , ,,
+ M ," MMMMMM"MM""M ,MMMMM,M, M
+ , MMMM,MMMM"M"M"M,MM,M,", "Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1994/horton
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 imc
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/imc
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ian Collier
+Location: GBTo build:
+make allTo use:
+./imc [NUMBER][NUMBER] is an optional number. Default is 5.Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+gcc -Wall is
+used.main() function has been added so that the library can be
+tested. If the program appears too large, consider that functions
+o() and s() can each be separated from the
+rest of the program (except for the short functions p() and
+r(), which they require) and used alone. However, the main
+part of the program is the function e, which does require
+all the other functions (apart from main()).SPOILER:
+o(),
+s() and e() to show how useful the word
+for is, and (in function e()) how useful the
+words if and else are. In fact, hardly
+anything happens that isn’t in one of these instructions. I did this in
+order to simplify the code - the algorithms used to make the random
+squares are quite complex without being shrouded in obfuscated code! :-)
+Incidentally, I was surprised to find out how useful the exclusive-or
+operator was while writing function s().
+o(n,a,q,d): makes a magic square of order n when n is odd and at least 3.
+s(n,a,q,d): makes a magic square of order n when n equals 4.
+e(n,a,q,d): makes a magic square of order n when n is even and at least 6.a (of type int *) points to
+an area of memory in which the magic square will be stored and
+q (also of type int *) points to an area of
+memory of length at least n*sizeof(int) bytes which can be
+used as a work space. Both a and q must be
+allocated by the caller. The integer parameter d, usually
+zero, indicates the length of a gap which will be left between adjacent
+rows of the magic square.n*n in which all rows and columns and the two
+diagonals add up to n*(n*n+1)/2.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1994/imc
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 ldb
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/ldb
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Laurion
+Burchall
Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./ldb < file
+
+some_command | ./ldbTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1994/ldb
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 schnitzi
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/schnitzi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark
+Schnitzius
Location: unknownTo build:
+make allfgets(); neither are completely
+functional. See below section bugs and (mis)features for details and the
+alternate code section for how to use.Bugs and (Mis)features:
+
+STATUS: uses gets() - change to fgets() if possibleTo use:
+./schnitzi < textfileTry:
+./try.shAlternate code:
+schnitzi.alt.c, uses
+fgets(3) but when fed its own code it will generate code
+that still uses gets(3). What’s more is it will not
+compile. Other functionality works fine.schnitzi.alt2.c, has an increased
+buffer size but when fed its own source code it will generate code that
+can compile but with the original buffer size. This is due to a comment
+which is explained in more detail in 1994/schnitzi in bugs.md.Alternate build:
+make altAlternate use:
+schnitzi.alt and schnitzi.alt2 as you
+would schnitzi above except that feeding the source code to
+it will not work right.Alternate try:
+./try.alt.shJudges’ remarks:
+./schnitzi < schnitzi.cdiff’s eye. Can
+you find out why?Author’s remarks:
+SPOILER:
+./schnitzi < info./schnitzi < schnitzi.cmain()) proved
+difficult to use in both the original and flipped versions (after
+flipping, they show up as a string of single letters on successive
+lines). However, I found that it was possible to get around this through
+a few well-placed comments. An earlier version of this program used
+nearly every single-character token in the “shared” area; however, it
+proved to be too large for contest guidelines (although the code itself
+is only about 300 characters, the extra whitespace needed to pad it put
+it over the limit – it nearly filled a 79 by 79 area, adding up to over
+4000 total characters).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1994/schnitzi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 shapiro
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/shapiro
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Andrew T.
+Shapiro
Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: missing file - please provide it
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./shapiro &Try:
+./shapiro
+^Z
+bg
+ps x
+fg
+^C
+
+./shapiro_t1ps! Observe too
+what happens after you bring it back to the foreground.Judges’ remarks:
+ps(1) and look at the new
+processes.Author’s remarks:
+
+
+stdout) another C program (shapiro_t2.c). This is the first level of
+obfuscation.make everything first) prints a clock in the upper right
+hand corner of your VTxxx/ANSI display.cb(1) and some more intelligent variable names. Once you
+get past this you will realize that the third level of obfuscation is a
+six member client/server hierarchy. (See the shapiro.md file for a detailed description of the
+algorithm.)lint complains about: precedence confusion,
+K may be used before set, main() returns
+random value to invocation environment, value type used inconsistently,
+value type declared inconsistently, function argument (number) used
+inconsistently, function returns value which is always ignored, function
+returns value which is sometimes ignored. All of which are harmless
+(famous last words).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1994/shapiro
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 smr
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/smr
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Szymon
+Rusinkiewicz
Location: USTo build:
+make allTo use:
+./smrTry:
+./try.shJudges’ remarks:
+stdout
+from the executable will exactly match the original source.Author’s remarks:
+stdout.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1994/smr
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 tvr
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/tvr
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Teemu
+Rantanen
Location: FITo build:
+make allBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTo use:
+./tvr mode screensize/2 < colormapfileTry:
+./try.color.sh # for colour displays
+./try.bw.sh # for Black & White displaysAlternate code:
+Alternate build:
+make altAlternate use:
+./tvr.alt altmode screensize/2 < colormapfilealtmode 1 - 4 correspond
+to mode 0 - 3 in the original entry and
+altmode 0 calculates Mandelbrot/Julian sets correctly.Alternate try:
+./try.alt.color.sh # for colour displays
+./try.alt.bw.sh # for Black & White displaysJudges’ remarks:
+Author’s remarks:
+Interactive Fractals
+for X Window System
+
+
+Usage:
+./tvr mode screensize/2 < colormapfilescreensize is half of the actual
+screenlength/width. I.e. if you use 128 as a second
+parameter, you will get two 256x256 windows.0 128 or
+8 128. The colormap has to be redirected into
+the programs standard input via the colormapfile parameter
+as shown above.(second_parameter^2)*64 bytes of free main memory or the
+machine will swap heavily (memory references are quite random and may
+confuse paging algorithms easily). This means that for 512x512 windows
+you will need 4M of memory.
+colormapfilecolormap. The first line of the file must be a number
+between 3..254. This informs the program how many colors
+there are to be expected. This is also the maximum number of iterations
+used on picture calculations. Lines after that are X11 color names. The
+program expects to find, and will use, the number of colors reported on
+the first line.colormapfiles to start with. One with
+colors and another with only black and white. If you have enough colors
+on your display you can use the one with colors (even on
+grayscale). The other is meant mainly for a one bit plane
+display (on which the picture looks terrible compared to a 8 bit plane
+display).Compilation
+gcc -ansi -pedantic will do fine).
+Machine OS
+------- --
+Decstation 5000/240 Ultrix 4.3A
+DECAlpha 3000/300 OSF/1 v1.3 and v2.0
+IBM RS6000 AIX v3
+SPARCStation IPX SunOS 4.1.3
+i486 Linux v1.1.8 (binarysize 3576 bytes
+ using `gcc -O6 -s -N` ;)
+HP 9000/730 HP-UXObfuscation
+cpping the code won’t give you much.
+Perhaps most notable is the algorithmic obfuscation. Simple formula has
+been turned into something completely different. Also it may be a
+surprise to find out which piece of the code calculates non-stable
+fractals and how it does that. Many obfuscations were left out of the
+program because speed of animation was one of the key issues. Well,
+obfuscated or not, some of the effects are very nice ;)Memory refreshment
+
+
+ 2
+ Z = Z + Z
+ n+1 n 0
+
+ 2
+ Z = Z + C
+ n+1 n
+C is the same throughout the picture. Both
+calculation are finished when |Z| >= 2.0. For the other
+fractals, the basic methods are the same but the formula is different
+(look at the source ;) )Bugs
+
+
+XSync(). In that case drawn data is
+lost. Also, some window manager configurations places the second window
+on top of the first and again drawn data will be lost. By default,
+windows are placed next to the other in the top left corner of the
+screen.|Z| >= 2.0 should be checked exactly (by
+comparing x*x+y*y with 2*2), or else artifacts
+are introduced. The result of this error is a “bubbly” appearance (at
+least in mono).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1994/tvr
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 weisberg
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/weisberg
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jeff Weisberg
+Location: unknownTo build:
+make allTo use:
+./weisbergTry:
+./try.shprimes(1) installed you might also wish to
+try:./primes.sh numbernumber is a positive number, defaulting to 15. The
+try.sh script will also do this.Alternate code:
+Alternate build:
+make altAlternate use:
+./weisberg.altJudges’ remarks:
+stdin instead of via cc -E.Author’s remarks:
+Description
+Bugs
+INT_MAX, the
+output produced can be quite overwhelming so it’s recommended to pipe
+the output through your favorite pager (more or
+less), and not output to a paper output device (unless you
+have LOTS of paper).Technical
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1994/weisberg
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1994 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1994/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allTo use:
+Try:
+cc -Describe -Door westley.c
+cc -Describe -Drain westley.cJudges’ remarks:
+./try.shAuthor’s remarks:
+main(){}, which does nothing and exits, so you don’t need
+to actually compile the program.#include files) as
+output. To begin, try to compile the program with no options:cc westley.c#include file as the opening description. Your terminal
+should be set for 80 columns, 8 character tabs, and wraparound, as there
+is no way to reliably output newlines. You should see something like
+this (text massaged to change wraparound to separate lines):
+ westley.c
+ westley.c(87) : fatal error C1024: cannot open include file '
+
+ You are in a debris-filled
+ dungeon; a door bars the
+ way, and sludge trickles into
+ a floor drain
+
+ '-D. For
+example, to look at the door, do:cc -Describe -Door prog.cSPOILER
+cc -Describe -Door westley.c
+cc -Describe -Drain westley.c
+cc -Describe -Dwarf westley.c
+cc -Describe -Debris westley.c # or -Dungeon
+cc -Describe -Desk westley.c
+cc -Describe -Dime westley.c
+cc -Describe -Directory westley.c
+cc -Dial -DUNgeon0614 westley.c
+cc -Drink -Daiquiri westley.c
+cc -Drop -Daiquiri westley.c
+cc -Drop -Dwarf -Daiquiri westley.c # or -Drop -Down -Daiquiri
+cc -Describe -Document westley.c
+cc -Depress -Dotted -Dog westley.c
+cc -Depress -Dalmatian westley.c # also accepts "Dalmation" [sic]
+cc -Deposit -Dime westley.c
+cc -Drop -Donut westley.c
+cc -Drop -Donut -Down -Drain westley.c # or -Drop -Dwarf -Donut
+# (at this point, you win!)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1994/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 cdua
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/cdua
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Carlos Duarte
+Location: unknownTo build:
+make altusleep(3) with
+SLEEP (defined in the Makefile, default 3000)
+microseconds to make it easier to see the maze being solved in real
+time. You can redefine SLEEP at compile time to reconfigure
+it in case it’s going too slow, too fast :-) or you’re doing some
+strange experiment like making it 100000 (which is actually fun :-)
+).Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./cdua.altTry:
+make SLEEP=1500 clobber alt
+
+./cdua.alt # press enter and watch it go much faster!make SLEEP=65000 clobber alt
+
+./cdua.alt # press enter and watch it go much slower!SLEEP
+is a high value like 65000? What happens if you use
+100000? Is this strange output still there? Why?Original code:
+Original build:
+make allOriginal use:
+./cduaJudges’ remarks:
+Author’s remarks:
+main(), several recursive calls with conditional
+actions, and just one (big and ugly) statement to solve the maze.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1995/cdua
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 dodsond1
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/dodsond1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Dodson
+Location: USTo build:
+make allTo use:
+./dodsond1 < text_fileTry:
+./dodsond1 < README.mdJudges’ remarks:
+
+... a male (who) gets very, very frustrated sitting in a chair all
+the time because males are biologically driven to go out and hunt
+giraffes.
+ -- Adjunct Professor Newt Gingrich, Reinhardt College, 1/7/95./try.shAuthor’s remarks:
+putchar(). Even
+main is written as ainma.()’s of one of the 6
+orfa loops.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/dodsond1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 dodsond2
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/dodsond2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Dodson
+Location: USTo build:
+make allTo use:
+./dodsond2Judges’ remarks:
+Author’s remarks:
+Interactive 3D Maze
+hjkl) to move on a level, and
+u or d to move (u)p or (d)own from a position
+with a U or D on the map. To simulate the
+feeling of being in an unknown labyrinth, areas which you have not
+visited cannot be seen.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/dodsond2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 esde
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/esde
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Sebastian
+Deorowicz
Location: PLTo build:
+make allTo use:
+./esde data-file wordTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+what this program does
+
+
+R011235 -> R01235).R01235 ->
+R1235).R1235 -> R123).T12 ->
+T120).
+0 = A, E, H, I, O, U, W, Y
+1 = B, P, F, V
+2 = C, S, G, J, K, Q, X, Z
+3 = D, T
+4 = L
+5 = M, N
+6 = Rinformation about an info
+file:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1995/esde
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 garry
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/garry
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Garry
+Glendown
Location: DETo build:
+make allTo use:
+./garry <input_file >output_fileTry:
+./try.shAlternate code:
+#includes
+left intact) looked very much like a rat “dropping core”. See garry.alt.c and judge for yourself!Alternate build:
+make altAlternate use:
+./garry.alt <input_file >output_fileAlternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+stdio-redirection or inside pipelines, e.g.:./garry <file_to_convert >converted_filecat all_my_files/* | ./garry | lp$-signs in the input,
+e.g.:
+My Home-Directory is: $HOME$
+I'm using the path: $PATH$$ TEST="\110\145\154\154\157"
+$ export TEST
+$ echo '$TEST$' | ./garry
+HelloCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1995/garry
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 heathbar
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/heathbar
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Heather Downs
+Location: unknown
+
Name: Selene
+Makarios
Location: unknownTo build:
+make allTo use:
+./heathbar num numTry:
+./heathbar 4253 2281Judges’ remarks:
+Author’s remarks:
+./heathbar 1234 999).
+
+main.main repeated over and over, so the computer would be
+comfortable running the program and wouldn’t get distracted dealing with
+unfamiliar variable names.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/heathbar
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 leo
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/leo
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Leonid A.
+Broukhis
Location: USTo build:
+make allTo use:
+./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]Try:
+./leo 1 | cat - /dev/tty | gs -
+
+./leo 37 80 | cat - /dev/tty | gs -echo "" | ./leo 1 > foo.psJudges’ remarks:
+Author’s remarks:
+./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]cycle is a
+positive integer (0 is ignored), and freq is an integer
+(default = 0) that’s supposed to be in the range 0..100
+(bigger values are allowed, however). Invalid parameters and options
+usually stop the command line parsing (not always but why?). The actual
+position of the word options does not matter, so
+./leo right Variable 1 70 is equivalent to
+./leo 0 0 0 1 Variable 70 right, etc.Variable is used, cycle is almost
+ignored (see below) but has to be present if you want to enter
+freq (and you usually do)../leo 1 | cat - /dev/tty | gs -
+ |
+ \./
+ |
+ / \
+ __| |__
+ \./
+ |
+ __ / \ __
+ | |
+
+ .
+ \./ \./
+ \__| |__/
+ / \./ \
+ |
+ \__./ \.__/
+ / | | \
+ / \./ \
+ ._| . |_.
+ __| \./ \./ |__
+ \__| |__/
+ __./ \./ \.__
+ __I | I__
+ \__./ \.__/
+ __./ | | \.__
+ |_./ \./ \._|
+ | |
+I show the places where
+“simultaneity” is significant.
+ \./ \./ \./ \./
+ ._| . |_. ._| . |_.
+ \__| \./ \./ |__/ \__| \./ \./ |__/
+ / \__| |__/ \ / \__| |__/ \
+ \__./ \./ \.__/ \__./ \./ \.__/
+ X__| | |__X or <__| | |__>
+ / \__./ \.__/ \ / \__./ \.__/ \
+ \__./ | | \.__/ \__./ | | \.__/
+ / |_./ \./ \._| / |_./ \./ \._|
+ | | | |
+ / \ / \ / \ / \
+
+ |__
+ ...__/ ...__/
+ ... \ ... \.
+ ...__/ ...__/|__
+ ...__Y and step 7: ...__Y
+ ... \ ... \
+ ...__/ ...__/
+ \ \.__
+ |
+
+ \./
+ / \./leo 2 | cat - /dev/tty | gs -./leo Variable 1 | cat - /dev/tty | gs -./leo Variable 1 1 | cat - /dev/tty | gs -freq and watch
+the changes.cycle is more than 1, the program loops, allowing the
+user to enjoy randomly changing patterns (the delay is 3 seconds), but
+there is a secret switch to suppress looping: useful if you want to pipe
+the output to a printer.uudecode the spoiler below if you really want to
+know.
+begin 664 spoiler1
+M*%1H92!C;VQO;B J:7,J('1H92!S96-R970@<W=I=&-H("T@=&AE('-P86-E
+=(&)E9F]R92!I="!I<R!N;W0@82!M:7-T86ME*0II
+
+endVariable is used, the actual value of
+cycle doesn’t matter, as far as it is > 1. To figure out
+what difference cycle makes when Variable is
+not used, try./leo Variable 37 80 | cat - /dev/tty | gs -cycle; smaller values usually
+require smaller values of freq for the patterns to be
+non-trivial.deep and right make the
+patterns to be drawn in different manners. Try all the examples above
+with deep and with right. What is the
+difference between them?
+ * * *
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1995/leo
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 makarios
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/makarios
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Heather Downs
+Location: unknown
+
Name: Selene
+Makarios
Location: unknownTo build:
+make allTo use:
+./makariosJudges’ remarks:
+Author’s remarks:
+
+^_^Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/makarios
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 savastio
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/savastio
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Michael
+Savastio
Location: unknownTo build:
+make allTo use:
+./savastio
+# enter a number such as 100Try:
+echo 42 | ./savastioJudges’ remarks:
+Author’s remarks:
+
+7134 1384 9347 3947 9471 7108 834Platform limitations
+Features
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/savastio
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 schnitzi
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/schnitzi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark
+Schnitzius
Location: unknownTo build:
+make allTo use:
+./schnitzi numTry:
+./schnitzi 24
+./schnitzi 18
+./schnitzi 30Judges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/schnitzi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 spinellis
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/spinellis
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Diomidis
+Spinellis
Location: GRTo build:
+make allTo use:
+./spinellis < spinellis.cJudges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/spinellis
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1995 vanschnitz
+
+
-
+ The International Obfuscated C Code Contest
+ 1995/vanschnitz
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: David Van
+Brackle
Location: unknown
Name: Mark
+Schnitzius
Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: missing file - please provide itTo use:
+./vanschnitzTry:
+make clobber all LEVEL=6
+./vanschnitzAlternate code:
+uuencoded
+blob is still available in their remarks below. They encourage you to
+first try and figure out the program without the spoiler.Alternate build:
+make altAlternate use:
+vanschnitz.alt as you would vanschnitz
+above.Judges’ remarks:
+LEVEL>8 caused some compilers
+(and in one case a system) to crash during compilation. In 2023 with
+modern systems this is not really a problem.LEVEL=15 but this is not a big deal in 2023 either.Authors’ remarks:
+n on the compile line. For instance,
+to cause the compiler to solve the Towers of Hanoi problem with four
+disks, you would compile the program like this:gcc hanoi.c -o hanoi -Dn=45 will be used for n if
+you do not define it on the command line. The value of n
+cannot be greater than fifteen (the compiler we used to test has a limit
+on the #include depth). The compiler then solves the
+problem using binary arithmetic based on whether particular symbols are
+defined or not.#includes itself. This is, of
+course, expensive; one compile we did with n=14 took about
+fifty minutes to compile on our system (compiling with n=15
+caused our system to crash).printf(3) statement, consisting of a
+massive string constant of length 35*(2^n-1), followed by
+3*(2^n-1) integers which get formatted into the string. For
+our n=14 run, this adds up to a string constant of length
+573405, followed by 49149 integers delimited by commas. (Generating the
+string constant depends on the ANSI C feature in which adjacent
+character strings are concatenated; a version that does not use this
+feature has been included for people who can only run K&R). A good
+way to see the resulting program (on a Unix system) is to do the
+commandgcc hanoi.c -E -Dn=5 | grep -v \# | grep -v ^\$
+begin 444 spoiler.c
+M(VEF;F1E9B`@24Y)5$E!3$E:140*"B\J"B`J("!)9B!N(&ES;B=T(&1E9FEN
+M960L(&UA:V4@:70@-0H@*B\*(VEF;F1E9B`@;@HC9&5F:6YE("!N(#`U"B-E
+M;F1I9@H*+RH*("H@4V]M92!U<V5F=6P@=F%R:6%B;&5S"B`J+PHC9&5F:6YE
+M("!42$E37T9)3$4@7U]&24Q%7U\@"B-D969I;F4@($9/4DU!5%]35%))3D<@
+M(DUO=F4@9&ES:R`E9"!F<F]M('!E9R`E9"!T;R!P96<@)61<;B(*(V1E9FEN
+M92`@24Y)5$E!3$E:140*"B\J"B`J(%1R86YS;&%T92!N(&EN=&\@8FET<PH@
+M*B\*(VEF("`@("`@;B8P,0HC9&5F:6YE("!B:70P"B-E;F1I9@HC:68@("`@
+M("!N)C`R"B-D969I;F4@(&)I=#$*(V5N9&EF"B-I9B`@("`@(&XF,#0*(V1E
+M9FEN92`@8FET,@HC96YD:68*(VEF("`@("`@;CX^,PHC9&5F:6YE("!B:70S
+M"B-E;F1I9@H*+RH*("H@2&5R92=S('1H92!P<F]G<F%M(0H@*B\*;6%I;B@I
+M>PIP<FEN=&8H"B-I;F-L=61E(%1(25-?1DE,10HC9&5F:6YE("!.3U=?1$]?
+M5$A%7TY534)%4E,*(VEN8VQU9&4@5$A)4U]&24Q%"BD[?0H*(V5L<V4*"B\J
+M"B`J($-H96-K('1O('-E92!I9B!T:&4@;G5M8F5R(&ES('IE<F\@*&)O='1O
+M;2!O9B!R96-U<G-I;VXI"B`J+PHC:69D968@("!B:70P"B-D969I;F4@($Y?
+M25-?3D]47UI%4D\*(V5N9&EF"B-I9F1E9B`@(&)I=#$*(V1E9FEN92`@3E])
+M4U].3U1?6D523PHC96YD:68*(VEF9&5F("`@8FET,@HC9&5F:6YE("!.7TE3
+M7TY/5%]:15)/"B-E;F1I9@HC:69D968@("!B:70S"B-D969I;F4@($Y?25-?
+M3D]47UI%4D\*(V5N9&EF"@HC:69D968@("!.7TE37TY/5%]:15)/"B-U;F1E
+M9B`@($Y?25-?3D]47UI%4D\*"B\J"B`J($1E8W)E;65N="!N"B`J+PHC:69N
+M9&5F("!B:70P"B-D969I;F4@(&)I=#`*(VEF;F1E9B`@8FET,0HC9&5F:6YE
+M("!B:70Q"B-I9FYD968@(&)I=#(*(V1E9FEN92`@8FET,@HC:69N9&5F("!B
+M:70S"B-D969I;F4@(&)I=#,*(V5L<V4*(W5N9&5F("`@8FET,PHC96YD:68*
+M(V5L<V4*(W5N9&5F("`@8FET,@HC96YD:68*(V5L<V4*(W5N9&5F("`@8FET
+M,0HC96YD:68*(V5L<V4*(W5N9&5F("`@8FET,`HC96YD:68*"B\J"B`J("!(
+M97)E)W,@<F5C=7)S:6]N"B`J+PHC:6YC;'5D92!42$E37T9)3$4*"B\J"B`J
+M("!.;W1E.B!/9&0@;G5M8F5R960@9&ES:W,@86QW87ES(&-Y8VQE(&9R;VT@
+M,2`]/B`R(#T^(#,@/3X@,2`]/B`R(#T^(#,*("H@($5V96X@;G5M8F5R960@
+M9&ES:W,@86QW87ES(&-Y8VQE(&9R;VT@,2`]/B`S(#T^(#(@/3X@,2`]/B`S
+M(#T^(#(*("HO"@HO*@H@*B!#:&5C:R!T;R!S964@:68@;B!I<R!Z97)O+B!)
+M9B!S;RP@=V4G<F4@;6]V:6YG(&1I<VL@,2X*("H@26X@9V5N97)A;"P@9F]R
+M(&%N>2!N('=E)W)E(&UO=FEN9R!D:7-K(&XK,2X@5&AA="!M96%N<R!T:&%T
+M"B`J('=H96X@;B!I<R!O9&0L('=E)W)E(&UO=FEN9R!A;B!E=F5N(&1I<VLL
+M(&%N9"!V:6-E('9E<G-A+@H@*B\*(VEF;F1E9B`@8FET,`HC:69N9&5F("!B
+M:70Q"B-I9FYD968@(&)I=#(*(VEF;F1E9B`@8FET,PHC9&5F:6YE("!.7TE3
+M7UI%4D\*(V5N9&EF"B-E;F1I9@HC96YD:68*(V5N9&EF"@HC:69D968@("!.
+M7TE37UI%4D\*(W5N9&5F("`@3E])4U]:15)/"@HC:69N9&5F("!.3U=?1$]?
+M5$A%7TY534)%4E,*1D]234%47U-44DE.1PHC96QS90H*+RH*("H@($EF(&1I
+M<VL@,2!I<R!O;B!P96<@,BP@;6]V92!I="`R(#T^(#,*("HO"B-I9F1E9B`@
+M($1)4TM?3TY%7TE37T].7U!%1U]45T\*+#$L,BPS"B-U;F1E9B`@($1)4TM?
+M3TY%7TE37T].7U!%1U]45T\*(V1E9FEN92`@1$E32U]/3D5?25-?3TY?4$5'
+M7U1(4D5%"B-E;'-E"@HO*@H@*B`@268@9&ES:R`Q(&ES(&]N('!E9R`S+"!M
+M;W9E(&ET(#,@/3X@,0H@*B\*(VEF9&5F("`@1$E32U]/3D5?25-?3TY?4$5'
+M7U1(4D5%"BPQ+#,L,0HC=6YD968@("!$25-+7T].15])4U]/3E]014=?5$A2
+M144*(V5L<V4*"B\J"B`J("!$:7-K(#$@;75S="!B92!O;B!P96<@,2X@36]V
+M92!I="`Q(#T^(#(*("HO"BPQ+#$L,@HC9&5F:6YE("!$25-+7T].15])4U]/
+M3E]014=?5%=/"B-E;F1I9@HC96YD:68*(V5N9&EF"B-E;'-E"@HO*@H@*B`@
+M2&5R92P@=V4@:&%N9&QE(&1I<VMS(#XQ+B!296UE;6)E<B!T:&%T(&]D9',@
+M8WEC;&4@,2`]/B`R(#T^(#,@/3X@,2P*("H@(&%N9"!E=F5N<R!C>6-L92`Q
+M(#T^(#(@/3X@,R`]/B`Q+B!#;VUB:6YE('1H:7,@=VET:"!T:&4@:VYO=VQE
+M9&=E"B`J("!O9B!W:&5R92!D:7-K(#$@:7,L(&%N9"!W92!C86X@9&5T97)M
+M:6YE(&AO=R!T;R!M;W9E(&%N>2!D:7-K+@H@*B\*(VEF;F1E9B`@3D]77T1/
+M7U1(15].54U"15)3"D9/4DU!5%]35%))3D<*(V5L<V4*"B\J"B`J("!0<FEN
+M="!T:&4@9&ES:R!N=6UB97(N(%)E;65M8F5R+"!D:7-K(&YU;6)E<B`](&XK
+M,0H@*B\*+#$*(VEF9&5F("`@8FET,`HK,0HC96YD:68*(VEF9&5F("`@8FET
+M,0HK,@HC96YD:68*(VEF9&5F("`@8FET,@HK-`HC96YD:68*(VEF9&5F("`@
+M8FET,PHK.`HC96YD:68*"B\J"B`J("!$:7-K(#$@;VX@<&5G(#(@"B`J+PHC
+M:69D968@("!$25-+7T].15])4U]/3E]014=?5%=/"B-I9F1E9B`@(&)I=#`*
+M+#$L,R`@("`O*B!%=F5N.B`Q(#T^(#,@("AN(&ES(&]D9"P@<V\@=&AE(&1I
+M<VL@:7,@979E;BD@*B\*(V5L<V4*+#,L,2`@("`O*B`@3V1D.B`S(#T^(#$@
+M("HO"B-E;F1I9@HC96QS90H*+RH*("H@($1I<VL@,2!O;B!P96<@,R`*("HO
+M"B-I9F1E9B`@($1)4TM?3TY%7TE37T].7U!%1U]42%)%10HC:69D968@("!B
+M:70P"BPR+#$@("`@+RH@179E;CH@,B`]/B`Q("HO"B-E;'-E"BPQ+#(@("`@
+M+RH@($]D9#H@,2`]/B`R("HO"B-E;F1I9@HC96QS90H*+RH*("H@($1I<VL@
+M,2!O;B!P96<@,2`*("HO"B-I9F1E9B`@(&)I=#`*+#,L,B`@("`O*B!%=F5N
+M.B`S(#T^(#(@*B\*(V5L<V4*+#(L,R`@("`O*B`@3V1D.B`R(#T^(#,@*B\*
+M(V5N9&EF"B-E;F1I9@HC96YD:68*(V5N9&EF"B-E;F1I9@H*+RH*("H@($UO
+M<F4@<F5C=7)S:6]N"B`J+PHC:6YC;'5D92!42$E37T9)3$4*"B\J"B`J("!)
+M;F-R96UE;G0@;@H@*B\*(VEF9&5F("`@8FET,`HC=6YD968@("!B:70P"B-I
+M9F1E9B`@(&)I=#$*(W5N9&5F("`@8FET,0HC:69D968@("!B:70R"B-U;F1E
+M9B`@(&)I=#(*(VEF9&5F("`@8FET,PHC=6YD968@("!B:70S"B-E;'-E"B-D
+M969I;F4@(&)I=#,*(V5N9&EF"B-E;'-E"B-D969I;F4@(&)I=#(*(V5N9&EF
+M"B-E;'-E"B-D969I;F4@(&)I=#$*(V5N9&EF"B-E;'-E"B-D969I;F4@(&)I
+M=#`*(V5N9&EF"@HC96YD:68@("\J("-I9F1E9B!.7TE37TY/5%]:15)/("HO
+M"@HC96YD:68@("\J("-E;'-E(&]F("-I9FYD968@24Y)5$E!3$E:140@*B\*
+`
+end
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1995/vanschnitz
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 august
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/august
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Lennart
+Augustsson
Location: SETo build:
+make allBugs and (Mis)features:
+
+STATUS: doesn't work with some compilers - please provide alternative code or fix for more compilersTo use:
+cat august.c test.oc | ./august > test.oo
+./august < test.oo! followed by a newline.Try:
+./try.shJudges’ remarks:
+make august.occat august.c august.oc | ./august > august.oocat august.oo test.oo | ./augustcat august.oo august.oo fac.oo | ./augustcat august.oo august.oo august.oo fac.oo | ./augustAuthor’s remarks:
+getchar(3) and
+putchar(3) available. The subset has the types
+int, char, and pointers to those (it has
+function pointers too, but not with the proper syntax). Arrays can only
+be global. There is a rather limited set of operators, and control
+constructs.test.oc:main() { putchar('!'); putchar('\n'); exit(0); }cat august.c test.oc | ./august > test.oo./august < test.oocat august.c test.oc | ./august | ./august-E flag and change 60000 to 40000, i.e.:cc -E -DZ=40000 .... august.c > august.ocaugust.oc contain some junk line starting with a
+# (most likely it does) then remove it like:sed -i'' '/^#/d' august.occat august.c august.oc | ./august > august.oocat august.oo test.oo | ./augustcat august.oo august.oo test.oo | ./augustcat august.oo august.oo august.oo test.oo | ./august
+&. Given a
+handful more bytes it would be easy to put them back." \n\t;{}" to avoid having them counted as
+significant. About 200 bytes of the interpreter handles the unpacking of
+the byte code (this is a lot, but it pays off).
+main(). Nothing can be used before
+it is defined. getchar() and putchar() are
+predefined functions.OC grammar
+() is used for bracketing.
+program: decl*
+
+decl: vardecl
+ fundecl
+
+vardecl: type NAME ;
+ type NAME "[" INT "]" ;
+
+fundecl: type NAME "(" args ")" "{" body "}"
+
+args: /*empty*/
+ ( arg "," )* arg
+
+arg: type NAME
+
+body: vardecl* stmt*
+
+stmt: ifstmt
+ whilestmt
+ dowhilestmt
+ "return" expr ";"
+ expr ";"
+ "{" stmt* "}"
+ ";"
+
+ifstmt: "if" "(" expr ")" stmt
+ "if" "(" expr ")" stmt "else" stmt
+
+whilestmt: "while" "(" expr ")" stmt
+
+dowhilestmt: "do" stmt "while" "(" expr ")" ";"
+
+expr: expr binop expr
+ unop expr
+ expr "[" expr "]"
+ "(" expr ")"
+ expr "(" exprs ")"
+ NAME
+ INT
+ CHAR
+ STRING
+
+exprs: /*empty*/
+ (expr ",")* expr
+
+binop: "+" | "-" | "*" | "/" | "%" |
+ "=" |
+ "<" | "==" | "!="
+
+unop: "!" | "-" | "*"
+
+type: "int" stars
+ "char" stars
+
+stars: "*"*
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/august
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 dalbec
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/dalbec
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: John Dalbec
+Location: USTo build:
+make allTo use:
+./dalbecTry:
+./dalbec 3 | head -n 29Judges’ remarks:
+Author’s remarks:
+limit if
+you’re running csh.) In rare cases the stack space may
+exceed 24*INT_MAX bytes, in which case the program will
+produce an inaccurate estimate.
+
+!=0 in conditional
+expressions.!a for
+0 where a!=0 and !a for
+1 where a==0.main() is a single expression and so
+beautifies poorly.main() is used:
+
Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/dalbec
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 eldby
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/eldby
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Thor Eldby
+Location: unknownTo build:
+make altTo use:
+./eldby.altreset.Try:
+usleep(). The default is
+35000 but you can easily change it. To do so try:make SLEEP=20000 clobber alt
+./eldby.altOriginal code:
+Original build:
+make allOriginal use:
+./eldby as you would ./eldby.alt
+above.Judges’ remarks:
+Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/eldby
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 gandalf
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/gandalf
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dean Swift
+Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: missing or dead link - please provide themTo use:
+./gandalfTry:
+./try.shJudges’ remarks:
+cc -E gandalf.cAuthor’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/gandalf
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 huffman
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/huffman
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ken Huffman
+Location: USTo build:
+make allBugs and (Mis)features:
+
+STATUS: uses gets() - change to fgets() if possibleTo use:
+echo 'Huffman Decoding' | ./huffmanTry:
+./try.shJudges’ remarks:
+./huffman < huffman.c 2>/dev/nullAuthor’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/huffman
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 jonth
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/jonth
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jon Thingvold
+Location: NOTo build:
+make allX11/Xlib.h header file and the
+X11 library to compile. macOS users running Mountain Lion and later will
+need to download and install XQuartz in order to compile and run
+this entry.Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fix
+STATUS: missing or dead link - please provide themTo use:
+./jonth :0 :0./jonth
+That's not a bug, that's a feature.Try:
+./jonth host1:0 host2:0Judges’ remarks:
+Author’s remarks:
+Known bugs:
+./jonth host:0 host:0).xrefresh(1) command.nice(1) day.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/jonth
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 rcm
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/rcm
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ron McFarland
+Location: USTo build:
+make allTo use:
+./rcm < rfc1951.gzTry:
+./rcm < rfc1952.gzJudges’ remarks:
+gzip -c < rcm.c | ./rcmAuthor’s remarks:
+gzip compressed file on standard
+input, and it will write the fully uncompressed original file to
+standard output.ObJustifications for this
+entry:
+The Design Trade-off
+Argument:
+{’,
+‘}’, and ‘;’ characters in the source
+file.”The Design Review Argument:
+The Program Metrics Argument:
+
+3100 / 130 = 23.85 -vs- 31613 / 25 = 1264.52The Whining Programmer’s
+Argument:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/rcm
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 schweikh1
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/schweikh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+make allTo use:
+./schweikh1Try:
+./schweikh1 |grep $(date +%Y)Judges’ remarks:
+Author’s remarks:
+What this program does
+
+Let J be the year.
+If J is from 1582 to 1699, let M be 22, let N be 2
+If J is from 1700 to 1799, let M be 23, let N be 3
+If J is from 1800 to 1899, let M be 23, let N be 4
+If J is from 1900 to 2099, let M be 24, let N be 5
+If J is from 2100 to 2199, let M be 24, let N be 6
+Let a be the modulus of J divided by 19
+Let b be the modulus of J divided by 4
+Let c be the modulus of J divided by 7
+Let d be the modulus of (19a + M) divided by 30
+Let e be the modulus of (2b + 4c + 6d + N) divided by 7
+
+March 22 + d + e or
+April d + e - 9 (only one of them is a valid date)
+April 26 must always be changed to April 19
+April 25 must be changed to April 18 if d is 28 and a is greater than 10Example:
+
+J = 1962, M = 24, N = 5
+a = J % 19 == 5
+b = J % 4 == 2
+c = J % 7 == 2
+d = 119 % 30 == 29
+e = 191 % 7 == 2Why I think this is
+obfuscated
+ae actually reads “assignment expression”. I had to stop at
+some arbitrary point, so don’t waste your time trying to find out how
+preprocessing tokens form type qualifier lists, cast expressions or
+direct abstract declarators. Assuming the reader knows about these easy
+to remember language elements is justified in my opinion.The moral:
+The formula:
+
+comprehension = 1/(2**precision)The interpretation:
+-I/usr/include in the build file is needed by gcc on
+Solaris because gcc’s “fixed” header in
+gcc-lib/sparc-sun-solaris2.5/2.7.2/include/errno.h is
+broken (sort of) because it has two identical extern
+declarations of errno. This leads to an error due to the redefinition of
+main. The -I option makes sure the working
+/usr/include/errno.h is found first, which shouldn’t cause any problems
+on other systems.Usage:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1996/schweikh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 schweikh2
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/schweikh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+make allTo use:
+./schweikh2
+
+Try:
+./try.sh./schweikh2 15 1 0while :; do grep -v '#' schweikh2.c; donesh, bash,
+ksh and zsh as well. Press ctrl-c to stop it.
+Observe how the try.sh script does this a number of
+times.Judges’ remarks:
+less hunni.c
+
+perl ./hunni.pl < hunni.cAuthor’s remarks:
+Why I think this program
+is obfuscated:
+main() function is invisible. All operators longer than one
+character are gone. They have been replaced by macro calls with quite a
+number of arguments. The keys are the token pasting and stringizing
+macros e and O. The “arcane rules of token
+pasting” [K&R2] are used up to three levels:
+H(O,r)R(O,r) (!) which is needed to make one 8-character
+token from 8 characters (unsigned). BTW, C has no 9 or more
+character reserved words, so a fourth level is only required if you
+intend to generate object names from 9 or more components. The final
+round even swaps the tokens, so all keywords must be spelled backwards
+(sort of, can you spot printf in the P
+macro?).J - 1
+where J is the return value from several non-void functions
+(needed to shut up lint). The last assignment is
+J = printf ("%c", 10); so the exit status is 0 unless the
+last printf failed, which is even a useful status.
+A further obfuscation is the use of 10 instead of
+'\n'. '\n' can not be constructed by token
+pasting, AFAIK. That’s why schweikh2 is likely to produce
+occasional garbage on non-ASCII execution character set systems.What this program does
++ -
+* /; operands are real numbers (integers or
+fractions). The operands are restricted in that they must differ by a
+constant value, for example 1 + 2 * 3 / 4 - 5. For any
+combination of operators the expression is evaluated and compared to a
+goal value. If they compare equal the expression is printed. If the goal
+value is specified as 0/0 all expressions and results are
+printed. For any fraction, the numerator and denominator are divided by
+their greatest common divisor.
+
+long is at least
+32 bits) overflow will occur in the default case (first operand 1,
+increment 1) only for more than 11 operators. Because a bit mask is used
+that needs twice the number of operands in bits (plus a sentinel value)
+on those systems the first parameter must not exceed 15.long is at least 64 bits overflow will occur for more
+than 19 operators but you will probably wait quite some time for every
+of the 4^19 = 274,877,906,944 combinations to be evaluated…
+While I’m at it, on a 50 MHz SPARC, 4^11 expressions are
+evaluated in about 3 cpu minutes (gcc -O3).Sample arguments:
+./schweikh2 6
+./schweikh2 7 0
+./schweikh2 7 7 0
+./schweikh2 8 9 -1 -67/21
+./schweikh2 8 2 2/5 -98/25
+./schweikh2 2 1/0 1 1/0Miscellaneous
+while :; do grep -v '#' schweikh2.c; doneCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1996/schweikh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 schweikh3
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/schweikh3
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+make allTo use:
+./schweikh3Judges’ remarks:
+-ansi../schweikh3
+ ${CC} ${CFLAGS} \
+ -I. -D_POSIX_SOURCE '-Ddifftime(a,b)=(double)(b-a)' \
+ schweikh3.c -o schweikh3Author’s remarks:
+Why I think my entry is
+obfuscated
+#includes,
+#defines and declarations of data and functions appear
+intermixed. iso646.h is even included in the middle of an
+expression, how disgusting. Besides, requiring iso646.h
+will render the program uncompilable on many systems that have not yet
+incorporated Amendment One to The Standard. If you, dear reader, suffer
+from this disease, just read iso646.h.if' statements. They have been replaced byswitch () case
+1:orswitch () case
+0:etc. At least oneswitchhas a declaration after the opening brace, booh! Identifiers are named after random programming languages, BASIC (asBasic`),
+COBOL, F77, awk etc.$ g++ schweikh3.c
+schweikh3.c:9: parse error before `new'
+schweikh3.c:16: parse error before `new'
+schweikh3.c:46: parse error before `void'
+schweikh3.c:65: parse error before `Lisp'
+schweikh3.c:68: parse error before `;'
+[...]
+schweikh3.c:91: confused by earlier errors, bailing out$ gcc schweikh3.c
+schweikh3.c:46: parse error before `void'
+schweikh3.c: In function `main':
+schweikh3.c:91: parse error before `inline'
+schweikh3.c: At top level:
+schweikh3.c:97: parse error before `void'-ansi option to gcc fixes this.far (to be honest: this is
+untested :-) ).re\turn where the re\ is at
+the end of a line? ? Solaris’ indent inserts spaces and thereby renders
+the source uncompilable…__LINE__
+macro in an expression).sizeof __TIME__? This one’s for the
+philosophers and physicists among us programmers. What is it?
+sizeof (char *)? – no. strlen ("hh:mm:ss")? –
+no. It’s the same as sizeof __DATE__ - sizeof "no" :-)What this program does
+stdout. This way each page of
+the allocated virtual memory will eventually be referenced. Without any
+arguments, malloc(3) will be used to allocate memory. If
+the first arg starts with c, calloc(3) will be
+used instead.
+
+malloc(3) does not lie
+– you can use all memory the OS granted to you.malloc(3) lies – any
+program may get killed at random when the OS can not acquire a free
+page.malloc(3) lies –
+The OS puts processes to sleep for which it can not acquire a free page.
+Because other processes are also affected this way, the system slows
+down and quickly becomes totally unusable (also known as “thrashing”).
+Because more and more processes wait for memory returned by other
+exiting processes the system eventually enters a deadlock situation and
+effectively halts.calloc(3) is used instead of
+malloc(3). For FreeBSD, the last two lines are not messages
+stemming from my program but issued by the syslog daemon.Implementation remarks
+clock()). If a certain threshold is reached I assume
+the system is thrashing. When thrashing, however, the process does not
+consume processor time in a noticeable amount any longer and I lose. So
+I switched to measuring wall clock time using time(3). On
+the one system that I observe thrashing (Linux) this works (although the
+value returned by time(3) seems to ‘hang’ sometimes when
+the OS thrashes. Exceeding a threshold of 5 seconds may be detected only
+after half a minute or so.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1996/schweikh3
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1996 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 1996/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+make allTo use:
+./clock1.sh
+./clock2.sh
+./clock3.shTry:
+./try.shAlternate code:
+Alternate build:
+make altAlternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+
+
+argv[0] can be written to as if it were a
+long *.struct * returned by
+localtime(3) are seconds, minutes, hours, and all are
+ints../westley minute_map hour_map hand_symbol clock_imageminute_map and
+hour_map and writes the hand_symbol for each
+into the clock_image string. This string is then
+printed.for() loop starts by calling time()
+with argv[0], so the time value (a long) is
+written into the program name. The for() control value is
+argc, which starts at 5, but the
+/=2 statement is executed before the test, so the
+for() loop is executed twice, with h=2, then
+h=1 (for hour & minute).for() loop takes the hour or minute
+field of the struct returned by localtime(3) by casting it
+to an int * and dereferencing element [h]. It
+is slightly smaller to use the trick h[(int*)localtime(*m)]
+instead of ((int*)localtime(*m))[h].hour_map or
+minute_map parameter to determine where the ‘hand’ symbol
+should be written into the clock_image.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1996/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 banks
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/banks
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Carl Banks
+Location: USTo build:
+make all
+Control Description Default Key
+------- ------------------------- -----------
+ IT Increase throttle XK_Page_Up
+ DT Decrease throttle XK_Page_Down
+ FD Move stick forward XK_Up
+ BK Move stick back XK_Down
+ LT Move stick left XK_Left
+ RT Move stick right XK_Right
+ CS Center stick XK_Enterdt, which is the time step. See
+some important points on this in the author’s comments in the Alternate Build Instructions
+section.u and d:make clobber IT=XK_u DT=XK_d allXK_u
+corresponds to u and XK_d corresponds to
+d:#define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */
+#define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */XK_U and
+XK_D and you can search the header file for ‘LATIN CAPITAL
+D’, for example.To use:
+cat horizon.sc pittsburgh.sc | ./banksTry:
+Alternate code:
+Alternate build:
+f and d respectively
+as these are letters on the left side of the keyboard which is easier to
+use if one is using the right side for movement. These are hard coded,
+as noted.make altAlternate use:
+banks.alt as you would banks but for
+use the different keys as configured at compilation.Judges’ remarks:
+select(2) system call. More on building in the author
+remarks.Author’s remarks:
+Features
+
+
+Scenery
+*.sc files is a scenery file. The simulator
+program reads in the scenery from standard input on startup. You may
+input more than one scenery file, as long as there are less than 1000
+total lines of input.
+
+cat horizon.sc pittsburgh.sc | ./banks
+cat mountains.sc bb.sc | ./banks
+cat mountains.sc river.sc pyramids.sc | ./banks./banks < /dev/null0 0 0 is
+used to end a series of consecutive line segments. Note that in the
+coordinate system used, the third coordinate represents
+altitude in a negative sense: negative numbers are
+positive altitudes.Alternate Build Instructions
+-Dcontrol=key or if you use the Makefile you can
+do make control=key.
+Control Description Default Key
+------- ------------------------- -----------
+ IT Increase throttle XK_Page_Up
+ DT Decrease throttle XK_Page_Down
+ FD Move stick forward XK_Up
+ BK Move stick back XK_Down
+ LT Move stick left XK_Left
+ RT Move stick right XK_Right
+ CS Center stick XK_Enter<X11/keysym.h>. This file is most likely a
+cross-reference to another header,
+<X11/keysymdef.h>.-DCS=XK_space or
+make CS=XK_space.-Ddt=duration, where dt is literal,
+and where duration is the time in seconds you want the time
+step to be. Alternatively, if you use the provided Makefile, you may
+just do make dt=time.0.03) will cause
+numerical stability problems and should be avoided. Setting the time
+step to be smaller than your clock resolution will slow down the
+simulator, because the system pauses for more time than the simulator
+expects.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/banks
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 bas1
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/bas1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Bas de Bakker
+Location: NLTo build:
+make allTo use:
+lpr on your system can print PostScript:./bemazing | gunzip | lpr./bemazing | gunzip | gv -./bemazing | gunzip | gs -sDEVICE=pgmraw -sOutputFile='|xv -' -Judges’ remarks:
+Author’s remarks:
+BEMAZING
+Bemazing is “amazing” taken one step (letter) further.
+Bemazing creates a 3D maze of beams. Try to go from the
+entrance (the unfinished beam in one corner) to the exit (the unfinished
+beam in the opposite corner) or vice versa.Bemazing is not tied to any
+window system, but creates postscript output. The picture it makes will
+fit on either A4 or letter size paper.Bemazing creates the postscript in gzip(1)
+format, in order to save precious bits on your hard disk for the latest
+version of GNU Emacs
+(after all, you wouldn’t want to use an editor without a
+psychoanalyze-pinhead function, now would you). Again for maximum
+portability, Bemazing will take special care that the
+binary output will not contain any newline or return characters that may
+get weird treatment on systems that do not use the One True Line
+Separator.NOTES
+\240-\377. Use LESSCHARSET=latin1,
+M-x standard-display-european in GNU Emacs
+etc. The source does not use characters in the range
+\200-\237 (we are not an unnamed word processor that tends
+to create HTML containing these control characters).for, if or other control
+structures. All the logic is in the C code. There are only a few
+straightforward defs, because otherwise the output would
+become much larger.Bemazing with command line arguments and see
+what happens. (But note that the program only guarantees that there
+actually is a route from entrance to exit if you run it without command
+line arguments.)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/bas1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 bas2
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/bas2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Bas de Bakker
+Location: NLTo build:
+make allTo use:
+./bas2 < file
+echo text | ./bas2Try:
+./try.sh
+
+./try.sh "foo bar" "baz" "IOCCC 1998/bas2" README.mdJudges’ remarks:
+Questions to ponder:
+Hint and Extra Credit:
+Author’s remarks:
+
+
+main() instead of 2 loops (over input
+characters and over bits in the character).?: and || instead of if
+statements.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/bas2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 chaos
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/chaos
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Alan De Smet
+Location: USTo build:
+make chaoshalfdelay() in their
+libcurses. You might try compiling with -lncurses if you
+have that library. Or you can build this entry without the
+halfdelay() call by:make chaos_nohalfTo use:
+./chaosJudge’s Comments:
+Author’s remarks:
+Usage
+Summary
+y,
+u, i, h, j, and
+k rotate. a and z zoom in and
+out. q quits. Given about 3 seconds of no input, it will
+start rotating until interrupted by user input.Features (aka Bugs):
+malloc(3)ed is never freed. This shouldn’t be a
+big deal, since only one block is ever allocated, and the OS should
+recover it.return from main(). Feh, what does it know?
+Otherwise, ignoring lint’s over protectiveness (“Of course I’m not using
+all of the functions defined in curses.h!”), it’s lint
+clean.char * P’s data in a nice
+contiguous stream, it would be bad. As above, it would break running the
+program without an external data file.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/chaos
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 df
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/df
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel
+Fischer
Location: unknownTo build:
+make allTo use:
+./dfJudges’ remarks;
+r (the source has been changed
+for your convenience and this restriction no longer exist).
+
+Author’s remarks:
+abcdefghijklmnopqrstuvwxyz). Execution
+stops when all underscores have been replaced.time() is used to pick one at random. All words are eight
+characters long.__STDC__ 1 which they shouldn’t). Due to space
+restrictions, I did not use any trigraph sequences. It does not require
+any special -D defines.>/dev/null). (My lclint is unable to recover from some
+parts of it.)main() follows the guidelines (but the
+return type has a different meaning and the arguments are either misused
+or unused). There also may be some compiler warnings. These are not
+bugs, but features. The more warnings, the better the compiler. There
+wouldn’t be any if I had been allowed to use some extra space for
+prototypes etc.#define y define is used with #y but the code
+doesn’t assume #y to expand to #define. I have
+also included comments in the code, and vital code in the comments. And
+of course there is code that doesn’t do anything but will crash the
+program if it is removed (just like those comments I mentioned above).
+Additionally, since you said you’d be preprocessing entries ignoring
+#includes I figured I should use some more of them instead
+of other obfuscation methods. Did I mention that preprocessed or
+beautified sources will crash or hang your system? The program will also
+crash on non-ASCII machines.__FILE__ is used instead.
+
+r.+ or a
+b.pr4.c, pr.c,
+prog.c, brownie.c etc. My first private
+version would only run when compiled on a Friday. I decided it would be
+better this way… These restrictions have been removed for your
+convenience.
+
+cut in “cut here” is required while
+here is not.__FILE__+1 was used as a second parameter to
+fopen(). (It essentially was
+fopen(__FILE__,__FILE__+1) ). This was an extra joke that
+doesn’t exist in the released version.while(FILE) in
+main() is not a while loop but the statement that opens the
+file and initializes the dictionary. Similarly, int and
+signed have been redefined (to save space, of course).#else..#endif, but still is declared before
+main(). The 5[O]() in main()
+calls this function. Similarly, most indexing operations have been
+changed to this form and I tried to write each such operation
+different.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/df
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 dlowe
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/dlowe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: J. David Lowe
+Location: USTo build:
+make allTo use:
+./dlowe < anyfile > pootfileBugs and (Mis)features:
+
+STATUS: missing or dead link - please provide themTry:
+./dlowe < README.md
+./dlowe < README.md > README.poot.md./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+
+./dlowe.alt < anyfile > pootfiledlowe?Alternate try:
+./try.alt.shJudges’ remarks:
+Historical remarks:
+#!/bin/sh
+# pootify - a sample CGI pootifier
+#
+POOT="/usr/local/bin/dlowe"
+LYNX="/usr/local/bin/lynx"
+ECHO="/usr/bin/echo"
+EXPR="/usr/bin/expr"
+${ECHO} "Content-type: text/html"
+${ECHO}
+if [ -z "${QUERY_STRING}" ]; then
+ ${ECHO} "QUERY_STRING not found"
+else
+ URL=`${EXPR} "$QUERY_STRING" : '[Uu][Rr][Ll]=\(.*\)'`
+ if [ -z "${URL}" ]; then
+ ${ECHO} "No URL given in QUERY_STRING"
+ elif [ X`${EXPR} "${URL}" : '[Ff][Ii][Ll][Ee]:'` != X0 ]; then
+ ${ECHO} "file: based URLs are not allowed"
+ else
+ ${LYNX} -restrictions=all -source "${URL}" | ${POOT}
+ fi
+fifile:// based URLs and which uses lynx(1) with
+the option referred to above. This will not, of course, render it as
+html but rather show the modified html. Nevertheless, this has
+NOT been tested as a CGI script with a webserver to
+display a pootified web page.file:// URLs. If one wants a CGI script they should use the
+above one instead. You can use the script pootify.sh, however, to download and generate html
+files that you can look at locally in a browser or pipe through
+less(1). For instance:./pootify.sh URL=https://microsoft.com | less
+
+./pootify.sh -r URL=https://microsoft.com > ms.htmlms.html so that you could open it in a browser.https://web.archive.org/web/20040326083431/http://www.pootpoot.com/poot/pootify/?URL=http%3A%2F%2Fwww.ioccc.orgAuthor’s remarks:
+stdin and
+outputs the “corrected” text to stdout.MANROFFSEQ environment
+variable for man page enjoyment; use it to turn the GPL into the
+PPL; see what happens when you run perl4
+programs after they’ve been run through it; “encrypt” sensitive (but
+unnecessary) documents…Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/dlowe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 dloweneil
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/dloweneil
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: J. David Lowe
+Location: US
+
Name: Neil
+Mix
Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: missing or dead link - please provide themTo use:
+
+./pootris [X size of board] [Y size of board]a moves the current letter position
+counterclockwise around the border of the playing field.s moves the current letter one position
+clockwise around the border of the playing field.d drops the current letter onto the board.Alternate code:
+a
+moving you anticlockwise/counterclockwise h does as well;
+and in addition to s moving clockwise l does
+as well. Instead of using d to drop the letter you can do
+j or space. Finally to quit this version you can press
+q.Alternate build:
+make altAlternate use:
+./pootris.alt [X size of board] [Y size of board]Judges’ remarks:
+
+Originally, I didn't appreciate the game. Then I actually read the
+description of the controls. I started playing. I struggled.
+I spelled my first "poot". I was hooked ...Author’s remarks:
+Usage
+./pootris [X size of board] [Y size of board]Synopsis
+POOT as much as
+possible. There is no time pressure. You’re given one letter at a time
+(sort of randomly chosen from the set ‘P’, ‘O’, and ‘T’) and you get to
+move it freely around the border of the playing board, and decide when
+and where to drop it into the board. Sound easy? Of course, there’s a
+catch…Controls
+a: moves the current letter one position
+counterclockwise around the border of the playing field.s: moves the current letter one position clockwise
+around the border of the playing field.d: drops the current letter onto the board.Rules of motion
+P moves diagonally, at a 45 degree angle and in a
+clockwise direction around the board once dropped.O moves in a straight line perpendicular to the border
+from which it is dropped.T moves diagonally, at a 45 degree angle and in a
+counterclockwise direction around the board once dropped.Os will fall
+straight down if they hit a side wall.Rules of spelling
+
+
+POOT on the board, in any direction,
+the letters comprising the word will disappear, and any letters which
+may have accumulated above the disappeared letters will ‘fall’.POOT.Rules of scoring
+
+
+POOT. More if
+you spell it in more than one way simultaneously.Some of the obfuscations
+
+
+POOT
+inside the box, and the position of the current letter, which is a
+single value from 0 to
+2 * xsize + 2 * ysize - 1.x%3 is a perfect hash function for
+x values P, O and T
+is used.poot for fun (It’s also exactly 3217 bytes in length, with
+exactly 1536 counted characters for purposes of this contest..x)) variable names; hard-coded ASCII
+numeric values used for character constants; using goto for
+fun and profit; reusing and re-purposing variables in different
+places.Some
+things I wish I could have fit into this, but didn’t have the
+space:
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1998/dloweneil
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 dorssel
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/dorssel
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Frans van
+Dorsselaer
Location: unknownTo build:
+make allTo use:
+./dorssel
+# input some text
+
+echo text | ./dorsselTry:
+./try.sh./dorssel < dorssel.mdJudges’ remarks:
+
+
+Extra credit:
+echo ". -..- . .-. -.-. .. ... .
+-.-. .... .- -. --. . - .... . .--. .-. --- --. .-. .- -- ... --- .. - -.. --- . ... -. --- - ... .... --- ..- -" | ./dorsselAuthor’s remarks:
+Usage
+
+
+' '. Morse
+code per converted character is written as a sequence of .
+and - characters, each sequence followed by a
+space.. and - characters, separated by a space.
+Extra spaces will be echoed back (to separate words). Unknown sequences
+will be converted to a ? character.Notes
+Hints
+./dorssel < dorssel.c | ./dorssel
+
+./dorssel < dorssel.c | ./dorssel | ./dorssel | ./dorssel./dorssel < dorssel.c | ./dorssel
+
+./dorssel < dorssel.mdCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/dorssel
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 fanf
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/fanf
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Tony Finch
+Location: GBTo build:
+make allTo use:
+./fanfTry:
+./try.shJudges’ remarks:
+Historical aside:
+fanftmp2.c C program. Take a look at that
+final C program again, can you begin to understand what it is doing?cc fanf.c -E > fanftmp1.cfanftmp1.c (after all of the C
+pre-processor header stuff … look for a line of the form:
+# 38 "fanf.c" near the bottom) and look at the resulting
+code. This code, when C pre-processed will expand into over 342 times
+the original code (ignoring #include headers) to produce
+fanftmp2.c. That program in turn, when compiled translates
+a single lambda expression on standard input into combinator expressions
+on standard output.Extra credit question:
+Author’s remarks:
+What the program does
+a or b or
+@. Variables are combined by function application which is
+written as e.g. (f a) which is the function f
+applied to the argument a. Application groups to the left,
+so (f a b c) is equivalent to (((f a) b) c).
+Functions are created from lambda terms which are written in the form
+\a(expr) which is the function taking argument
+a and having value expr. Lambda is spelt
+\ because ASCII isn’t good enough. Lambda binds tightly, so
+\a\bcd is equivalent to ((\a(\b(c))) d).
+Whitespace is ignored.I, is written
+\x(x). A simple expression is (I a) which is
+equivalent to (\x(x) a), which has the value
+a. Another function called K is defined as
+\x\y(x) and it evaluates as follows:
+ K p q
+ -> \x\y(x) p q
+ -> \y(p) q
+ -> pS, defined as
+\f\g\x((f x) (g x)). My program demonstrates the fact that
+any lambda expression can be translated into an equivalent “combinator
+expression” which involves only S, K,
+I (the combinators), and application, with no variables or
+lambda abstractions. In fact, even I is unnecessary, since
+it is equivalent to S K K:
+ I z
+ -> \a(a) z
+ -> z
+
+ S K K z
+ -> \f\g\x((f x) (g x)) K K z
+ -> (K z) (K z)
+ -> \x\y(x) z (K z)
+ -> z
+trans v -> v (variable)
+trans a b -> (trans a) (trans b ) (application)
+trans \ab -> abs a (trans b) (abstraction)
+abs a f x -> S (abs a f) (abs a x)
+abs a b -> K b (b != a)
+abs a a -> I+ and
+3 and we wanted to see what the combinator expression for
+doubling 3 looked like:
+ trans \x(+ x x) 3
+-> (trans \x(+ x x)) (trans 3)
+-> (abs x (trans + x x)) 3
+-> (abs x + x x) 3
+-> S (abs x + x) (abs x x) 3
+-> S (S (abs x +) (abs x x)) I 3
+-> S (S (K +) I) I 3
+-> S (S (K +) I) I 3
+ S (S (K +) I) I 3
+-> S (K +) I 3 (I 3)
+-> K + 3 (I 3) (I 3)
+-> + (I 3) (I 3)
+-> + 3 3K (a b) is the same as S (K a) (K b),
+because
+ K (a b) x
+-> a b
+ S (K a) (K b) x
+-> K a x (K b x)
+-> a bS (K a) I is the same as just a
+because
+ S (K a) I x
+-> K a x (I x)
+-> a xWhy this is a practical
+application
+\x\y(x y) y I might get
+\y(y y) which is not the same as the correct result because
+the first y in the body should refer to a global
+y rather than the local one. David Turner was the first
+person to realise that because of this fact, SK combinators provide a
+simple way to implement non-strict functional programming languages,
+either in software or directly in hardware.OFL (pronounced like “offal” and short for “Obfuscated
+Functional Language”). I then used OFL to implement all the
+high-level functionality described above. This contributes a lot to the
+obfuscation because even small amounts of OFL are quite
+unpalatable, and large expressions are completely incomprehensible.OFL includes
+a few concessions to reality: a combinator E for
+representing characters and testing them for equality, two I/O
+combinators, G and P, for reading and writing
+characters respectively, and a combinator J for
+representing false. I also implemented the Y
+combinator directly rather than in terms of the primitive combinators,
+since it only required five characters to do so
+(viz. Y W q Q g). However this code is not enabled because
+the definition of Y in terms of other combinators is more
+cute.E combinator comes in a large number of forms, one
+for each character and one for end of file. It is written
+E(c) for the variant of E corresponding to the
+character c. An expression of the form E(c) x
+is evaluated by first evaluating x. If x
+doesn’t evaluate to some form of E, then evaluation of the
+expression terminates. If x evaluates to E(c),
+then the expression evaluates to K. If x
+evaluates to E(d) (where d is a different
+character to c), then the expression evaluates to
+J.K and J are used to represent
+true and false respectively; they correspond
+exactly to the standard lambda calculus representations of
+true and false, viz. \t\f(t) and
+\t\f(f) respectively. In this way a conditional expression
+can just be written cond then else, which is even more
+terse than C cond ? then : else. An expression that
+compares a character with a, say, can be written in the
+rather obfuscated form E('a') char then else.P combinator, like the E combinator,
+starts off by evaluating its first argument and checking that it is some
+form of E. It then writes that character on
+stdout, and finally it calls its second argument as a
+function with the argument I, i.e.
+P x f -> f IG combinator just reads a character from
+stdin then calls its argument as a function with the
+appropriate E combinator as an argument, i.e.
+G f -> f E(c)Y combinator is used for implementing recursive
+functions. It has the evaluation rule
+Y f -> f (Y f)
+Y \f\n((= n 0) 1 (* n (f (- n 1))))OFL provides a facility for naming expressions so that
+they can be used more than once without writing them in full. A
+definition must be written on one line in the form
+l name b expression where l is short for “let”
+and b is short for “be”. Names must be more than one
+character long. A complete OFL program starts off by
+defining the primitives it will use with likes of the form
+p (S) etc., then goes on to define the names it will use,
+and finishes off with the main expression followed by a single
+e short for “end”. OFL expressions must use
+the minimum number of brackets needed to be unambiguous, except that the
+whole expression must be surrounded by brackets.OFL has a standard library which adds another five
+combinators to the basic eight. These combinators provide greater scope
+for optimisation when translating an expression from the lambda calculus
+to combinators, and therefore more compact programs. Their evaluation
+rules are:
+B f g x -> f (g x)
+C f g x -> (f x) g
+BB c f g x -> c (f (g x))
+CC c f g x -> c (f x) g
+SS c f g x -> c (f x) (g x)
+S (K p) I -> p
+S (K p) (K r) -> K ( p r )
+S (K p) (B r s) -> BB p r s
+S (K p) r -> B p r
+S (B p q) (K r) -> CC p q r
+S p (K r) -> C p r
+S (B p q) r -> SS p q r
+S p r -> S p rThe implementation of
+
+OFLOFL has completely different syntax and
+semantics to C, all you need to compile OFL programs is a C
+compiler and a header file (which in my entry to the competition has
+been included in-line). The header file implements a two-pass optimising
+compiler which produces a representation of the program that is then
+interpreted.OFL primitives; the next five define the OFL
+standard library; and the rest implement the application described in
+the first part of this document. This part of the program is transformed
+into the second pass of the compiler by the first pass of the
+compiler.References
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+1998/fanf
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 schnitzi
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/schnitzi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark
+Schnitzius
Location: unknownTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./schnitzi n > sort.c
+make sort
+./sort
+# enter three numbers, space separated
+
+echo x y z | ./sortn and x, y and
+z are numbers.Try:
+./try.shn
+numbers that the program expects? For instance try:./schnitzi 5 > sort.c
+make sort
+
+# try running the next command four or five times:
+echo 2 5 3 1 | ./sortJudges’ remarks:
+Author’s remarks:
+t in the
+alphabet is nowhere to be seen. There is even an entire novel (E. V.
+Wright’s “Gadsby”) in which no word contains the letter
+e.while,
+do...while, for,
+if/else, switch, ?:,
+or anything else that might cause any kind of non-deterministic jump in
+the code. There’s too much uncertainty in the world anyway.printf(3) and one
+goto.(1 < n < 27) on the command line, such as./schnitzi 5if/else statements, without
+arrays or looping. To see the resulting program run, redirect the output
+from schnitzi into another file, like this./schnitzi 4 > sort.cSpoilers And Hints:
+O, but O
+is just set to point to other functions all the time. Or, almost all the
+time.h get set, and what to?Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1998/schnitzi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 schweikh1
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/schweikh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+make allTo use:
+./schweikh1Alternate code:
+Alternate build:
+make altAlternate build:
+schweikh1.alt as you would schweikh1
+above.Alternate try:
+Judges’ remarks:
+'\n', in #file
+directives alone merits some recognition.Historical note:
+${CC}. This limitation was removed in 2023 but in the past
+one should have used gcc.Author’s remarks:
+
+<iso646.h>:
+gcc: /usr/include/iso646.h: No such file or directory
+gcc: No input files specified
+<wctype.h>:
+gcc: /usr/include/wctype.h: No such file or directory
+gcc: No input files specified
+<wchar.h>:
+gcc: /usr/include/wchar.h: No such file or directory
+gcc: No input files specifiedRequirements
+gcc (the GNU C compiler) must be available at runtime.
+It is assumed that your C implementation keeps headers as files in the
+/usr/include directory. The info file
+must be readable and reside in the current working directory. The
+current working directory must be writable in order to create a
+temporary file (which is removed upon program termination). In case you
+don’t have gcc at runtime, not all is lost if your compiler or
+preprocessor can produce a list of defined macros in the format output
+by gcc -dM, i.e. lines of the form
+#define MACRO value.Background
+<stdio.h> defines
+PIPE_BUF, then the conforming#include <assert.h>
+#include <stdio.h> /* <- or where the bogus macro is defined */
+#include <string.h>
+#define STR(x) #x
+#define XSTR(x) STR(x)
+int main (void)
+{
+ int PIPE_BUF = 0;
+ assert (strcmp ("PIPE_BUF", XSTR (PIPE_BUF)) == 0);
+ return 0;
+}Why I think my program is
+obfuscated
+
+
+#include can consist of
+pp-tokens and “are processed just as in normal text.” [ISO 6.8.2] The
+result must resemble one of the canonical forms, "foo.h" or
+<bar.h>. This lets us write things like#define HEADER "foo.h"
+#include HEADER#define H(x) <st##x##.h>
+#include H(dio) /* expands to <stdio.h> */"t.c", line 3: Error:\ [ISO 6.8.3.3]: Invalid result for '##' operator in macro 'H'.
+
+#line directive allows to set a line number, and
+optionally a file name, i.e. modify __LINE__ and
+__FILE__. Strange things happen if the file name contains a
+NUL byte – which the Standard allows: in #line num "file"
+the "file" is an s-char-sequence per ISO 6.8.4. ISO 6.1.4
+defines string literals as s-char-sequences, which may include octal
+escape sequences. Let’s look at#include <stdio.h>
+#line 42 "foo\0bar"
+int main (void) {
+ printf ("%s %d\n", __FILE__, (int)sizeof __FILE__);
+ return 0;
+}'foo 8'. Here’s what happens
+in RL:
+foo 4 gcc 2.7.2.1, lcc
+foo\0bar 9 tcc 4.1.2, Sunsoft cc turn "\0" into "\\0", ugh!
+
+%: and %:%: digraphs test for
+conformance to Amendment One.case __LINE__: under his/her nose. Easy money from a bet!
+Make sure your guru has no chance to use Standardese weasel words as an
+escape: can I have case <some_token>:
+ case <some_token>:
+in the same switch? (Note that you need the [invisible] newline. You
+can generously allow the additional constraint that no `#undef`s or
+`#define`s are allowed between the two cases.)__LINE__ and __FILE__ which are redefined
+at various places. Sometimes the __FILE__ contains
+\0 bytes; different strings or characters are then accessed
+with offsets, say 10+__FILE__ or
+__LINE__+__FILE__ or 2[__FILE__]. One integral
+constant in octal. This makes the source and header input depend on
+ASCII.goto O, “needless” assignments to satisfy lint
+with its “function value ignored” warnings. My lint has nothing to
+complain about.# up to the final
+newline. See 6.8 for details.) On many implementations these appear as
+^L and ^K. My source starts with an extremely
+uncommon 32bit word consisting of ^L, ^K,
+% and :. I have grepped old winning entries
+for ^K, none of them contains one, so this is something new – after 14
+years of IOCCC. Be sure to have enough paper in your printer when you
+make a hard copy of the source…{’, ‘}’,
+‘;’ followed by whitespace). The mkentry.c program, however, uses
+isspace(3) which returns nonzero for \v and
+\f and other characters as well. I could have used a lot
+more ^K and ^L probably undetected by your
+counter but decided to err on the side of safety. I use a perl script to
+compute the character count according to the rules. The advantages of an
+independent clean room approach…#!/usr/bin/perl -w
+$/ = "\0";
+$_ = <>;
+s/[;{}][ \t\n]/\n/g;
+s/[ \t\n]+//g;
+print length ($_),"\n";perl ./charcount.pl schweikh1.cindent on the source. The code is extremely fragile because
+of the myriads of __LINE__ macros – indenting is a sure way
+to break the program. Don’t even think of maintaining that beast; I’ve
+had my share of core dumps during development :-) A test suite was used
+after every minor change to find out if the program still does what it
+should.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1998/schweikh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 schweikh2
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/schweikh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+make allTo use:
+./yarng./yarng integer_numberTry:
+./yarng 5
+
+./yarng
+# watch what it doesJudges’ remarks:
+Historical remarks:
+make schweikh2gcc -ansi schweikh2.alt.c -o schweikh2.alt
+as: Error: cca00NzV.s, line 58: Missing " at end of string
+ "
+as: Error: cca00NzV.s, line 58: malformed statement
+*** Error code 1 (bu21)#line 10 ONE(O(1,1,2,6,0,6))# 9 "01\012".stabs "schweikh2.c
+",132,0,0,Ltext1" after the #.file line
+resulted in an assembly syntax error.gcc -g:make schweikh2 CFLAGS=-g\012, it was even
+possible to have all kinds of fun adding inline assembly via
+#line directives. :-)For extra fun and credit:
+#line 10 "01\015"
+:10:16: warning: type defaults to 'int' in declaration of 'zero' [-Wimplicit-int]
+: In function 'main':
+:12:1: warning: missing terminating " character
+:12:19: internal compiler error: invalid built-in macro "__FILE__"#line 10 "01\015"#line 10 ONE(O(1,1,2,6,0,6))Author’s remarks:
+What this program does
+yarng, which stands for, you guessed it,
+yet another random number generator, and is pronounced ‘yawn’ due to its
+incredible speed. Seriously, it exploits the randomness of quantum
+mechanical events that build up the hardware as well as some other
+non-deterministic factors. Here’s how it works:
+
+yarng therefore produces output at a rate of 1 baud.
+The number of bits may be specified by an argument and defaults either
+to UINT_MAX (least likely) or UINT_MAX+1 (most
+likely). Extra credit: why the different values? How long would you need
+for an empirical test?$ ./yarng 32
+10111001010101110110010101001111
+$ ./yarng 5
+10011Why I think this is
+obfuscated
+
+
+int like the plague. Instead I used
+storage class specifiers (register, auto) to
+get implicit int. The Standard allows implicit
+int even in casts as you can see in
+(void(*)(register))main. Where implicit int is
+impossible, like in the int main declaration I have
+int split across two lines. All indent programs I use
+insert space at the beginning of the continuation line and thereby
+introduce a syntax error.main() (ab)used as a signal handler. Shocking. Yeah,
+this leads to undefined behaviour. I have yet to see a system where it
+does not work. If it doesn’t work for you, I’d appreciate if you mail me
+about it. Uh-oh, Schweikh did it, uttered “Works for me”. Don’t quote me
+on that!## with
+shuffled arguments.__LINE__ and
+__FILE__? Not so. The #line preprocessor
+directive does the trick. But saying #line 10 "01\n" is a
+little lame and I came up with
+??=line 10 ONE(O(1,1,2,6,0,6)).__LINE__ is used as the signal number argument to
+signal(). If indenting or other editing changes the number
+of lines the program is likely to be killed after one second… Thanks to
+POSIX for specifying SIGALRM as 14. You’re SOL
+if your system does not conform. Get a real OS.__FILE__ using octal notation and then extracted using
+pointer + offset notation.# (null) preprocessor directive (hidden as
+a %: digraph) Delete this line and prepare for a core
+dump.one, One, ONE, zero,
+Zero. ONE is particularly nasty because it
+appears as a macro taking an arg and as a plain identifier in
+main’s parameters. The rule is that whenever
+ONE is followed by ( it must be the
+macro."A useful way to decide if some piece of code is clear or not is the 'telephone test.' If someone could understand your code when read aloud over the telephone, it's clear enough. If not then it needs rewriting."
+Now try the telephone test for ‘one = zero = atoi
+(ONE[zero-1])’.write (1, 1+__FILE__+1, 1) (telephone test this as well; is
+it 1, One, ONE, one? Maybe won?).Where does the randomness
+come from?
+
+
+yarng? To measure these
+properties I counted the number of bit sequences and compared them to
+what I would expect from a generator with uniform distribution (all
+sequences equally likely to occur).yarng’s maximum
+deviations are less than or equal to rand(3)’s. Randomness
+however tends to degrade under high load averages on my system (Linux).
+This could be avoided by allowing the process one second of execution
+time instead of wall clock time (using the SIGVTALRM sent
+by the virtual timer instead of SIGALRM).Yarng in the end depends on
+fluctuations of the electrical field and the heat distribution in the
+oscillators, the implementation and state of the scheduling algorithm,
+the system load, number and temporal distribution of asynchronous events
+and last but not least the phase of the moon. God does play
+dice. Type yarng and watch Him roll.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1998/schweikh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 schweikh3
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/schweikh3
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+make all
+In the remote event that the input has more than `8192` files with
+the same size (on systems where `sizeof (char *) == 4`, or `4096` when
+`sizeof (char *) == 8`), increase the manifest constant 32767 on line
+31.To use:
+dir is the directory (or a directory tree) where you
+keep all your favorite pictures off the Internet or from
+alt.binaries.pictures.*, dofind dir -type f -print | ./samefileTry:
+./try.shAlternate code:
+SZ
+macro defined in the Makefile which if (in the code) is unset will be
+set to the default, 32767.Alternate build:
+make clobber SIZE=55555 altJudges’ remarks:
+Author’s remarks:
+What this program does
+`man ./samefile.1SAMEFILE(1) User Manuals
+SAMEFILE(1)
+NAME
+samefile - find identical filesSYNOPSIS
+./samefileDESCRIPTION
+samefile reads a list of file names (one file name per
+line) from stdin. For each file name pair with identical
+contents, a line consisting of six tab separated fields is output: The
+size in bytes, two file names, the character = if the two
+files are on the same device, X otherwise, and the link
+counts of the two files. The output is sorted in reverse order by
+size.samefile uses two stages to give optimum
+performance.stat(2) or open(2) fails. The result
+of the first stage (the file names) is written into a binary tree with
+one node for every file size. Each node is in turn a linked list of file
+names along with inode and device information. It is also at this first
+stage where checks for hard links are done. For any inode only one
+filename will be added to the binary tree.A, B,
+and C have the same size and samefile finds that
+A = B and A = C then it will not compare
+B against C (and will not output a line for
+B and C) but only for A = B and
+A = C. The algorithm will detect equality across
+arbitrarily long chains. Note however, that because only the first
+filename per inode gets into the first stage, the output for a group of
+identical files with different inode numbers is also minimized. Suppose
+you have six identical files of size 100 in an inode group consisting of
+the three inodes with numbers 10, 20 and 30:$ ls -i # output edited for readability:
+ 10 file1 20 file4 30 file6
+ 10 file2 20 file5
+ 10 file3
+$ ls | ./samefile
+100 file1 file4 = 3 2
+100 file1 file6 = 3 1file4 and
+file6 (you would gain only 100 bytes because
+file5 still exists.)LIMITATIONS
+samefile was written with no limits in mind. The number
+of input lines is unlimited. The size of the actual files is only
+limited by available virtual memory needed to compare one pair of files.
+The only hard limit is the constraint that there should not be more than
+about 8192 files having the same size. Experience has shown
+that there are rarely more than a couple dozen files of the same
+size.EXAMPLES
+find $HOME | ./samefilefind /usr -size +16384c -a -type f | ./samefilefind /pub -type f | samefile | awk '{sum += $1} END {print sum}'EXIT STATUS
+samefile runs out of memory the exit status is 1,
+zero otherwise.SEE ALSO
+find(1), ln(1), rm(1)Why I think it is obfuscated
+
+
+dev_t and
+ino_t? Heavy wizardry./* You're not supposed to understand this */
+comment.goto harmful?#include and no spaces after some of the macro names.qsort(3) or
+system("sort").read(2). Does this affect performance noticeably?samefile’s output
+and hard links (or symlinks) identical files. Writing such a script is
+left as an exercise for the deobfuscator.samefile on some directory tree, try to
+estimate how much you think it will find. Is the actual result anywhere
+near your estimate? How many copies of the GPL COPYING file
+are there on your filesystems? :-)8192
+files with the same size (on systems where
+sizeof (char *) == 4, or 4096 when
+sizeof (char *) == 8), increase the manifest constant 32767
+on line 31.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1998/schweikh3
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 1998 tomtorfs
+
+
-
+ The International Obfuscated C Code Contest
+ 1998/tomtorfs
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Tom Torfs
+Location: unknownTo build:
+make allTo use:
+./tomtorfs filename bitwidth polynom reflected init xor
+filename : file to calculate the CRC of
+bitwidth : width of the CRC in bits (decimal)
+polynom : polynomial used for the CRC (hexadecimal)
+reflected : 0 if the CRC is not reflected, 1 if it is
+init : initial value for the CRC (hexadecimal)
+xor : value to xor the final CRC with (hexadecimal)Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+
+Usage:
+./tomtorfs filename bitwidth polynom reflected init xor
+
+filename : file to calculate the CRC of
+bitwidth : width of the CRC in bits (decimal)
+polynom : polynomial used for the CRC (hexadecimal)
+reflected : 0 if the CRC is not reflected, 1 if it is
+init : initial value for the CRC (hexadecimal)
+xor : value to xor the final CRC with (hexadecimal)Examples
+CRC-16:
+./tomtorfs filename 16 1021 0 FFFF 0000CRC-32:
+./tomtorfs filename 32 04C11DB7 1 FFFFFFFF FFFFFFFFXMODEM:
+./tomtorfs filename 16 8408 1 0000 0000ARC:
+./tomtorfs filename 16 8005 1 0000 0000Portability notes
+CHAR_BIT==8. Results are undefined
+if bitwidth > sizeof(unsigned long) * 8. It is also
+assumed that EOF is -1 and 1 is a
+valid exit value to indicate failure (replace them with EOF
+resp. EXIT_FAILURE if the assumptions are false). Otherwise
+ANSI/ISO C.Special notes
+Spoiler
+
+a = argc
+A = argv
+
+b = array of unsigned long variables
+ b[0] = bit-width of the CRC (argv[2])
+ b[1] = CRC polynomial (argv[3])
+ b[2] = nonzero if CRC is reflected (argv[4])
+ b[3] = initial value of CRC (argv[5])
+ b[4] = value final CRC is XORed with (argv[6])
+ b[5] = CRC value
+ b[6] = byte from file
+ b[7] = counter
+
+B = FILE * through which the file argv[1] is opened
+
+C = typedef for unsigned longfor loop simply reads the command-line
+arguments in the b[] array. The third parameter to
+strtoul(3) causes all arguments to be in base-16 (hex)
+except the first one, which will be in base-10 (decimal).b[5] and then prints it to stdout. The bit
+reflection loops may appear a bit tricky at first, but if you have a
+good look at them they should become obvious also.Acknowledgments:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 1998/tomtorfs
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 anderson
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/anderson
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Glyn Anderson
+Location: unknownTo build:
+makeTo use:
+echo something | ./andersonTry:
+./try.shJudges’ remarks:
+#define!
+Reformatting this program by hand :-) is the easiest way to understand
+what is going on.Note about
+
+#defines not being used:fgets(3) instead.
+However to make the entries more like the original we redefined
+gets to use fgets. Unfortunately it’s not
+possible to do it through -Dfoo compiler options so there
+is a #define in the code now.Author’s remarks:
+
+ <> <> <> <> <> <>
+ _() ()/ ()/ ()/ _\) () (/_ _\)
+[] /^ |^^ /^^ /^^ [] ^^ |^^| ^^ [] [] ^^
+ <>[ [][ <>][ <>][ ][ [][] ][ ][
+
+
+ <> []
+ _()_ ()/ |() ()
+[] ^^ [] /^^ ^^| |^^|
+ ][ <>][ ][] [][]
+char at the beginning.
+This program was crafted using only operator precedence rules,
+short-circuit evaluation and recursion. Each function contains a single,
+non-empty statement. (I did have to add a couple of empty statements to
+format the code properly.) There is a single string constant which
+encodes the flag positions and other data needed for drawing the
+semaphore codes.int to
+char and the resulting loss of data. Again, if it’s OK with
+K&R, it’s OK with me.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2000/anderson
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 bellard
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/bellard
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Fabrice
+Bellard
Location: FRTo build:
+makeTo use:
+./bellardJudges’ remarks:
+23523*2^70000-1, 48594^65536+1 or
+6917!-1?Author’s comments:
+2^6972593-1) in base 10. It requires a few minutes. It
+uses a Modular Fast Fourier Transform to compute this number in a
+reasonable amount of time (the usual method would take ages !).long long type. It should
+run on any system with a gcc compiler.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2000/bellard
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 bmeyer
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/bmeyer
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Bernd Meyer
+Location: AUTo build:
+makeTo use:
+./bmeyerTry:
+./try.shJudges’ remarks:
+
+bmeyer: bmeyer.c
+ CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm-O3 as the maximum level for
+-O optimization.
+bmeyer: bmeyer.c
+ gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm-ffloat-store if you compile with GCC (this may have a
+performance penalty). The resulting binary will have a good chance to
+produce portable files, but due to the resulting double-rounding (first
+internally set to 80 bit, then to 64 bit on writing the value to
+memory), there is a small but very real chance any given file produced
+might not be portable.-O3 and
+no asm() call.Author’s remarks:
+GLICBAWLSFunction
+GLICBAWLS stands for “Grey Level Image Compression By
+Adaptive Weighted Least Squares”../glicbawls < michael.pgm > michael.glic./glicbawls < michael.glic > michael.decoded.pgmglicbawls compresses greyscale images
+(or, more precisely, “natural” greyscale images) better than any other
+program I am aware of (with the exception of the not-yet-published
+program developed for my PhD thesis). Of course, this might take some
+time, so a progress indicator is provided. To make things more
+interesting, instead of a boring bar or percentage display, an ASCII
+rendition of the image being compressed/decompressed is output to
+stderr (assuming white text on black background). If you
+have trouble recognizing the image, try squinting at it ;-).glicbawls about it by giving the
+number of columns as an argument. For example./glicbawls 260 <lavabus.pgm >lavabus.glicglicbawls to use up to 260 columns, which
+makes things much more recognizable.glicbawls’ “near lossless” compression mode. In
+that mode, the decoded pixel values are allowed to differ from the
+originals, but there is an upper limit on the magnitude of the
+difference. For example, if a maximum error of 2 is allowed, an original
+pixel value of 37 could be decoded as 35, 36, 37, 38 or 39. In order to
+use this mode, simply give the maximum allowed error as an argument,
+with a dash (-) before it. For example:./glicbawls -2 < graph.pgm > graph.2.glic./glicbawls -3 180 < graph.pgm >graph.3.glic./glicbawls -3 180 < graph.3.glic > graph.3maxerr.pgmglicbawls
+.PPM files (i.e. colour images), raw or ASCII, your choice.
+glicbawls will compress and decompress them just fine.
+However, it only does “reasonably well” on them; It beats PNG easily,
+but there are certainly programs out there that can compress colour
+images considerably better. And don’t even think about using it
+for so-called “artistic” images (i.e. anything that wasn’t scanned from
+a photo or camera)….WARNING
+glicball is rather CPU and FPU intensive. Don’t run it
+on anything slow. Things start to be usable around 300+MHz, with 600+
+being highly desirable.Compile Instructions
+glicbawls makes heavy
+use of floating point maths — and not all FPUs are created equal. Most
+importantly, the x86 and 68k FPUs use 80 bit floating point formats
+internally, while most other processors use IEEE 64 bit formats by
+default. If not taken care of, this means that a glicbawls
+file compressed on one CPU cannot generally be decompressed on
+another.glicbawls).
+Unfortunately, there is no standard way of doing so. For this reason,
+the build file contains three compile lines; one for machines
+that already use 64 bit mode by default (most RISC processors), one for
+linux/x86 machines using libc4, libc5 or glibc2.0, and one for linux/x86
+machines using glibc2.1 (glibc2.1 no longer exports the
+__setfpucw() function, necessitating the use of gcc inline
+assembly. *Grumble*).Y
+to be a command that switches it into that mode. If you fail to do so,
+your glicbawls executable will still be able to decompress
+its own compressed files, but you may be unable to exchange files with
+glicbawls on other machines.Obfuscation
+glicbawls’ features into code that
+fits the IOCCC’s size limits. All identifiers’ names are
+single-character, which was only possible by ruthless exploitation of
+scope. There is a function M() that handles nearly all
+input from stdin, handles all output to
+stdout, and also recursively calculates one of the
+mathematical expressions needed for error modelling. There is a function
+that calculates (A^(-1)*b)*x with A being a
+matrix and b and x being vectors, and does so
+in a very efficient way — but one would be hard pressed to find it.
+There is an arithmetic coder that is even less recognizable. A lot of
+loop variables don’t get initialized, but instead the code is arranged
+in such a way that they just happen to have the right value when control
+flow reaches the loops. Lots of functions use the same two global
+scratch variables. Variables change their meaning all the time, and the
+differences between compressing and decompressing are handled in rather
+subtle ways all over the program. The string that holds the ASCII values
+for displaying the progress image doubles as a description on how to
+find a pixel’s causal neighbours. And then there are a few
+#defines that really are just in there to save a few
+characters, but as an added “benefit” make the source ever more
+unreadable.Bugs, Assumptions and TODO
+glicbawls assumes that characters are 8 bit wide, and
+that the character set used is ASCII. If one of these isn’t true, all
+hell will break loose.glicbawls will happily try to encode lots of files that it
+shouldn’t touch. The old adage of “garbage in, garbage out” holds in
+that case. Furthermore, even if glicbawls detects an
+incorrect input, it fails to provide a meaningful error message, and
+instead simply aborts.glicbawls relies on the decimal representation of all
+integers having less than 255 digits. While ANSI C does not guarantee
+this, it seems rather unlikely that anyone in the foreseeable future
+would use images with 10^255 rows, columns or different
+levels of grey. Also, it is assumed that any integer used can be cast to
+a double and back without loss of precision. This limits
+the number of rows, columns and grey levels to 9 quintillion, which
+should also be sufficient for the next few years.int is used as the target of
+a "%1[#]" conversion in a scanf(3), which
+makes gcc rather unhappy, but shouldn’t really cause anyone any trouble.
+The same goes for a couple of assignments which are used as truth
+values.Algorithm
+D. That weight used is
+pow(0.8,D). 2 3 4pow(0.7,D)) of the squares of all previous prediction
+errors is taken, and the square root of the (appropriately scaled)
+result is called sigma.Photo Credit:
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+
+
+pow(0.8,D)/s, where
+s is the sigma used for encoding/decoding the particular
+previous pixel. Dividing by s is a rather arbitrary action
+justified only by the improvement in results. Mathematically, I can only
+justify dividing by s^2, or not dividing at all….↩︎O(1) calculation, rather than the
+O(previous_rows*columns) this description would suggest.↩︎glicbawls adds a bias towards an
+averaging predictor to the equation system the least squares predictor
+is calculated from. The weight that is given to this bias is constantly
+adjusted throughout coding/decoding, thus justifying the ‘a’ in
+glicbawls.↩︎Inventory for
+2000/bmeyer
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 briddlebane
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/briddlebane
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Lord Zarbon
+Location: unknown
+
Name: Moxen N.
+Briddlebane
Location: unknownTo build:
+makeTo use:
+./briddlebaneTry:
+.bashrc or equivalent file!Judges’ remarks:
+Author’s remarks:
+114 and 2, which are, according to
+Lord Zarbon, very deliberate.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2000/briddlebane
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 dhyang
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/dhyang
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeTo use:
+./dhyangTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+^_^x
+
+./dhyang and redirect output to another
+.c file.int return type (a source of
+compile warnings).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2000/dhyang
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 dlowe
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/dlowe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: J. David Lowe
+Location: USTo build:
+makeperl -MConfig -e 'print "$Config{archlibexp}/CORE\n"'Bugs and (Mis)features:
+
+STATUS: doesn't work with some platforms - please help us fix
+STATUS: known bug - please help us fixTo use:
+./dlowe [file ...]Try:
+echo "13 14 15 16 17 + - * / p" | ./dloweJudges’ remarks:
+
+
+Author’s remarks:
+Usage
+
+./dlowe [file ...]Synopsis
+dc(1) unix
+calculator.Syntax
+dc(1)
+commands:
+p prints the top stack value without altering the stack.
+P prints the top stack value, removing it from the stack, and
+ doesn't print a trailing newline.
+f prints the contents of the stack, one number per line,
+ without modifying it.
+c clears the stack.
+d pushes a copy of the top stack value onto the stack.
+r reverses the order of the top two stack values.
+ + Pops 2 values and pushes their sum.
+ - Pops 2 values and pushes the result of subtracting the first
+ from the second.
+ * Pops 2 values and pushes their product.
+ / Pops 2 values and pushes the result of dividing the second
+ by the first.
+ ^ Pops 2 values and pushes the result of raising the second
+ to the power of the first.
+ % Pops 2 values and pushes the remainder of the division that
+ / would do.(p1 - (p2 * (p1 / p2))),
+but with the innermost division calculated at integer precision. This is
+usually what you expect
+(e.g. echo "12 8 % p" | ./dlowe == 4)stdin or from a list of files
+named on the command line. Unlike dc(1), multiple commands
+on the same line must be space separated. Commands are only executed
+when a newline or EOF is encountered.Diagnostics:
+
+"stack empty" Not enough on the stack for the requested command
+"divide by zero" Attempt to divide by zero
+"unimplemented" Invalid input
+Floating point exception (core dumped) (or something to that effect)
+ Bug in Perl_sv_upgrade causes this in some cases when
+ the results of an operation are really huge (> 10^308)
+ This bug appears to be fixed in perl5.6.0
+Examples:
+$ echo '12 13 14 15 16 + + + + f' | ./dlowe
+70
+$ echo '12 13 14 15 16 17 + - * / p' | ./dlowe
+-0.0515873015873016
+$ echo '+' | ./dlowe
+stack empty
+$ echo '999999999999999 1 + p' | ./dlowe
+1e+15
+$ echo '99999999999999 1 + p' | ./dlowe
+100000000000000
+$ echo '12.5 9 % 10 * 15 + f' | ./dlowe
+50
+$ echo '7 P 6 d P P 8 p' | ./dlowe | tr 876 tpo
+pootCode Concept:
+Requirements:
+Perl 5.005_03, successfully tested against
+Perl 5.6.0, Perl 5.005_02 and
+Perl 5.004_04, and according to the version delta
+documentation, should work as-is with Perl 5.002 and later
+(which has been around since February 1996). To clarify - it’s not the
+Perl code itself that may be non-portable, it’s the C code for embedding
+Perl and for calling C from Perl.main() is deprecated” or something to that effect. But in
+Perl prior to 5.6.0, the header file “proto.h” actually had
+a prototype for main(), so applications which embed Perl
+must use the three argument form of main().Aside: history…
+Obfuscated?
+
+
+_:$_=<>; - but $SS[$#SS]-=$SS[$#SS-1]
+isn’t bad, either).if and for, in favor of their oft-neglected
+cousins, goto and ?:, in both the Perl and C
+code.goto &NAME syntax,
+AUTOLOAD for exception handling, and abuse of the default
+scalar ($_).&NAME rather than NAME()
+function calling syntax, leaving off parentheses wherever possible,
+using print() instead of printf(), and using
+the English style logic operators and and or
+rather than && and ||, for
+example.SvNV,
+SvIV, and newSVpv. I couldn’t have done better
+myself!= is synonymous with d. This also
+makes it possible to write (even more) obfuscated reverse Polish
+commands (I figure this explanation moves the synonyms from ‘bug’ to
+‘feature’!)Aside: on unobfuscated Perl
+Bending the rules?
+Auto defend
+$#_&&$_?Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2000/dlowe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 jarijyrki
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/jarijyrki
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jari Arkko
+Location: SE
+
Name: Jyrki
+Holopainen
Location: FITo build:
+makeTo use:
+./jarijyrki < infile.info > outfile.infoTry:
+./jarijyrki < finance.sheet > myedits.infoC3 and type in the following:
+C5 C6 C7 @D4 and type in the following:
+C5 C6 C7 !ESC.
+./jarijyrki < myedits.infoJudges’ remarks:
+megabytesgigabytes
+to install! This entry does not simply do the basics, it includes
+graphing features. All this program needs now is a flight simulator!Author’s remarks:
+1. OVERVIEW
+
+
++ - *
+/2. USAGE INSTRUCTIONS
+2.1. Quick Guide
+Starting
+./jarijyrki < finance.sheet > myedits.infoStopping
+Movement
+Editing
+Formulas
+
+123.45
+A1 A2 +
+B1 B2 -
+C1 C2 *
+D1 D2 /Pie charts
+
+A1 A2 A3 ...@ to create the pie chart.Histograms
+
+A1 A2 A3 ...! to create the histogram.2.2. Starting and Loading
+Spreadsheets
+./jarijyrki < finance.sheet./jarijyrki < /dev/null/dev/zero could be used but that may not
+exist on all systems.2.3. Exiting and Saving
+Spreadsheets
+./jarijyrki < finance.sheet > myedits.info2.4. Visual Overview
+A1 as
+being the current cell. Below the Formula Area is the Column Letters
+Area: A, B, and so on. Correspondingly, on the
+left side of the window is the Row Numbers Area: 1,
+2, and so on. The rest of the window is dedicated to the
+actual spreadsheet cells.2.5. Movement and Scrolling
+2.6. Formulas
+
+123.50
+A1
+A1 A2 +
+B1 B2 *
+C1 C2 -
+D1 D2 /
+A1 A2 + 2 *A1 and
+A2, and then multiplies the result by two.2.7. Graphical Formulas
+@ operator. The program
+automatically computes the relative size of the slices.
+A1 A2 A3 A4 @A1 to
+A4. The pie formula is shown above the pie for
+reference.! operator:
+A1 A2 A3 A3 !2.8. Errors in Formulas
+2.9. Compilation
+Parameters and Configuration
+
+
+-DC=XK_Up
+-DL=XK_Down
+-DO=XK_Left
+-DV=XK_Right
+-DR=XK_Escape
+-D_=XK_BackSpaceXK_Delete. XK_Escape
+might be better in some cases as one of the function keys. Likewise for
+the arrow keys.
+-DU=40
+-DT=98
+-Dz="(T+1)*U*U"
+-DQ=80
+-DS=20S
+also defines the size of the left (x1) and top margins
+(x2).
+-DN=10
+-DB=5
+-DG=23
+-Dp=7
+-DM="((p+1)*Q)+S"
+-DH="(G*S)+S+S"G and p parameters if
+you want to change the window size in normal cases. Experimentation with
+M and H can be used to get other types of
+effect such as adding a margin also at the bottom of the window.3. IMPLEMENTATION
+@ and ! operators, and note
+the use of *#i in one of the macros (can you see why?).
+Extreme compression has been the key in writing this program. With
+compression comes the use of ASCII code numbers instead of character
+constants and so on. (This particular obfuscation is not really a
+desirable one as it is not completely portable. But it certainly was a
+necessary one.)i(=) do or does it do anything? Why?4. WARNINGS AND CAVEATS
+4.1. X11 Paths in Compilation
+4.2. Font Sizes
+4.3. Screen Sizes
+4.4. Spreadsheet Dimension
+Changes
+
+
+4.5. ASCII Reliance
+32 is shorter than ' '.4.6. Command Line Single
+Character Defines
+G or p)
+for a -D option might break certain systems, if those
+characters are used in the included X header files in certain kinds of
+places. If this happens, you may move the offending character to a new
+name by exchanging it on the command line and in the program with
+another character. Note that there are no free characters in
+the program currently.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2000/jarijyrki
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 natori
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/natori
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: NATORI Shin
+Location: JPTo build:
+makeTo use:
+./natoriTry:
+./try.shAlternate code:
+acos(l/2) into acos(-l/2) which we have
+done in the alternate version.Alternate build:
+make altAlternate use:
+./natori.altJudges’ remarks:
+main(). We have had to uglify
+this program in order to prevent C compilers from failing to compile it
+due to (the now changed) unusual arg types of the main()
+function.Author’s remarks:
+acos(l/2) into acos(-l/2).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2000/natori
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 primenum
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/primenum
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Raymond
+Cheong
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+echo n | ./primenum nn is an integer.Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+Description
+LessThanOrEqualTo) and blatant
+“errors” (e.g. Zero). This program clearly requires
+“debugging.”stdin and
+returns garbled text on stdout. Fortunately, you can
+recover the original message simply by running the program a second
+time. Try:./primenum n < textfile | ./primenum n > textfile2
+diff textfile textfile2Features
+
+
+
+
+
echo THIS MESSAGE IS IN ALL CAPS | ./primenum 32Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2000/primenum
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 rince
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/rince
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: James
+Bonfield
Location: GBTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./rince number number2DISPLAY is not set the program will very likely crash
+or do something different.
+That's not a bug, that's a feature.Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+How to use it
+./rince./rince 0.01./rince 0 2441193.6
+./rince 0.01 2441193.6-4712 (4713BC), starting at 12 noon GMT.12 To aid conversion from
+our time (GMT) to Julian day there is a supplementary program named: dmy2jd.c. Run it with
+day_float month year as arguments. See below for an
+example.What it does
+I to
+IV, I being the closest to the planet and
+IV being the furthest. They are:
+I Io
+II Europa
+III Ganymede
+IV Callisto
+ N
+ ^
+ |
+ E <---+---> W
+ |
+ v
+ SHistory
+
+By early 1610, Galileo had further improved his telescope by
+double its power, so it now enlarged objects a thousand
+times. He began looking at the stars and couldn't believe how
+many more he could now see! The number seemed infinite. He was
+beginning to realize the fixed stars weren't a flat distant
+wall on a globe, but a three-dimensional expanse bigger than
+anyone had ever thought!
+
+Then, on January 7, about an hour after sunset, Jupiter rose
+in the east, and Galileo happened to turn his powerful scope
+on its bright disk. It wasn't the first time he had looked at
+Jupiter, but before it was with one of his lesser-powered
+telescopes. This time, though, he noticed three small but
+bright stars near the planet, two to one side and one to the
+other. He wondered at how bright the small stars were and how
+they were arranged in what seemed like a straight line. The
+next night he decided to look at Jupiter again, and to his
+surprise, the stars had moved. But not in such a way as he
+would expect. If Jupiter was moving as it normally should, the
+stars would be east of Jupiter. But all three were to the
+west! The next night was cloudy, but on January 10, Galileo
+was able to observe the planet again. One of the stars was
+gone, and the other two were now on the east side. As the
+stars moved around Jupiter on each succeeding night, and were
+finally joined by a fourth star, it dawned on Galileo that
+what he had found were moons orbiting Jupiter! Almost at once
+he realized that this was proof that not all objects orbited
+the Earth. Here were four bodies that were orbiting
+Jupiter. One argument against the sun-centered theory was, if
+the Earth orbited the sun, wouldn't the moon get left behind?
+Here he could see for himself that somehow, a planet could
+orbit the sun, and not leave a moon behind!./rince 0 $(./dmy2jd 7.8 1 1610)
+./rince 0 $(./dmy2jd 8.8 1 1610)
+./rince 0 $(./dmy2jd 10.8 1 1610)./rince 0 $(./dmy2jd 9.85 1 1610)Assumptions
+
+
+DISPLAY environment variable is set and the
+X display can opened. If this is not the case the program will
+crash.Obfuscations
+
+
+#include
+lines#define and
+#include lines#defines has been
+restricted primarily to a space-saving mechanism.typedefs means that the types
+used are still obscured unless further replacement edits are
+made.indent(1) seems to do a reasonable job, provided
+that the #defines are expanded first. This doesn’t lay the
+algorithm particularly bare though as most of the obfuscations are not
+simple code layouts.;,
+{ and } symbols as possible), which will give
+you a Reverse
+Polish notation chunk of mathematics.X() is not specified, so it
+defaults to int. Horror of all horrors - this function does
+not return an integer type (it doesn’t contain any specific
+returns). The return value from X() is not
+accessed. The same problem occurs in main() - it does not
+return. However main() never exits unless there is a
+serious error.XDrawText (which should be
+XTextItem) is passed as a compatible structure, but without
+casting. This is to reduce code space. A more elegant solution is to
+remove the struct {...} Z completely and use
+XTextItem f={i-127+r/3*2,r%3+r/3+1,0,E} at the start of
+XDrawText block. Although this is accepted by several
+compilers, it is not strict ANSI due to the non-constant initialisers. A
+pity.usleep(). This is a POSIX call
+(it is BSD), but it’s supported on many systems. It may be implemented
+using select() or poll() if required, or as a
+final solution you can change the usleep(10000) to
+sleep(1). To compile on systems which do not have
+usleep(), but do have select(), the following
+may suffice as an additional compiler argument:
+-Dusleep={time_t v[2]={0,10000};select(0,0,0,0,v);}gcc complains about “unreachable code at beginning of
+switch statement”, although removing some of this code will prevent the
+algorithm from working.gcc also suggests that I should be using extra
+parenthesis, but I’m taking this as good comment :-)
+
+;
+command do in J-code?strlen() and sizeof() simply to return
+useful numerical values, using irrelevant arguments.References
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+
+Inventory for
+2000/rince
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 robison
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/robison
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Arch D.
+Robison
Location: USTo build:
+makeTo use:
+./robisonJudges’ remarks:
+Author’s remarks:
+TITLE OF INVENTION
+FIELD OF INVENTION
+BACKGROUND OF THE INVENTION
+BRIEF SUMMARY OF THE
+INVENTION
+BRIEF
+DESCRIPTION OF SEVERAL VIEWS OF THE INVENTION
+DETAILED DESCRIPTION OF
+THE INVENTION
+x); the program plays White
+(o). Said Black goes first. On operator’s turn, said
+program requests a position and direction. FIG. 1 shows the numbering of
+the squares. FIG. 2 shows the numbering of directions. As per standard
+rules, if one or more jumps are possible, one of the jumps must be taken
+in preference to other moves. Said operator enters the numbers for the
+position and direction. If after jumping over a piece, another jump is
+possible, and said piece did not become a king after said jump, standard
+rules require that another jump be taken. In said case, said program
+requests a direction only in which to continue jumping from the present
+position. Kings are denoted by upper case. FIG. 3 shows a sample board.
+There is a black king (X) on square 30 and a red king
+(O) on square 2. The numbers on the right are the numbers
+of the rightmost square in each row.main(), executes a plurality of statements, and exits via a
+return statement. FIG. 4 presumes that type
+int is 32 bits and short is
+16 bits, which are essential to the preferred embodiment of
+the invention. FIG. 4 also presumes that the host computer uses ASCII
+encoding for characters. It should be obvious that practitioners skilled
+in the art of C programming can remove said limitations.CLAIMS
+
+
+
+
{’, ‘}’, or ‘;’
+immediately followed by whitespace.~- and -~
+replace the obvious arithmetic operations.
+
DRAWINGS
+FIG 1.
+
+ +--+--+--+--+--+--+--+--+
+ |32| |31| |30| |29| |
+ +--+--+--+--+--+--+--+--+
+ | |28| |27| |26| |25|
+ +--+--+--+--+--+--+--+--+
+ |24| |23| |22| |21| |
+ +--+--+--+--+--+--+--+--+
+ | |20| |19| |18| |17|
+ +--+--+--+--+--+--+--+--+
+ |16| |15| |14| |13| |
+ +--+--+--+--+--+--+--+--+
+ | |12| |11| |10| | 9|
+ +--+--+--+--+--+--+--+--+
+ | 8| | 7| | 6| | 5| |
+ +--+--+--+--+--+--+--+--+
+ | | 4| | 3| | 2| | 1|
+ +--+--+--+--+--+--+--+--+FIG. 2.
+
+ 1 0
+ \ /
+ .
+ / \
+ 3 2FIG. 3.
+
+ o o X . 29
+ o . . . 25
+ o . . o 21
+ . o . o 17
+ x . . . 13
+ . . x . 9
+ x x . . 5
+ x x O x 1FIG. 4
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2000/robison
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 schneiderwent
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/schneiderwent
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Craig
+Schneiderwent
Location: USTo build:
+makeTo use:
+./schneiderwentTry:
+./schneiderwent schneiderwent.data
+./schneiderwentJudges’ remarks:
+Author’s remarks:
+
+
+pthreads of my
+thought processes tend to be translated into code in a verbose manner.
+Some of the #defines in this entry’s code are to mitigate
+this personal deficiency.Obfuscation
+
+
+printf(3)ing console messages stored as EBCDIC character values
+- this is not an attempt at encryption, but rather at cross platform
+compatibility.?: operator.'J' by
+2 - the ASCII value of the character is even, the EBCDIC
+value is odd.printf(3)ed are determined via
+multiple table lookups and bit-masked values.printf(3)ed.setjmp(3)/longjmp(3) combination.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2000/schneiderwent
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 thadgavin
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/thadgavin
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Gavin
+Buttimore
Location: unknown
Name: Thaddaeus
+Frogley
Location: GBTo build:
+make altTo use:
+./thadgavin.altTry:
+./thadgavin_sdlusleep(3) with two default values, one
+for SDL and one for curses. The curses and SDL macros are defined in the
+Makefile in a way that makes it easy to redefine the values:
+SLEEP is how long the program sleeps (in microseconds)
+between output with curses and SDL_SLEEP is how long it
+sleeps (also in microseconds) for the SDL version.15000 you can
+do:make SDL_SLEEP=15000 clobber alt40:make SLEEP=40 clobber altOriginal code:
+reset after
+execution of this program if your terminal is messed up after exiting
+the program (send intr, typically ctrl-c) as the program does not call
+endwin(). Using reset will clear the screen.
+The alt code, as noted above, allows one to quit early so this is not a
+problem there.Original build:
+make allOriginal use:
+./thadgavinOriginal try:
+./thadgavin_sdlJudges’ remarks:
+Authors’ remarks:
+To use under DOS:
+gcc thadgavin.c -o thadgavin.exe -Wall -lm -O6 -mpentium -fomit-frame-pointer -ffast-mathTo
+use under Windows, X-Windows or macOS using the Simple DirectMedia
+Layer:
+gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lSDL -DSDL -lmTo use curses:
+gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lncurses -lmWarnings
+
+thadgavin.c.c:46: warning: passing arg 2 of `SDL_SetColors' from incompatible pointer type
+thadgavin.c(46) : warning C4133: 'function' : incompatible types - from 'unsigned
+char *' to 'struct SDL_Color *'
+thadgavin.c(63) : warning C4026: function declared with formal parameter list
+thadgavin.c(77) : warning C4244: '=' : conversion from 'double ' to 'unsigned
+char ', possible loss of data
+Recommended dosage:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2000/thadgavin
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2000 tomx
+
+
-
+ The International Obfuscated C Code Contest
+ 2000/tomx
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Thomas P John
+Location: NLTo build:
+makeTo use:
+./tomxTry:
+./try.shAlternate code:
+mkentry.Alternate build:
+make altAlternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+Summary
+/bin/sh) script. But unlike some other multi-language
+programs, this one is NOT meant to print Hello, world in
+all 3 cases (At least in the true sense ;-)). The C, Makefile and shell
+code build upon each other to create a C program (?) which when executed
+as a shell script will compile itself through the C compiler using a
+Makefile! - Pretty useful, Eh?Top 5
+reasons (IMHO) why this code is an entry for IOCCC
+
+
+IOCCCs.Notes
+
+
+#include "prog2.c" in the place of the main(),
+leaving the complexities of the C file elsewhere and making this source
+still acceptable to make and sh. The following
+modification to the last few lines will compile the IOCCC’s famous mkentry.c.
+.PHONY: /* true clean */
+#undef true
+#include "mkentry.c"
+
+%:%.c dependency to a
+$(PROG):$(PROG).c form can compile this program with some
+other makes (I got it to work in Windows using nmake and
+Gnuwin32’s sh ;-) )./tomx.c clean. This
+will do the same as make clean :-)). Also:
+./tomx.c allCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2000/tomx
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 anonymous
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/anonymous
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anonymous
+2001
Location: GBTo build:
+makemake, MUST be compiled as 32-bit ELF binaries. In the case
+that this fails these programs will be compiled as 64-bit binaries as
+alternate code, anonymous.ten.alt and
+anonymous.bed.alt, ELF or otherwise. However trying to use
+the entry on these files will fail. See Alternate code below for information on how
+to compile these programs as 64-bit binaries (or whatever your system
+will compile them as).Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./anonymous x86_programTry:
+./try.sh
+
+./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binaryanonymous itself? Can you run the program
+successfully after it without recompiling?Alternate code:
+Alternate build:
+make altAlternate use:
+./anonymous.ten.alt
+
+./anonymous.bed.altA 2023 note about
+the warning from the author:
+Judges’ remarks:
+Author’s remarks:
+make anonymous.ten), meant to be compiled as a 32-bit ELF
+binary.anonymous.ten, and its source (dull) are
+included as data files.Warning
+Features
+Target Library Linking:
+Automatic Endian
+Detection/Reversal:
+Configuration:
+Warnings:
+-Dwarning='-Dprocessor'
+line and the $$warning from the compiler invocation.Optimization
+-O1 switch for the compiler.
+Increasing the optimization level will make the program run
+slower, while compiling the program without any optimization
+will allow it to run faster.Obfuscation
+#defines at the top. This may seem a somewhat tired old
+obfuscation - however since many of these macros are (sometimes only)
+used by the program once it has dynamically recompiled itself, they are
+only referenced within the source code from within strings - and
+therefore the macros cannot be expanded. Furthermore, some of these
+strings of code are not given as strings, but instead are wrapped up in
+macros that use the # preprocessor operator to turn them
+into strings. In the hope of throwing off a few C beautifiers the macro
+to generate the strings is not contained within the source code but
+instead is passed in on the command line.exit(3), there are some nice subtle little
+obfuscations. For example, you may notice that there are a couple of
+macros that use the ## preprocessor operator to build pairs
+of functions. One of these macros is used to build pairs of functions of
+which only one has local variables which shadow global variables: so one
+modifies the global state, and the other doesn’t.main() etc.) gets turned into a
+frogstring. The C compiler sees a string by itself in
+the code, thinks “yup, that’s a valid C expression”, and quietly moves
+on to the next line of code.Limitations
+Complete Program
+system(3) and
+execv(3) may imply that it is not a complete program in its
+own right, as it relies on other programs. The call to
+system(3) is a call to ask gcc to recompile the translator
+with a new set of switches, and the call to execv(3) asks
+for the newly compiled program to be executed. I would point out that
+almost every other entry to this competition also require a C compiler
+(well, the published winners at any rate, and I recognize that a few
+don’t). There is little real difference between this program and one
+like last year’s entry dhyang; both
+are just C programs that generate C code as their output.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2001/anonymous
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 bellard
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/bellard
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Fabrice
+Bellard
Location: FRTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fix
+STATUS: doesn't work with some platforms - please help us fixTo use:
+./bellard fileTry:
+./bellard bellard.otccex.cJudges’ remarks:
+<JUDGES_COMMENTS> :-)Author’s remarks:
+OTCC is an Obfuscated Tiny C Compiler for i386-linux. It
+generates FAST! i386 32 bit code (no bytecode) and it is powerful enough
+to compile itself. OTCC supports a strict subset of C. This
+subset is compilable by a standard ANSI C compiler. OTCC
+compiles, assembles, links and runs C code without the need of any other
+program../bellard bellard.c [args]...args are given to the main() function of
+bellard.c (argv[0] is bellard.c).Examples:
+
+
+./bellard bellard.otccex.c 10
+
+./bellard bellard.c bellard.otccex.c 10
+
+./bellard bellard.c bellard.c bellard.otccex.c 10#!/usr/local/bin/otcc at the beginning of your C source if
+you installed otcc at this place.Supported
+C language subset (read joint example bellard.otccex.c to have an introduction to
+
+OTCC dialect)Expressions:
+
+
+*
+/ %, + -,
+>> <<, <
+<= > >=, ==
+!=, &, ^, |,
+=, &&, ||.&& and || have the same
+semantics as in C: left to right evaluation and early exit
+(short-circuited).&, * (pointer
+indirection), - (negation), +, !,
+~, postfix ++ and --.*) only works with explicit
+cast to char *, int * or
+int (*)() (function pointer).++, --, and unary &
+can only be used with variable lvalue (left value).= can only be used with variable or *
+(pointer indirection) lvalue.int) variables and
+functions can be declared. Variables cannot be initialized in
+declarations. Only old K&R function declarations are parsed
+(implicit integer return value and no types on arguments).OTCC uses the libc dynamic linker to resolve undefined
+symbols.{ }) are
+supported as in C. if and else can be used for
+tests. The while and for C loops are
+supported. break can be used to exit loops.
+return is used for the return value of a function.0x
+or 0X prefix), or octal (0 prefix).#define is supported without function like
+arguments. No macro recursion is tolerated; other
+preprocessor directives are ignored.\n, \", \' and \\
+escapes are recognized.Obfuscation:
+#defines must be used to
+compress the code, and integrated i386 code generator leads to non
+obvious code.Portability:
+OTCC only works on i386 linux because it generates i386
+code. OTCC also relies on little endianness, unaligned
+memory accesses and ASCII representation of characters. It also supposes
+that no valid pointers are less than 512. If all those constraints are
+met, then OTCC could be theoretically used to “cross
+compile”, although no such support is currently integrated.OTCC uses the dynamic linker to resolve symbols with
+dlsym(3), so -ldl must be used when you
+compile and link it.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/bellard
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 cheong
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/cheong
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Raymond
+Cheong
Location: USTo build:
+makeTo use:
+./cheong digitsTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Operation
+$ cc -o cheong cheong.c
+$ ./cheong 1234567890
+35136
+$ ./cheong 0200000000000000000000000000
+14142135623730Portability
+gcc -ansi -Wall cheong.c
+cheong.c:3: warning: third argument of `main' should probably be `char **'Obfuscation
+
+
+4 - 8 equals
+6 carry a -1main()Minor obfuscations:
+
+
+Challenges for the masses:
+
+
+o?(c+999)%10-(D[I]+92)%10 not equivalent to
+(c-D[I]+7)%10?Appreciation
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/cheong
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 coupard
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/coupard
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Pierre-Philippe
+Coupard
Location: unknownTo build:
+makeTo use:
+./coupardTry:
+/dev/audio or
+/dev/sound/dsp:./coupard > /dev/audio
+./coupard > /dev/sound/dsp./coupard | sox -q -traw -r8000 -b8 -e unsigned-integer - -tcoreaudioJudges’ remarks:
+Author’s remarks:
+/dev/audio has been chosen:
+/dev/audio is a rather ancient fixed-format audio interface
+that is supported by the majority of Unices that can do sound, as a
+lowest-denominator sound I/O interface.Program usage
+./coupard > /dev/audio
+
+/dev/audio, have your sound card enabled, the
+volume up, the speakers connected … :-)sox is the Swiss army knife of Unix audio tools). The
+command:./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wavtest.wav.Audio quality
+Speech generation
+s and f sound very much the same
+at 4KHz, so they can be merged into one phoneme). Because the psychoacoustic
+context around those phonemes is just sufficient, the words can be
+interpreted correctly most of the time despite the fact that they are
+pronounced quite wrongly.Data compression
+Note on compiler warnings
+and lint
+gcc -Wall -Werror -ansi.
+If the -pedantic flag is used, gcc will complain about the
+length of the data string and the sign of its type, and also the fact
+that main() returns with no value. The confusion with the
+sign of the char type doesn’t matter with the data string because it’s
+composed only of printable characters under 127.lclint, it complains about
+a huge list of things that, if corrected to make lint happy, would
+probably double the size of the source code.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/coupard
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 ctk
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/ctk
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Chris King
+Location: unknownTo build:
+makeTo use:
+./ctkAlternate code:
+l for
+right, h for left and k for straight.Alternate build:
+make altAlternate use:
+./ctk.altJudges’ remarks:
+Author’s remarks:
+,./, [ ], or bnm to go left,
+straight, and right respectively. Use 1234 to switch gears.
+q quits. The faster you go and the thinner the road is, the
+more points you get. Most of the obfuscation is in the nonsensical if
+statements among other things. It works best on the Linux console: you
+get engine sound (!) and the * Lock keyboard lights tell you what gear
+you’re in (none lit=4th). The q argument (no leading
+-) will silence the sound. It won’t work on a terminal
+smaller than 80x24, but it works fine with more (try it in an XTerm with
+the “Unreadable” font and the window maximized vertically!).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/ctk
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 dgbeards
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/dgbeards
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Doug
+Beardsley
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./dgbeardsAlternate code:
+Alternate build:
+make altAlternate use:
+./dgbeards.altTry:
+
+That's not a bug, that's a feature.Judges’ remarks:
+Author’s remarks:
+FAQ
+Q: What does this program do?
+
+
+Q: How do you use this
+program?
+
+
+quit quits the programg causes the computer to make a moveA - H.
+Rows are numbered from bottom to top with the numbers 1 -
+8. A sample move from the opening position is
+E2E3. This means to move a piece from square
+E2 to E3. From the opening position, this
+corresponds to moving the king pawn forward one square. This is
+generally to be considered one of the best opening moves in suicide
+chess. All moves, captures and otherwise, are represented with this
+notation. A special case is pawn promotion moves. They use the same
+notation followed by an = and a letter representing the
+piece to promote to. The letters are R, N ,
+B, Q, K representing rook,
+knight, bishop, queen, and king respectively. The letters must be upper
+case.Q: Are there any
+limitations in your program?
+Q: What is the
+playing strength of this program?
+kenny that this
+program can beat, but that is about it.srand(3),
+rand(3) and the extra code for the required include files,
+the time(3) function is used as the source of random data.
+It is a slow function, and since it is executed inside the search loop,
+there is a significant performance decrease. To make it faster, replace
+the time(3) call with rand(3) and add the line
+srand(time(0)); to the beginning of main(). I
+used the more inefficient time(3) function to illustrate a
+different (and somewhat obfuscated?) way of generating random
+numbers.Q: Why is this program
+obfuscated?
+if() statements in some places. The ternary operator is
+used. In the author’s opinion, use of the ternary operator is almost
+always a strong argument for employee turnover.Q: What about the compiler
+warnings?
+gcc -Wall, the compiler generated
+the following warnings:
+suggest parentheses around + or - in operand of &
+array subscript has type 'char'
+return type defaults to 'int'
+control reaches end of non-void function
+value computed is not usedvalue computed is not used warning happens because I
+use the && operator and take advantage of short
+circuit evaluation instead of using an if() statement.suggest parentheses... warnings are given because of
+expressions that depend on operator precedence details in the C
+language. Eliminating these warnings would reduce obfuscation.Q: Why does this
+program crash when it loses?
+s=(e=-V(n-1,o))>s?Y=G,e:s; change the >
+to a >= and the bug will be gone.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2001/dgbeards
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 herrmann1
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/herrmann1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Immanuel
+Herrmann
Location: DETo build:
+makeBugs and (Mis)features:
+
+STATUS: missing files - please provide them
+STATUS: known bug - please help us fixTo use:
+./herrmann1.sh 'prg=file'Try:
+./herrmann1.sh 'prg=herrmann1.times2'./herrmann1.sh 'prg=herrmann1.gcd'Judges’ remarks:
+Author’s remarks:
+
+
+O(n), where n is the length of the output.
+This means for example that you can solve NP hard problems in polynomial
+time! ;-)How to use it
+For the impatient
+herrmann1.turing and herrmann1.gcd are sample programs for the
+Turing machine. For example, type./herrmann1.sh 'prg=herrmann1.times2'
+/*
+*
+* State: st2.
+*
+* _ _ _ _ _ * _ _ _ _ _ _ _ _ _ _ _ _ _
+* ... O O I I I I I O I I I I I O O ...
+* ~ ~ ~ ~ ~ * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+*
+*
+*/./herrmann1 to see the final result. The output will be
+ *
+..OOIIIIIIIIIIIIIIIIOOOO..
+ *times2.turing. To provide your own
+tape, type (for example)./herrmann1 prg=times2.turing tape="O O O I I I O O O"Os and Is are letters, not digits.)
+You might prefer to provide only a finite portion of the tape, like I
+did above. In this case, the remainder of the tape is filled with
+Os. ;-)
+./herrmann1xterm is not very good. The KDE
+terminal konsole or the text console under linux are much
+better. Simply try some out.Writing your own programs
+plus1.turing. Here’s what it could look like:/* Search beginning of number. */
+#define start_O O, right, start
+/* Number found. Move one step to the left. */
+#define start_I I, left, st2
+/* Write a I and stop */
+#define st2_O I, left, stopst2_I has been left out.) - The
+order of the lines is irrelevant. - You may use C-style comments. (Would
+you have guessed it?)./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'Os). For many programs, this doesn’t make much sense (as is
+the case for plus1.turing). So you might want to provide a
+default tape by adding a line like#define tape O O O O O I I I IDebugging
+#define start_I I, left, st2./herrmann1 'prg=plus1.turing'
+ *
+..OOOOOOOOIIIIOO..
+ *Os, but when it arrived at the
+I (still in state start), the error occurred.error and then exit.What the build script does
+sed.#line directives if I didn’t
+suppress them with the -P option.)Some more details
+
+
+-D before. I had a slight technical problem doing
+this (especially with the spaces that can appear within the tape
+argument). That made the build script a bit longer.#defines in the first
+preprocessing. The program then “remembers” them. However, it doesn’t
+matter if they are passed in all pre-processes. (This doesn’t sound very
+impressive, but it has required some extra lines of code.)herrmann1-1.c and herrmann1-2.c are
+generated.error is generated. This file is
+removed after the compilation, except if gcc produced an error; then it
+contains the error message. (I can’t let gcc output all its messages
+directly, because the warnings would clobber the animation. I could have
+made the compile script output the error file in case of an error, but I
+didn’t want to make it yet longer.)Some technical details /
+obfuscations
+
+
+#defines with the result. But there’s a problem
+with this: it is impossible to output a #define result xxx,
+where xxx depends on the previous value of result. Try it
+if you don’t believe it. And find out what I did instead.#define tape OOIOOIOIIIIO
+contains the information, but then, how do you access the information?
+(For example, you won’t be able to write preprocessor code which
+replaces the first O by I.) My answer looks
+very much like the way a stack would have been implemented in lambda
+calculus. (The tape is implemented as two stacks, to be exact.) And
+still, there were some technical problems to solve. Look at the program
+for more details.w j k(P ## x) does.
+ #define a 0&0
+ #if !aCompatibility
+
+
+__FILE__ and that preprocessing directives are not
+recognized within macro args. My answer to this is “yes, I know this and
+it’s all right”. With -Wall, I also get some warnings about
+/* inside comments (Well, I like some well-placed
+/*/*/.) as well as some suggestions where to place some
+more parentheses (as if I didn’t know the operator precedence).cc all produced only rubbish.
+Apparently, the preprocessors didn’t really work. (I don’t feel guilty
+there, either. Even with very simple programs, they produced mysterious
+output.)-P option to gcc
+to suppress the insertion of #line directives. If your
+compiler doesn’t support this option (and does insert #line
+directives), you should change the call to sed to remove
+them, too: Add
+ -e "/^#line/ d"#line directives look
+like
+ # 15 "filename"
+ -e "/^# [0-9]/ d"-ansi -pedantic turned on, but on some
+systems, the stdio.h is not compatible to that, so I turned
+it back off.#!/bin/bash or something like this at the
+beginning.-q option from diff in
+the build script.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2001/herrmann1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 herrmann2
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/herrmann2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Immanuel
+Herrmann
Location: DETo build:
+makeTo use:
+./herrmann2Try:
+./try.sh
+/[pon]\
+/l
+/[po]
+/q
+/nJudges’ remarks:
+Author’s remarks:
+How to use it
+
+
+a
+means close to the paper, z means far away. The info files
+are examples. Be aware that the size of the picture is restricted to
+about 9k../herrmann2 < herrmann2.ioccc
+
+./herrmann2 "234 84 045 5 6765 7487 65190 84 656 254 12 43931 818 0 6542 \
+341 45 567 76967 7244 606 976567 895 81898 095 68678 1843 4650547 \
+565980691 389 04974" < herrmann2.iocccSome hints to get better
+results
+
+
+Extra-Features
+
+
+./herrmann2 \
+'char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;'\
+' ;l ;i(V)man,n {-!har ; =Aadre(0,&e,o||n -- +,o4,=9,l=b=8,'\
+'!( te-*Aim)|(0~l),srand (l),,!A,d=,b))&&+((A + te-A(&(*)=+ +95>'\
+'e?(*& c_*r=5,r+e-r +_:2-19<-+?|(d==d),!n ?*d| *( (char**)+V+), ('\
+' +0,*d-7 ) -r+8)c:7:+++7+! r: and%9- 85! ()-(r+o):(+w,_+ A*(=er'\
+'i+(o)+b)),!write,(=_((-b+*h)(1,A+b,!!((((-+, a >T^l,( o-95=+))w?'\
+'++ &&r:b<<2+a +w) ((!main(n*n,V) , +-) ),l)),w= +T-->o +o+;{ &!'\
+'a;}return _+= ' < herrmann2.ioccc
+
+Why this program should win
+
+
+-D options -
+something I’ve seen even some palindrome programs do. In fact, at my
+first attempt at writing the program I became convinced that it isn’t
+possible without cheating. But then I found out that with comments or
+defines, it would become trivial, so I had to try harder…() and ?:, and full of unnecessary operations
+which do not really help making it readable. And it contains a lot of
+“magic numbers”. (My favourite is the 7 in line 15 (each
+one). Which is the other digit I could have put there instead, and what
+other changes to the program would have been necessary? Without
+violating the constraints of course.)main() recursively is nothing new. New however is that this
+program only needs a logarithmic recursion depth! (Find out how this
+works.)./herrmann2 < herrmann2.cupRequirements to the
+compiler / Compatibility
+
+
+int variables, functions and parameters without
+specifying their type. The biggest problem was to put
+int main(int c, char ** v){ into the program. After some
+time, I became convinced that this is impossible. Finally, at least I
+managed to squeeze main(c, v){ into the constraints
+instead.#includes at the beginning
+of the program. Usually, this is not really necessary with gcc. However,
+for this program it would have been, because some functions appear as
+function pointers, and as such they are not generated implicitly. So the
+build script has to pass -include ... to gcc. A problem
+with this is that the complete path of the include files has to be
+provided. In the build script, I assume that the path is
+/usr/include, but this can easily be adapted.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2001/herrmann2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 jason
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/jason
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jason
+Orendorff
Location: USTo build:
+makeTo use:
+./jasonJudges’ remarks:
+Y and Z can cause problems. Go ahead, try it!
+:-)Author’s remarks:
+cc -o jason jason.c
+./jason
+you are in a maze of twisty little passages
+caves lead: left forward back
+you see
+ a lamp
+> _get lamp”, then use the direction words
+“left”, “right”, “forward”, and
+“back” to explore the caves. Note that these words can
+refer to different passages depending on which way you’re facing.
+“back” always takes you back the way you came. Type
+“quit” to quit.
+
+# symbols than the average entry."%d \n" and
+"Y\n : ! ,.?>").for
+loop, and it is clearly the product of a deranged mind. Running the
+preprocessor only makes it worse.Ys to Zs and vice versa
+results in some unexpected side effects.gcc also generates a warning about
+some calculations not being used. Having just spent 19 hours staring at
+this program, sweating over every character, I swear gcc is wrong.
+ the fish scales Q)++j<
+ the shooting star -~- ~ -~i +GAME STRATEGY SPOILER
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/jason
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 kev
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/kev
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Kevin Pulo
+Location: AUTo build:
+make, and . keys. See alternate code below.Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./kev # in one terminal
+
+./kev hostname # in another terminalTry:
+./kev # in one terminal
+
+./kev localhost # in another terminal on the same hostmake clobber SPEED=50 all # original default value which is very fastmake clobber PORT=3773 allsocket(2) syscall with the l_ macro, changing
+the L variable like one would PORT. Of course
+you can do more than one at the same time. For instance to change the
+speed and port:make clobber SPEED=512 PORT=3773 allxterm try on one system:xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&Alternate code:
+, and . keys to move your
+paddle.Alternate build:
+make altAlternate use:
+kev.alt as you would kev.Alternate try:
+xterm try on one system:xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&Judges’ remarks:
+Author’s remarks:
+REQUIREMENTS
+
+
+usleep(3)DESCRIPTION
+ncurses for display. It supports variable terminal sizes
+(though both players must have the same terminal size) and game speeds.
+Each player has a paddle to hit the ball, and you get points for getting
+the ball past your opponent’s paddle. It’s pretty fun! :)RUNNING
+./kev./kev localhostXwindows:xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
+xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&PLAYING
+,
+(i.e. < but don’t press shift). To move your paddle
+right, hold down .. To quit, either player may press
+q.kbdrate -r 24.0 -d 250
+(kbdrate might be “hidden” from normal users in
+/sbin, and you might need to be root anyway), in
+Xwindows try xset r rate 250 24 (find out your
+current rate first with xset q, so that you can reset it
+later).BUILDING
+make to use the Makefile as above. The
+SPEED variable in the Makefile controls the speed of the
+game (defaults to 50). This speed is the delay between
+frames in milliseconds. Thus a value of 0 will make the game go as fast
+as your network can handle, and values less than 50 are useful for
+larger terminals or more exciting games. The program needs bandwidth
+equal to 1/s bytes per second (where s is the speed value).
+Any latency on the network will be added to s - so you
+should probably subtract any latency from the value of s
+you want to have. Given that loopback and fast Ethernet
+LANs are both much less than 1ms of latency, you should only need to
+worry about this if you plan on playing over a slower link like a cable
+modem, DSL, or (God-forbid) dial-up.PORT variable in the Makefile. If the default of
+5455 is blocked for whatever reason, you can change it to
+something else. Of course if you use a port < 1024, you’ll need to be
+root.OBFUSCATION
+BUGS
+-Wall -ansi -pedantic) on my Linux system, but all are
+completely harmless.timeout(0);, notimeout(win, TRUE);,
+nodelay(win, TRUE); and/or
+keypad(win, FALSE);, it still seems to force a delay into
+calls to getch() - I’m guessing at a termcap/terminfo
+level. At any rate, I can’t seem to force no delay. This is a shame,
+because it basically plays havoc with the input code, particularly the
+read-ahead canceller. It still works, but not nearly as well (key
+presses are dodgy and holding down keys doesn’t always work), and so I
+much prefer and recommend Linux libncurses.q is pressed in one, the other will crash
+out with Broken pipe.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/kev
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 ollinger
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/ollinger
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Nicolas
+Ollinger
Location: FRTo build:
+makeTo use:
+./ollinger integerTry:
+./ollinger 1000 | cut -c -200Judges’ remarks:
+Author’s remarks:
+What’s this?
+n. This C sequential version is slower as it works in
+O(n*log n). But you have some nice picture instead… the
+cost is a constant number of operation for each character printed on the
+screen.Why did I write this ?
+
+We tend to dislike programs that:
+are similar to previous winners
+
+We like variety. However too often we see (please look at the winning
+examples given to be aware of the level of the competition):
+
+(snip)
+
+generating small primes (below is the list of all prime related winners)
+
+ 1985/august
+ 1988/applin
+ 1994/weisberg
+ 1995/makarios
+ 1996/dalbec
+ 2000/bellard
+
+As you can see, just a list of primes (let alone small primes)
+does not cut it anymore.
+
+(snip)
+
+entries that use some complex state machine/table to print something
+
+ 1988/isaak
+ 1988/phillipps
+
+Unbeaten for 12 years and counting...The way it works
+e
+and consists of 345 transitions of the kind
+ff(left,middle,right). This encoding into e is
+obfuscated to reduce its size, restrict it to characters 32 to 127 and
+guarantee a constant time.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2001/ollinger
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 rosten
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/rosten
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Edward Rosten
+Location: GBTo build:
+makeBugs and (Mis)features:
+
+STATUS: missing files - please provide themTo use:
+./rosten [number]Try:
+./rosten 1.03
+./rosten 1.00./rosten 0.99Judges’ remarks:
+Author’s remarks:
+NAME
+rosten - make the mouse act as if it has been
+greasedSYNOPSIS
+./rosten [greasiness]DESCRIPTION
+OPTIONS
+DISPLAY
+variable.PORTABILITY
+COMMENTS
+$ make greasymouse
+cc greasymouse.c -o greasymouse -lX11
+greasymouse.c:30: This macro should have more text and spaces in it
+greasymouse.c:32: This is a really stupid way to perform this operation
+greasymouse.c:42: This program would look better with a newline here
+greasymouse.c:48: That's a really silly thing to do
+greasymouse.c:55: So is that
+...
+greasymouse.c:58: This program is rubbish. I'm not going to link it.BUGS
+clock() but I haven’t used them.WARNINGS
+()s where they’re not needed.== instead of an
+= in expressions such as:&&(a=b)r() has no prototype.-pedantic option to the MIPS compiler causes
+it to generate warnings about its own header files, but not any extra
+ones with this program.ERRORS
+DEC C V5.6-079 on Digital UNIX V4.0 (Rev. 878) can’t
+compile the code. It thinks that preprocessor lines can not have
+whitespace preceding the #. Moving the preprocessor
+directives to the beginning of the line wrecks the layout but makes it
+compile.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/rosten
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 schweikh
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/schweikh
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./schweikh string string2
+That's not a bug, that's a feature.Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+* meaning ‘zero or more characters’ and
+? meaning exactly one character, just like your unix
+shell.* at the beginning and end of the pattern if you are
+looking for something in the middle.stdout redirected to
+/dev/null):if prog "${VARIABLE}" '<glob>'; then
+ echo VARIABLE matches
+else
+ echo no match
+fiBugs
+m()
+function, an 86 character glob pattern evaluator, returning nonzero for
+a match:
+
+?: to save on
+if/else verbosity.&& and || to save
+even more on if/else verbosity.*t - 42.* and ?.argv and
+the exit status, there is no need for stdio.h bloat. An asm
+guru could surely squeeze this program in less than a screenful.indent(1) is probably not too helpful.kill request a NDA from you :-) Run it under a debugger
+with several inputs, it will be quite helpful and instructive. Handling
+of ? is straightforward; for * start out with
+*foo and foo* against foo. How
+does it deal with sequences of adjacent *? How could this
+be improved? If all else fails, recode the ?: operators
+with if/else and try again. For extra credit
+implement character classes like [a-z].Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2001/schweikh
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 westley
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/westley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brian Westley
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: uses gets() - change to fgets() if possible
+STATUS: missing files - please provide themTo use:
+./westley 2>/dev/null
+# enter some input, terminate with EOF
+
+echo foo | ./westley 2>/dev/null
+
+./westley < westley.c 2>/dev/nullTry:
+./try.shSorted code:
+sort -b) the code by line and it will always sort the
+order of the input.westley.sort as you
+would westley above.Punch card code:
+sort) version that just prints out the punch card. The
+westley.punch.c code is specifically so
+that Westley can punch everyone in the face! :-) This is also compiled
+by default.Punch card try:
+echo 'Brian Westley does it again!' | ./westley.punch 2>/dev/nullAlternate code:
+Alternate build:
+make altAlternate use:
+westley.alt as you would westley
+above.Judges’ remarks:
+28! or
+304,888,344,611,713,860,501,504,000,000 versions of the
+program, all valid C!Author’s remarks:
+main(){a();b();c();}
+a(){printf("A");}
+b(){printf("B");}
+c(){printf("C");}ABC as output.char *greet = "Hello, world!";
+char *greet; main(){puts(greet);}test(a,b){return a;}
+#define test(a,b) test(b,a)
+main(){if (test(0,1)) printf("T"); else printf("F");}T if the
+#define statement falls between the declaration of
+test() and its use in main(), otherwise it
+will print out F. Furthermore, you can use the same call to
+test() repeatedly in different lines to return different
+values:#define test(x,y) test(y,x)
+main(){int i=0;a(&i);b(&i);c(&i);d(&i);printf("%d\n",i);}
+a(i)int*i;{if (test(0,1)) *i += 1;}
+b(i)int*i;{if (test(0,1)) *i += 2;}
+c(i)int*i;{if (test(0,1)) *i += 4;}
+d(i)int*i;{if (test(0,1)) *i += 8;}
+test(x,y){return x;}^[]{}\ (these aren’t found on every keypunch, and have
+various encodings).
+
+
+
t() in all combinations to get all the
+variations.sed s/...$//). If you use this on the original code, you
+will see that it spells out HOLLERITH when punched on cards
+(you can see the tall, thin letters spelling out HOLLERITH
+if you turn the C code sideways). You will also see why
+/KC 0000 K is a Hollerith emoticon.
+Unrecognized characters are punched as a lace column. (You can see an
+ASCII simulation of the code as punch cards by looking at
+card.gif.)
+&-0123456789ABCDEFGHIJKLMNOPQR/STUVWXYZ:#@'=".<(+|!$*);,%_>?abcmnoxyz^[]{}\sort -b). This will produce the
+version that just reverses the line order, and the routines in the code
+are in a sensible order.time_t ptr param to time(3) will work with an
+int ptr, and that “passing through” a char[][]
+array as a simple char * is OK. Your compiler MUST
+understand trigraphs, or it will miss the trigraph backslash before the
+double quote in the K string and complain about a malformed
+string; for GNU C, use -ansi or -trigraphs.
+Entering a line of more than 80 characters, or more than 81 lines, will
+jam the card reader.a[b] ==> *(a+b) trick,
+because this is actually shorter than the trigraph version of
+a??(b??).28! different programs, or
+304,888,344,611,713,860,501,504,000,000 different versions,
+all legal C.
+* except in Florida voting machines
+
+** all cards must be face down, nine-edge first, of course.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2001/westley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2001 williams
+
+
-
+ The International Obfuscated C Code Contest
+ 2001/williams
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: John Williams
+Location: unknownTo build:
+makeBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTo use:
+./williamsJudges’ remarks:
+Author’s remarks:
+Obfuscation
+{};
+characters in the counts. All of the #defines are there to
+reduce code size.(x|1), which is used in a couple different ways.
+The purpose of A/(x|1) is probably obvious, but what does
+(x|1)%2 do?Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2001/williams
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 anonymous
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/anonymous
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anonymous
+2004
Location: SGTo build:
+makeTo use:
+./anonymous 'foo' > bar.pgmpgm viewer then we suggest the netpbm toolkit to convert the
+image to a graphics format that you can view. Most graphical web
+browsers can display PNG or JPEG images.Try:
+./anonymous "ash nazg durhbatuluhk, ash nazg gimbatul, \
+ ash nazg thrakatuluhk, agh burzhumh-ishi krimpatul." >ring.pgm
+
+./anonymous "My Precious. Yes, my Precious." > precious.pgmJudges’ remarks:
+The Hobbit Facsimile First Edition. The details are
+also discussed in History of Middle-earth [HoMe] VI, The
+Return of the Shadow, part one of the history of The Lord of the
+Rings of a twelve volume set - as well as in The
+History of the Hobbit.An important aside :-)
+u it. The real text is:
+
+
+
+
+One Ring to
+bring them all and in the darkness bind them.Author’s remarks:
+
+
+gh, sh, th: the corresponding
+tengwar are
+output for these specific sounds.mh denotes the full tengwa for
+[m]; m by itself means a horizontal bar above
+the next letter.rh denotes the [r] tengwa.uh denotes the tehta for long
+vowel [u:].zh selects the up-reaching tengwa for
+[z], while z selects the down-reaching
+one.ring.pgm:./anonymous "ash nazg durhbatuluhk, ash nazg gimbatul, \
+ ash nazg thrakatuluhk, agh burzhumh-ishi krimpatul." >ring.pgmCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2004/anonymous
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 arachnid
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/arachnid
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Nick Johnson
+Location: NZTo build:
+makehljk for moving left, right,
+down and up. See alternate code below.To use:
+./arachnid [mazefile]Try:
+./arachnid arachnid.info./arachnid arachnid.cwasd inverted-T
+formation on QWERTY keyboards. Rogue players, vi users, and Dvorak
+typists are invited to get lost (or use the alt version)!Alternate code:
+wasd movement keys you can try the
+vi(m) movement keys instead.Alternate build:
+make altAlternate use:
+arachnid.alt as you would arachnid
+above.Judges’ remarks:
+Author’s remarks:
+@) could not
+have seen.' ' as
+gaps, tilde ~ symbols (if any) as exits (which get
+represented as a NetHack style
+< once loaded), and any other characters as walls.~ that recognises exits to input mazes
+itself forms the exit to the default maze. Another maze, arachnid.txt has also been provided. This maze
+is 255x255, about the largest maze supported, for the particularly
+insane maze explorers out there.Usage
+./arachnid [mazefile]w,a,s, and d
+keys.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2004/arachnid
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 burley
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/burley
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Brent Burley
+Location: USTo build:
+makeTo use:
+./burleyJudges’ remarks:
+
+5 <== you enter a bet of $5 (defaults to $1)
+J Q J 9 5 <== your hand is Jack of Clubs, Queen of Hearts,
+C H D S C Jack of Diamonds, 9 of Spades, 5 of Clubs
+123 <== you enter which cards you want to keep
+ (enter 0 to 5 digits between 1 and 5)
+J Q J J Q <== your new hand is Jack of Clubs, Queen of Hearts,
+C H D S C Jack of Diamonds, Jack of Spaces, Queen of clubs
+$145 (45) <== Your new balance is now $145. You had a Full House
+ so your payoff is 9 times your bet == 45
+Straight Flush 50 times your bet
+Four of a Kind 25 times your bet
+Full House 9 times your bet
+Flush 6 times your bet
+Straight 4 times your bet
+3 of a Kind 3 times your bet
+2 Pair 2 times your bet
+Jacks or Better 1 times your betsetjmp(3) and
+longjmp(3) calls. Can you keep track of what state is being
+saved and restored?Author’s remarks:
+if, for, do,
+while, switch, and goto.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/burley
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 gavare
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/gavare
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anders Gavare
+Location: SETo build:
+makeTo use:
+./gavareTry:
+./gavare > ioccc_ray.ppmAlternate code:
+stdout which theoretically should
+work in Windows.Alternate build:
+make altmake clobber XX=640 YY=480 altmake clobber AA=2 altmake alt; instead try:make alt2Alternate use:
+gavare.alt, gavare.r3 or
+gavare.alt2 as you would gavare above.Judges’ remarks:
+stdout as the first statement of main(),
+or use freopen("ioccc_ray.ppm", "wb", stdout); and do not
+use redirection./Og for best results.Author’s remarks:
+main as a reserved word, although the compiler gives it
+special meaning) and no preprocessor directives.A value is an anti-alias factor. Setting it to
+1 disables the anti-aliasing feature which makes the output
+look bad, but setting it too high makes the trace take a lot more time
+to complete.int is a reserved word and therefore
+all variable declarations are implicit. There will no doubt be
+lots of warnings, no matter which compiler is used. Still, the
+source code should be word- length-independent and
+endianness-independent.Humor
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/gavare
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 gavin
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/gavin
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Gavin
+Barraclough
Location: unknownTo build:
+makeBugs and (Mis)features:
+
+STATUS: compiled executable crashes - please help us fix
+STATUS: doesn't work with some platforms - please help us fix
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./gavinTry:
+sumke2fs /dev/fd0
+replacing fd0 with whatever the floppy device is!), mount
+it under /mnt/floppy and then:cp kernel fs.tar lilo.conf boot.b /mnt/floppy/dev/fd0, edit
+lilo.conf appropriately.lilo -C /mnt/floppy/lilo.confvi gavin.cshvi README.md
+./primAlternate code:
+K is
+redefined to 1 so that you can use it with
+QEMU.Alternate build:
+make altAlternate use:
+gavin except that one
+initially executes gavin.alt (which make alt
+will do) and one will have to use QEMU instead. The files
+generated are the same names. See to use and try above as well as the judges’ remarks below plus gavin.md.Judges’ remarks:
+fs.tar for browsing
+with vi.prim, written by the judges, computes
+and prints prime numbers.Author’s remarks:
+kernel. The
+Makefile will then proceed to build a root filesystem image. This
+involves rebuilding the program with different compiler flags, then
+building a tarball containing the resulting programs (the filesystem
+format supported by the OS is the tarball format).vi and sh are significant,
+and should not be changed.Known ‘features’
+shell into a command-line
+it will execute the program sh - close enough a match for
+it.shift or
+backspace.vi, the up/down and PgUp/PgDn
+keys scroll up or down by one line. There is nothing to stop you from
+scrolling above the top of the file, and pressing any other keys might
+have an undefined effect.in and out instruction - to allow the keyboard
+& mouse to be driven from C code).V, so these may need updating
+as appropriate (0x90200 is the address at which a Linux
+bootloader loads an x86 kernel image).
+\* ;-)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/gavin
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 hibachi
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/hibachi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anthony C.
+Howe
Location: CATo build:
+makeTo use:
+cd build; ./hibachi-start.sh &Try:
+cd build; ./hibachi-start.sh &http://localhost:8008/. When you’re finished make sure to
+kill hibachi.build directory when running
+hibachi for this to work.Judges’ remarks:
+hibachi.tgz
+but this was extracted so the file does not exist here.Author’s remarks:
+README.TXT (Feb 2004)
+Hibachi is a simple, small, and (probably) very secure
+web server.hibachi.tgz file that unpacks several support
+files and a subdirectory tree containing the documentation and examples.
+It can be viewed by:tar -zxf hibachi.tgz
+lynx hibachi/localhost/index.htmlHibachi is running, use a web browser
+(preferably one that supports images and JavaScript, to view the
+documentation and try some of the CGI examples) to visit:
+http://localhost:8008/.Building
+gcc -o hibachi hibachi.cgcc -DSHUT_WR=1 -o hibachi hibachi.cgcc -o hibachi hibachi.c -lnsl -lsocket#! paths for the CGI examples. In which case the
+preferred build commands are:
+./configure [--enable-port=number]
+makecd build;
+./hibachi-start.sh &lynx http://localhost:8008/kill %1Features
+
+
+index.* file extensions and
+types:GET, HEAD, and POST.Comments
+
+
+HTTP/1.0 200 OK ==
+HTTP/1.1 200 OK CRLF Connection: close ?getenv() == putenv() ?Hibachi can serve www.ioccc.org.Known Issues
+
+
+hibachi.Suggested IOCCC Categories
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/hibachi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 hoyle
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/hoyle
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jonathan
+Hoyle
Location: USTo build:
+makeTo use:
+./hoyle point ...Try:
+./hoyle 10 0.5
+./hoyle 1 1 1 1
+./hoyle 2 0 1 0 -0.001Judges’ remarks:
+#defines. The #define do(if,else), for
+example, is delightful. The code itself contains a bunch of curves
+designed to throw you off axis. :-)Author’s remarks:
+ax^0 + bx^1 + cx^2 + ... are graphed by passing the
+coefficients a, b, c, etc. as
+double precision arguments. It allows up to 8 parameters (thus up to
+x^7).Points of note:
+
+
+-32 to +31.Xs.y = x^2:./hoyle 0 0 1./hoyle 0 0 2y-axis is auto
+scaling.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/hoyle
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 jdalbec
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/jdalbec
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: John Dalbec
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./jdalbec number ...Try:
+./try.shAlternate code:
+Alternate build:
+make altAg (silver) controls how
+many number of lines to print on a line. Set at default to 11 protons,
+salt, if you wish to make it silver, 47 (a prime) protons, do:make clobber Ag=47 altmake clobber Ag=79 altAlternate use:
+jdalbec.alt as you would jdalbec
+above.Alternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+./jdalbec 1,
+./jdalbec 11, and ./jdalbec 1 1.) This allows
+output lines from the program to be passed back to the program as input
+(minus the initial generation number).He=Np(2),
+Li=Pu(2), Ta=Np(3), W=Pu(3). To
+get other isotopes, just change the last digit to a number greater than
+3.jdalbec2.c which is edited with
+ed(1) (NOTE: this was changed to sed(1) by the
+judges) to correct spacing problems caused by some preprocessors. (I
+know you dislike Perl, but hopefully ed(1) is more common
+on POSIX systems than Perl.) The build file then compiles
+jdalbec2.c] and removes the jdalbec2.c
+file.#! line and the commented-out -Wall -pedantic
+options. The rules for the 16th IOCCC
+specifically allowed build files up to 521 characters long so my build
+file would have been well within those limits. (What typo?)gcc -E -Wall -pedantic complains that trigraphs are
+present and that
+"pasting ... does not yield a valid processing token".gcc -ansi -Wall -pedantic complains about
+#line directives, trigraphs, and expressions and statements
+that have no effect. The last complaint is false in all but one case.
+Removing the offending expressions causes some compilers to report
+syntax errors because they can’t determine whether a name refers to a
+variable or a type.vsftpd. This means the program should never crash,
+right?CodeWarrior 11 compiler is the reason I had to
+use trigraphs. I have to preprocess jdalbec.c without
+trigraphs, save the result as jdalbec2.c, then compile
+jdalbec2.c with trigraphs to get the program to work. I
+also have to add an include file and a function call to the program to
+get a pseudo command line so I can pass arguments. The compiler also
+requires function prototypes by default, which is why I have prototypes
+for all my functions.??= to
+# on line 3 because the compiler doesn’t recognize
+??= as a trigraph (which I consider a compiler bug). The
+initial preprocessing step on Mac OS X 10.1.5 generates lots of errors
+in “smart mode” because the “smart” preprocessor expects a valid C
+program as input. The preprocessor then falls back to “basic mode” and
+preprocesses jdalbec.c successfully without
+warnings, even when I give it the -Wall -pedantic options.
+It inserts a lot of extra spaces into the preprocessed output which is
+why I had to add the ed(1) step to the build file so that
+my macro #defines would work. The compile step gives the
+usual messages with -Wall -pedantic. The link step
+generates a warning about a name conflict between my BC()
+and a BC() from curses in the main system library.
+BUGS FEATURES:/[^2]22$/ cause the program to
+segfault after rapidly exhausting the available stack space. I could
+probably fix this by adding some special cases to the code, but [Blaine
+the Mono] it’s quite a bit more exciting this way, don’t you
+think?[/Blaine] Since the trailing 22 will be its own atom
+anyway, you can just insert a space in front of it if you run into this
+feature (e.g. 1 22 instead of 122).malloc lied! Killed by SIGKILL./(?:.){10,}/ will produce visually
+incorrect results (e.g., generation 1 starting from 1111111111 will
+print as : 1), but there’s nothing interesting about these
+arguments that can’t be modeled using shorter runs of the same
+symbol./(?:.){257,}/ may produce
+mathematically incorrect results (e.g., generation 1 starting from a
+string of 257 1s will be calculated as 11);
+the remark from the previous paragraph applies here also.Obfuscation
+
+
+cpp twice.#defines.typedefs.At (Astatine, highly
+unstable) for abort().) By overloading symbols (For
+example, B is a type, a structure, a structure member, a
+macro parameter, and a variable.).'\0' as
+1["3"] or 2["22"].else.Sb() function to create sub-buffers from
+either end.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/jdalbec
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 kopczynski
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/kopczynski
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Eryk
+Kopczynski
Location: PLTo build:
+makeTo use:
+./kopczynski < input_fileTry:
+./tryAlternate code:
+Alternate build:
+make altAlternate try:
+./kopczynski.alt < kopczynski-10
+echo $?Judges’ remarks:
+
+1, 0, 0, 0, 0, 0, 1, 0, 2, 1, ...Author’s remarks:
+echo $? (or just $?).)# signs (you can also use dots instead of spaces), ending
+with an empty line. (No number has an empty line in it.) The program
+should return the number from 8 to 11 that it thinks it is.
+
+return * to
+printf("%d",*). ($? is shorter)-Dif=while
+which saved 9 chars of source for the cost of 11 chars of the Makefile. If I used -DB=while, I would
+save 12 for 10, but I think the current version is slightly more
+obfuscated.Portability
+N-9, where
+N is the size of int in bits (you can try to
+compile with an option '-Dint=long long' for longer
+lines).Algorithm & Obfuscation
+
+
+#-regions) minus the number of holes in
+them. It turns out that this algorithm works correctly for all numbers
+from 8 to 11.
+ #
+ ## # #. .#
+ # .# #. ('.' must be empty)
+ ##
+ ##
+
+
+ #? ## #? #. .# ##
+ ?? ?? #? .# #. ##
+ +1 -1 -1 -1 -1 +1? and sum them up,
+we get that it is enough to calculate:
+ #. .# ##
+ .. #. #.
+ +1 -1 -1
+
+{-1,0,+1}N-bit
+integers). Additionally, it is heavily obfuscated by using negative
+numbers (two’s complement). For example, it turns out that
+6 in z=6 is the only 1-digit number which
+works here (and it’s not only because we have z>5 in the
+following while). The conversion routine also sets
+n=8 in an obfuscated and concise way.16 {-1,0,+1} values, we use a
+15-character string which agrees modulo 4 to the array in
+(4). ('\0' fits very well as the 16th
+character, so we use 15-character string.)# character to find vertexes
+is in the top right corner, not the top left one.) The following
+messages will also work instead of
+has dirtiest IF:
+HighlandYachter
+TestDirtiestTen
+has lintiest IF
+TighterLaughter
+HustlerDaughter
+TighterDemoThen
+
+if means while.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2004/kopczynski
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 newbern
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/newbern
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jeff Newbern
+Location: unknownTo build:
+makeTo use:
+./newbern [file.dat arg]Try:
+./newbern newbern.dat "IOCCC 2004"
+echo SOS | ./newbernJudges’ remarks:
+Author’s remarks:
+banner(1)-like program.Examples:
+
+
+./newbern char < some_nicely_shaped_text >> data_file
+
+./newbern data_file a_stringExtra functionality
+Portability
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/newbern
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 omoikane
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/omoikane
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeTo use:
+./omoikane infile layout outfileTry:
+
+./omoikane omoikane.info omoikane.info omoikane.outputJudges’ remarks:
+Rinia, so the
+Author’s Comments refer to it as such.Author’s remarks:
+
+Rinia (1/14/04)Rinia is a tool for embedding CRCs in text files. No
+need to assign strange file names or package .SFVs with your files!
+Rinia will insert a human-readable checksum string in the
+text itself! ^_^Usage
+./omoikane <infile> <layout> <outfile>Input
+Rinia will
+say “bad input” and exit immediately.Layout
+Rinia can patch.
+The content consists of marker characters (where Rinia is
+allowed to change in the original text) and other characters (where the
+original text will stay as is). Rinia will select the
+marker character using these heuristics:
+
+Rinia to match with a rare
+character, then replace the remaining ones with space. Often it’s
+possible to write the original file in such a way that it can be used as
+a layout.
+file: layout:
+ crc = ######## ... . XXXXXXXX
+ patch = ###### ..... . XXXXXX
+ other text here ..... .... ....Rinia may generate a file similar to this:
+crc = 1bad73cf
+patch = #FR-QQ
+other text hereRinia will recognize that only # marks enough
+space to hold the checksum, and has the lowest frequency.Rinia will
+say “bad layout” and exit immediately.Output m
+Rinia finds a usable checksum, she will say “OK.” and
+write to the specified output file. Otherwise the exit message is “fail”
+and nothing is written.Rinia runs faster if the checksum is placed before the
+other marker characters rather than after, e.g.:
+ a: X X XXX b: XXXXXXXX c: XXXXXXXX
+ XXXXXXXX X X XXX XXXXX
+a usually takes the longest time, while c
+usually is the fastest.Rinia will succeed in a
+short time or not. In general, 5 marker characters are sufficient, and
+takes a few minutes.rinia.c was produced on a 1.7GHz machine
+(the checksum is at line 17). Out of 25 runs, the shortest was 2 seconds
+while the longest took 5 minutes. Average was about a minute. Checksum
+for this file (b7a81524) took about 4 minutes.Algorithm
+Rinia first assumes a random
+final checksum, inserts that string, then modifies other parts to
+compensate for the change in content.Rinia
+has to try out all character combinations. This is done in a
+hierarchical fashion, computing only smallest partial checksum after
+each change._^Source code
+rinia.c should compile anywhere (but with a few
+warnings). I don’t have a big-endian machine to test but
+Rinia should work there as well. ASCII character set
+required though.Rinia” from the
+anime/game “Moekko Company”. Of course at 90x50 it’s hard to recognize
+anything ^_^Rinia is the slow but hardworking android. On some jobs
+she does very well, on others she would spend lots of time and effort
+but still fail…Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2004/omoikane
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 schnitzi
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/schnitzi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mark
+Schnitzius
Location: unknownTo build:
+makeTo use:
+./schnitzi <foo | vi -nTry:
+./try.shvi :-) don’t worry as it will exit for you.Judges’ remarks:
+Author’s remarks:
+vi) without first putting it into insert mode, or turning
+off the auto-indent, you know the dismay of watching your screen fill up
+with misaligned junk.ANIMATION!
+stdin which defines the
+animated elements (sprites) that appear on the screen. For each sprite,
+you can specify exactly when and how long it will appear, and which
+direction it is moving. Also, the sprite can oscillate between up to
+four different views, which appear in subsequent frames. Forgive me,
+animators, if I’m mangling the terminology. Sprites which appear later
+in the input file will be drawn in front of sprites which appear
+earlier.stdout, is a string which, when
+pasted into vi, will perform the animation defined in the input. (The vi
+editor is a common (and ancient) editor that should be available on most
+Unix, Linux, Solaris, and macOS systems; you can get it on Windows by
+installing Cygwin, which is how I do it.)THE INPUT
+stdin when running the program. What follows is a detailed
+description of the input file format.
+[duration] [timefactor]duration, defines how long the
+animation will run. The second, timefactor, is used as sort
+of a fudge factor for machines that run too fast to see the animation. A
+timefactor of 0 means, “run the animation as fast as you
+can”. On a pretty fast machine, I’ve had to set it as high as 2000 to
+get the animation to slow down sufficiently. Note that the higher the
+timefactor, the longer the output string that you’ll have
+to copy and paste, as extra characters are necessary to “waste time”
+between frames.
+[start] [end] [x] [y] [dx] [dy] [cols] [rows] [viewcount]
+
+start is the time at which this sprite first
+appears.end is the time at which it disappears.x is the horizontal position at which it
+starts.y is the vertical position.dx is the amount that the x position
+changes per frame.dy is the amount that the y position
+changes per frame.cols is the number of columns in each view.rows is the number of rows in each view.viewcount is the number of views to cycle
+through.viewcount
+view frames, each with rows rows and cols
+columns.RUNNING THE ANIMATION
+
+
+./schnitzi < input.dat | vi
+
+./schnitzi < input.dat > output.dat
+
+A FINAL NOTE
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2004/schnitzi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 sds
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/sds
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Stephen Sykes
+Location: FITo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./sdsTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+./sds < sds.c./sds < sds.c > encoder.cencoder.c. You now have the complete system
+ready.echo 'Hello, World!' > message
+./encoder message < remarks > remarks_msg./sds < remarks_msg
+Hello, World!Obfuscation
+
+
+Compiling the program
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/sds
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 vik1
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/vik1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel Vik
+Location: USTo build:
+makeTo use:
+./vik1 [arg]Try:
+./vik1
+./vik1 a
+./vik1 d2
+./vik1 ad3Judges’ remarks:
+Author’s remarks:
+Features
+
+
+Build and Run
+Usage: ./vik1 ['a']['d'][#]
+
+a - Advanced racing in a winter landscape
+d - Racing in at night in the dark
+# - Race track selection 1-3 are valid numbers
+Command line: Description:
+
+$ ./vik1 Run track 1 at daytime in the summer
+$ ./vik1 a Run track 1 at daytime in the winter
+$ ./vik1 d Run track 1 at night in the summer
+$ ./vik1 3 Run track 3 at daytime in the summer
+$ ./vik1 d3 Run track 3 at night in the summer
+$ ./vik1 ad2 Run track 2 at night in the winter./vik1 da. (Well it is possible, but the result will not be
+as expected.)Obfuscation
+#define to a single letter to save some space, or to remove
+casts to save some space.a-z are used and most letters A-Z.for loops each
+without a body. Each for loop does many things. One
+for loop draws all cars by restarting a couple of times.
+Another draws the road, mountains, and the sun.main() is called recursively. The return value and
+output depends on the arguments. main() can return the
+current time, draw lines and of course be the entry point of the
+application.?: operator mainly to
+save space but it makes the program more obscure.Compiler warnings
+-ansi
+but there are many warnings from lclint. Mainly because the program is
+very optimized for code size.Limitations
+{ 0, RED, GREEN, BLUE }.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/vik1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2004 vik2
+
+
-
+ The International Obfuscated C Code Contest
+ 2004/vik2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel Vik
+Location: USTo build:
+makeTo use:
+./vik2Judges’ remarks:
+Author’s remarks:
+Introduction
+gcc (and other
+pre-processors) to crash when configured to do maximum number of
+computations. The default configuration of the Makefile is set to make the program compile in a not
+too long time.cpp to crash in a couple of different ways.
+Most common is to get a segmentation fault, but a couple of times it
+just got stuck in some infinite loop.Features
+X and Y, for calculations and one status
+register SR. Each bit in the registers are represented by
+one symbol that are either defined or undefined.
+
+CLR_X - Clear register
+X.CLR_Y - Clear register
+Y.ADD - Calculates X + Y and
+stores the result in X. If the result is larger than 11
+bits, the CARRY
+bit in SR is set otherwise the CARRY bit
+is cleared.SUB - Calculates X - Y and
+stores the result in X. If Y was larger than
+X, the CARRY bit in
+SR is set otherwise the CARRY bit is
+cleared.TST - If X == Y the
+EQ bit in SR is set, otherwise the
+EQ bit is cleared. If X < Y
+the LT bit in SR is set, otherwise the
+LT bit is cleared.INC2 - Calculates X + 2 and stores the
+result in X. The CARRY bit is handled
+as in the ADD instruction.ADD instruction uses the one bit
+adder to create the 11-bit adder. The SUB instruction is
+implemented by adding ~Y to X and then add 1.
+Finally the TST instruction calculates X-Y and
+checks the result and the CARRY bit in the
+SR register to
+set the EQ and LT bits.#ifdef,
+#ifndef, #else, #endif,
+#define and #undef. I never assign a value to
+a defined symbol. The logic is done by assuming that a defined symbol is
+1 and an undefined symbol is 0. (I guess this means that I have
+unlimited memory as long as I only store zeroes (!)).X and Y registers by defining
+/ undefining the X and Y register
+bits. Then the calculation is made and the result is moved back to the
+memory.cpp allows only
+200 nested includes).Build and Run
+FNAME symbol must be defined to the name of the output
+file. If you want to speed up the compilation, define the
+STOP symbol to anything from _3 to
+_10. (The default value is _10 which will make
+the compilation take some time.) Prime numbers up to 2^STOP
+will be calculated.cpp '-DSTOP=_5' '-DFNAME="tmp1.c"' prog.c tmp1.ccpp or any other pre-processor to
+do the actual work. This will take some time….cpp tmp1.c > tmp2.ccc -O tmp2.c -o progSTOP=_5 as above):./vik2Verification
+cpp (or any other pre-processor)
+so I had to write my own. Knowing how the program works it was quite
+easy to reduce the compilation time from several hours to about one
+second. I also added some statistics to my home made pre-processor and I
+found that calculating prime numbers up to 1024 makes the program
+include itself over 6.8 million times (see the statistics table
+below).Obfuscation
+cpp.Limitations
+#define, #endif, and some other directives
+as single character symbols. This does not compile on all pre-processors
+but using GNU cpp as a first compilation step solves
+this.Statistics
+cpp pre-processor.
+The times taken to pre-process the program were measured using GNU
+cpp on my 2.0MHz P4 with 512Mb ram and a lot of disk.
+ Generated Recursive Max nest Intermediate
+ Level prime nrs includes count file size Time
+
+ _3 < 8 2 322 9 74 748 4"
+ _4 < 16 4 672 9 182 652 9"
+ _5 < 32 14 237 9 629 121 32"
+ _6 < 64 43 748 9 1 998 134 1'41"
+ _7 < 128 149 851 11 6 823 575 5'50"
+ _8 < 256 526 874 17 24 028 933 20'37"
+ _9 < 512 1 920 272 38 65 527 808(*) 1h 42'19"(*)
+ _10 < 1024 6 826 389 114 63 782 912(*) 2h 47'58"(*)
+
+ (*) Before cpp crashed.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2004/vik2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 aidan
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/aidan
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Aidan
+Thornton
Location: GBTo build:
+makeTo use:
+./aidan < puzzle
+
+./aidan seedseed is a number.Try:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+aidan.alt as you would aidan above.Alternate try:
+./try.alt.shJudges’ remarks:
+goto the source and notice the lack of functions. Jump
+to the switch statement. And if you think you can puzzle it
+out better, try solving insane1.sudoku all
+by yourself!Author’s remarks:
+Contents
+
+
+IMPORTANT
+sudoku-sf executable to be ./sudoku-sf. If you
+rename it, please change the definition of $sf_exe to the
+new name.
+
+Legal blurb
+What is a sudoku?
+
+ . . . | 1 . . | 7 4 .
+ . 5 . | . 9 . | . 3 2
+ . . 6 | 7 . . | 9 . .
+ ------+-------+------
+ 4 . . | 8 . . | . . .
+ . 2 . | . . . | . 1 .
+ . . . | . . 9 | . . 5
+ ------+-------+------
+ . . 4 | . . 7 | 3 . .
+ 7 3 . | . 2 . | . 6 .
+ . 6 5 | . . 4 | . . .#include <stdio.h> /* sudoku-bfi.c */
+#define S(t) for(n=0;n<9;v[n++]=0);for(n=0;n<81;n++)if(i[n]){z=1<<i[n];if(v[t]\\
+&z)for(;;){if(p<0)goto d;if(i[p]++<9)goto f;i[p]=0;p=s[p];}v[t]|=z;}
+int i[82],s[81],v[9],n,p,z;int main(void){for(n=0;n<81;){p=getchar()^48;if(p==
+30)p=0;if(p<10)i[n++]=p;}i[81]=0;p=-1;f:S(n%9)S(n/9)S(n%9/3+n/27*3)if(p>80)goto
+d;for(n=p;i[++p];);s[p]=n;i[p]=1;goto f;d:z=p<81;printf("\n%s!\n\n",z?"Fail":
+"Success");for(n=0;n<81;){p=i[n];printf("%c %s",(p?p|48:'.'),(++n%3?"":n%9?"| "
+:n%27?"\n":n%81?"\n------+-------+------\n":"\n\n"));}return z;}
+
+
+--- insane1.sudoku --
+. . 4 | . . . | . 5 6
+5 . . | . 7 2 | . . .
+. . 1 | . . . | 8 . .
+------+-------+------
+. . . | . . . | . . .
+. . . | 6 9 3 | . . 5
+. . . | . . . | 7 3 4
+------+-------+------
+. 5 . | 2 . 1 | 4 . 8
+3 . . | . . . | . . .
+. . . | . . . | . 6 1sudoku-bfi.c (aidan.alt.c), also has trouble - it took 66
+seconds to solve it - but probably for different reasons. That’s the
+worst performance I’ve had from brute-force so far!)Usage
+Building
+cc -o sudoku-sf sudoku-sf.cgcc -O2 -Wall -Wextra -ansi -pedantic-errors -o sudoku-sf sudoku-sf.cTesting (optional)
+perl ./test-su.perl-n 0 if you’re in a hurry). I
+wrote it mostly for my own benefit, really.Solving
+./aidan < somefile.txt.) or zero (0).
+Other characters are ignored, so you can cut-and-paste either example
+sudoku puzzle from above into a file and feed that in. The program has
+coped with every input I’ve thrown at it so far, including an empty grid../aidan U may also be useful, or perhaps not. It only
+took an extra 15 bytes of (very simple) code to add, so it doesn’t
+really matter to me. (It’s the same as the normal mode for most input
+you’re likely to feed it, though slightly slower. See if you can figure
+out what it does.)Generating
+./sudoku <seed>Speed
+-O2
+optimisation - takes about 60 seconds with no optimisation). If that
+isn’t fast enough, what on Earth are you doing with it?Bugs
+
+
+gcc 3.4.1-3mdk, Linux/x86Missing Features
+
+
+Portability
+int is at least 15
+bits and a long at least 32. (No, that isn’t a typo - I did
+say 15, not 16).cpp can properly handle something
+like:#define foo(x,y) x y
+foo(bar,)Compiler warnings
+gcc -Wall -Wextra -ansi -pedantic:
+
++ in an operand of
+& in the i macro definition.= where you’d expect a comparison
+operator.Obfuscation
+
+
+#defines (which will be cleaned up by
+cpp + a code beautifier, but see the next item).main() - all code reuse via
+#defines, or by various other methods (usually somewhat
+icky ones). This wasn’t deliberate - it just ended up that way
+somehow…gotos from everywhere to everywhere else.switch statement.'A'-style char constants - hard-coded
+numbers are used. (There’s one, but it isn’t used to make things
+clearer).array[index] notation, because:
+
+
s and N(I,l) macros
+are usedCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/aidan
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 anon
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/anon
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anonymous
+2005
Location: unknownTo build:
+makestty(1) commands try:make anon-no_sttyanon to
+not use stty(1).Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./anon x y [z]Try:
+./anon 4 4
+./anon 3 3 3
+That's not a bug, that's a feature.yes 'please crash on me :-)' | ./anon 4 4yes 'please crash on me :-)' | ./anon 10 10 10100 100 100 for instance and
+see what happens!Alternate version:
+vi(m) like movement keys.Alternate build:
+make altstty(1):make alt-no_sttyAlternate use:
+anon.alt as you would anon with the
+change in movements:
+k | Move empty spot up
+h | Move empty spot left
+j | Move empty spot down
+l | Move empty spot right
+J | Move empty spot forwards
+K | Move empty spot backwardsJudges’ remarks:
+main() is recursively called and how the runtime stack is
+used.Author’s remarks:
+ABOUT THE GAME ITSELF
+./anon 4 4./anon 3 3 3# characters instead of digits. To slide the tiles around,
+use the following keys:
+i | Slide the tile above the current empty space downwards.
+j | Slide the tile to the left of the current empty space to the right.
+k | Slide the tile below the current empty space upwards.
+l | Slide the tile to the right of the current empty space to the left.
+o | Slide the tile behind the current empty space forwards.
+n | Slide the tile in front of the current empty space backwards.
+q | Quit the game.
+i | Move empty spot up
+j | Move empty spot left
+k | Move empty spot down
+l | Move empty spot right
+n | Move empty spot forwards
+o | Move empty spot backwardsCOMPILE NOTES
+gcc -Wall). This is deliberate, since
+if everything were parenthesized “properly” the program would fail to
+work. It (ab)uses C operator precedence to accomplish some cool hacks.
+:-) However, there are no compiler errors. I have tested this with
+gcc -pedantic -std=c99.stty cbreak. If this breaks on
+your system, compile it with -DNO_STTY. The game interface
+will be a bit annoying (you will need to hit enter after every key), but
+it works.ABOUT THE CODE
+#defines to
+make them easier to read, :-) and although he has helpfully formatted
+the code with beautiful indentation, something is clearly very, very
+wrong.main() is a return? What do
+all those nested do loops do (pun intended)? Why is the
+first statement inside the first do loop a mere integer
+literal? Why are there such strange statements, like that empty string
+on line 65, or that isolated || on line 68?|| and
+(, and closing them by || and ))?
+The for loop isn’t a for loop! The
+do loop isn’t a do loop! Or… are they? Well,
+the for loop is defined in terms of a while
+loop. But wait, the while loop is defined in terms of the
+do loop. And the do loop is defined in terms
+of … Huh???switch statement toward the end of the program…
+wait a minute, that’s not a switch statement! Why is a
+case defined in terms of a switch statement?!
+And that initial return isn’t a return! Well, it is… but not what you
+might think!main(). There are no if statements, no
+for loops or any looping or control constructs besides the
+return, in spite of the misleading appearance of the
+original source. :) Yes I know, this has been attempted before, using
+?: and the bad old comma operator. BUT this program does
+NOT use the ?: operator, and there are only TWO comma
+operators in the entire program–and they are only there because
+srand() and exit() return void.main(). Looping is achieved by recursion, of course,
+and branching is achieved by exploiting short-circuit evaluation of
+boolean expressions. :-)main(). There are certainly
+no arrays declared anywhere. The program does not call any memory
+allocation routines, nor any function that indirectly returns allocated
+memory. Yet it happily looks up array references without crashing.
+How??
+
+SPOILER
+The Evil Hack
+N recursive calls of main() to itself, there
+is enough room on the stack to store whatever the program desires, so
+long as it does not exceed the maximum stack size.argc in a recursive call is greater or less than in the
+parent call.)int sizes, memory
+alignment, what exactly is on the stack between successive locations of
+argc, etc., the program (ab)uses the fact that
+argc must necessarily be allocated on an aligned address,
+and therefore, the range of memory between two argcs is
+aligned, and therefore safe to use as an array of longs.[*]
+The program also compares the pointers as long* pointers,
+so that it will not have to deal with mapping bytes to larger types. The
+initial memory allocation is done by recursively calling
+main() until there is enough space on the stack (the exact
+number of recursive calls is, of course, architecture-dependent).long was chosen instead of int, in
+order to skirt around pointer-size issues on architectures like ia64. It
+really can be made anything large enough to hold both ints
+and pointers. :-)long array (pun intended), the program begins
+its real code. It uses argc to keep track of what it’s
+supposed to be doing (since main() is the only function),
+and argv to point to the base of this array (which is
+computed differently based on how the architecture allocates the stack).
+Since this fills up the only two variables in the program, everything
+else is stored in the MASS [**] array.main(). We are overwriting frame pointers, return
+addresses, etc., with data. Hence, the program must never return from
+this call, otherwise it will crash horribly. That’s why I had to call
+exit() even though it meant I can no longer claim the
+program doesn’t need the comma operator. :-) (I was going to skirt
+around the issue by indirectly calling exit(), such as via
+bsearch() or raise(), but I was getting too
+close to the size limit.)Some notes about the macros
+indent on it: on my system it chokes and complains about
+nesting errors.)#defines are just to keep the code size
+down, due to the abusive amounts of type casting employed. The others
+define a bizarre “programming language” (in the crudest, most twisted
+sense of the word) that the author used to write this mess.R(i) and W(i,j) are macros to read/write
+the ith position of the MASS.A(i) retrieves the ith command-line
+argument. This is slightly tricky, because by the time the
+MASS is setup, we no longer have access to the original
+values of argc and argv. So what is done is
+that the initial memory allocation code will save argc and
+argv into positions 8 and 9 in the MASS after
+the allocation. It does this by using argv, which at that
+time contains a pointer to the top-level argc, to compute
+the location of the top-level argv. This is done before the
+rest of the MASS is used, since otherwise they may be
+overwritten.do(x,y) has nothing to do with do loops.
+:-) It defines a “state” in main(), essentially, what to do
+when main() is called with argc containing a
+particular value. (This is why the user must never run the program with
+more than 3 arguments. :-) The state number is x, and
+y is the code. The program’s boolean expression consists of
+a number of states &&d together. Within each state,
+it is assumed that statements are separated by ||. All
+statements are assumed to evaluate to false. This makes it easy to write
+conditional statements: if (a) { b } ... can simply be
+written a && b || .... All states created by
+do(x,y) are assumed to evaluate to false. There is only 1
+state which can return true or false: state 5, a “manually-implemented”
+state which determines whether the system uses top-down or bottom-up
+stack allocation. It’s the only state that needs to return a value from
+the boolean expression, since once the MASS is initialized
+any return value can simply be stored in a well-known location in the
+MASS.if(p,q,r,s) is, in fact, an if statement.
+:-) It is equivalent to:if (p) { q; r } else {s}q and r split up? Because it’s
+cleaner (in whatever twisted sense of the word that can be applied to an
+IOCCC entry) to implement using boolean expressions. Keep in mind that
+all statements are assumed to evaluate to false. The proof that this
+macro in fact implements an if-then-else construct is left
+as an exercise for the reader.while(x,y,z) is actually a while loop after
+all. :-) It implements the loop using, of course, recursive calls to
+main(). However, this macro doesn’t actually run a
+while loop; it implements the loop in the state numbered
+x. It is used for defining a while loop, which
+can then be called from another state using f(x). (The
+reason we can’t directly implement a while loop inside
+another state ought to be clear: we can’t recursively call
+main() to enter into the middle of a state.)for loop
+directly inside a state! The for(s,i,x,y,z,Z) macro does
+exactly this. Well, actually, technically speaking this macro can only
+be used as the last thing in a state, because it secretly closes the
+current state and opens a new one behind the programmer’s back. :-) Its
+intended usage is this: s is the state number for the loop
+body, and i is the index variable (well, the index into the
+MASS of the index variable); x and
+y-1 define the starting and ending values of
+i, and z is the loop body. Z is
+the post-loop code in the current state. For example:for(s,i, 0, 10,
+some_code ,
+other_code)for (i=0; i<10; i++) {
+ some_code;
+}
+other_code;for loop
+is clearer. This is why it’s easier to understand the pre-CPP code,
+since after CPP, the macro reshuffles some_code after
+other_code so that it can close the current state and
+define the one containing the loop body. (Have I told you that the
+author of this program is horribly, horribly, confused? :-) This
+confusion also shows up in the superficial appearance of the program,
+which heavily suffers from wrong indentation.)switch() really is just a
+shorthand macro for reducing code size. The evil choice of macro name is
+just to instill more confusion into the would-be decipherer of this
+entry. :-) After all, case() really is the
+equivalent of a case statement, implemented using
+&&, and conveniently encapsulating code common to
+the cases in the only switch statement in the program,
+which is the code that decides what to do with a key press. What could
+be more fun than to define such a case in terms of a
+switch? :-)MASS to their usage in the program, and what the various
+state numbers are meant to do:MASS usage map
+
+0 | Function return value
+1 | Function argument 1
+2 | Function argument 2
+3 | Function argument 3
+4 | Scratch register 1
+5 | Scratch register 2
+6 | Scratch register 3
+7 | Scratch register 4
+8 | Value of original argv :-)
+9 | Value of original argc :-)
+11 | Zero register (always set to 0)
+12 | Width of board
+13 | Length of board
+14 | Height of board
+15 | Current position of hole
+16 | Random seed for rand_r(3)
+18 | Scratch register used by state 18 :-)
+31 | field width for printing tiles
+32 | Start of board dataargv and argc necessarily need to
+stay away from lower indices of the MASS, because otherwise
+they may overwrite their original values when the memory allocation code
+saves them. Index 8 is deemed “safe enough”. (It seems to be on all
+tested architectures.)State number assignments
+
+1 | showhelp
+2 | showhelp
+3 | is 2D: start init
+4 | is 3D: start init
+5 | find allocation type
+6 | MASS init, bottom-up
+7 | MASS init, top-down
+8 | main program
+9 | generate() outer loop
+13 | render()
+14 | render() loop
+15 | exit(0)
+16 | pick a tile that hasn't occurred yet
+17 | inner loop of 16.
+18 | main loop
+19 | checkwin() loopdo()) respond to multiple state numbers.
+Also note that states 1-4 conveniently correspond to what the program
+should do when 1-4 arguments are given at the command-line. :-)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/anon
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 boutines
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/boutines
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Francois
+Boutines
Location: FRTo build:
+makeTo use:
+SVG file:ruby -e '20.times{puts "#{rand} #{rand}"}' | ./boutines > test.svgTry:
+./boutines < input.txt > result.svgconvert tool to convert the images to a png file:convert test.svg test.png
+
+convert result.svg result.pngtest.svg file directly. An example
+program is Inkscape. See the list
+cited above for others.Judges’ remarks:
+Author’s remarks:
+Walk-through
+Input
+Output
+./boutines | gzip > result.svg.gz[0,1]). Alternating a
+horizontal coordinate, a whitespace then the other coordinate (pointing
+downwards in the resulting graph) and a newline will just go fine:
+0 0
+0 1
+1 0
+1 1
+.5 .5Caution
+
+
+
+
+U be the next power of
+__LINE__.Why I think this code is
+Obfuscated ?
+
+
+math.h.if.Missing Features
+Color control
+Site labelling
+Site radius
+See Also
+
+Example Output
+
+
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2005/boutines
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 chia
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/chia
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: V. Chia
Location: SGTo build:
+makeTo use:
+./chiaJudges’ remarks:
+Author’s remarks:
+#define’d to look like Pascal
+or Visual
+Basic: the /bin/sh code from
+V7 Unix
+(which reportedly was the motivation behind this contest!), the VAL Linker by
+David Troendle, the 2000/primenum IOCCC entry, …
+Looking at these programs, I thought, “hmm… if it’s possible to make C
+code look like some weird cross between Pascal, VB, and COBOL, then how
+about making C code look like some other language?”Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/chia
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 giljade
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/giljade
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Gil Dogon
+Location: ILTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./giljadeTry:
+./giljade > outvi out^F (control F) repeatedly.Self-test feature to try:
+./giljade > out
+./giljade outJudges’ remarks:
+vi(1) (or vim(1)) to look at the source,
+use vi(1) (or vim(1)) to look at its output.
+We especially recommend it on a 78 column xterm while leaning on
+Control-F.s=s^(b=s&s-1^s)Author’s remarks:
+So what do we have here ?
+xterm(1) and vi(1) (or
+vim(1)). Do the following: open an xterm(1)
+with precisely 78 lines, and use the tiny font size for best results.
+Then vi(1) (vim(1) will also do) the output.
+Type ^F repeatedly or hold it down and enjoy the show …
+
+\
+at the 10’th line of the original program which is actually a ‘layout
+bug’).c.c. The exit code of the self-test will be non-zero in
+that case. In case this entry wins, I do hope nobody by the name of ‘c’
+also wins this year otherwise that part of the program would have to be
+changed!Why I think this program
+is obfuscated
+
+
+?:,
+&&, ||, , used to
+compress code length in the noble tradition of this contest, meaningless
+one character variable names, etc…
+ s=s^(b=s&s-1^s)Known
+Bugs/problems/warnings/portability issues
+cpps issue a warning about empty macro
+parameters.-pedantic informs me that ‘ISO C’ does not allow extra ;
+outside of a function, and to this I say to ISO what ???-Wall of course will suggest adding a lot of
+parenthesis, function prototypes, and remove some unnecessary
+expressions, and to this I say: if I listen to you where is my freedom
+to obfuscate in style?sizeof(int) = sizeof(FILE *). On systems when that is not
+the case expect a core dump…Challenges
+;; for ?126& in the program? (except for the
+rather obvious fact that it serves as comment obfuscater).s^= instead of s=s^ In the
+expression I’m most proud of ?40-(h&62) doing ?4*5. That’s a bit more tricky.Hint for the challenges
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/giljade
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 jetro
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/jetro
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jetro Lauha
+Location: FITo build:
+makeTo use:
+./jetroJudges’ remarks:
+Author’s remarks:
+getchar() before it quits.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/jetro
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 klausler
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/klausler
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Peter
+Klausler
Location: USTo build:
+makeTo use:
+./klausler arg1 arg2 | headTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+more(1)/less(1)/head(1) and
+you’re likely to find the most amusing possibilities in the first few
+screenfuls of output. For example,
+./klausler fawlty towers | more quickly prints “waterfowl
+sty”. The fewer obscure short words in your system’s dictionary, the
+better the quality of the output; indeed, all one-letter words apart
+from a, i, and s (for plurals)
+are ignored when the dictionary is constructed by
+make dict.h.main() recursion, or other
+tricks. Enjoy!Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2005/klausler
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 mikeash
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/mikeash
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Michael Ash
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./mikeashTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+C99’s ability to declare
+variables in the initializer of a for loop. Unfortunately,
+C99 mode typically warns about implicitly declared functions, and
+preprocessor directives prevent the program from being valid Common Lisp. As a
+result, several warnings will be printed about implicit declarations of
+functions. There are also warnings about unknown escape sequences in the
+constant string, due to different string escape semantics in C and Lisp,
+and some implicit integer-to-pointer conversions due to the
+implicitly-declared functions.echo '(format t "~s" (+ 2 2 ))' | ./mikeash4" echoed on your command prompt. The
+" after the 4 and the lack of a newline are due to the
+somewhat broken implementation of the format function. More
+sophisticated arithmetic expressions may be used:echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash(2+2) * (5 - 9/3) giving
+the correct result, 8" (with the same issue of no newline
+after the "). Note that due to the highly ad-hoc nature of
+the tokenizer, the spaces before the closing parentheses are
+mandatory../mikeash and then typing lisp expressions, but
+this is difficult due to the lack of proper editing facilities and the
+total lack of error recovery in the interpreter. Typos will most likely
+crash the program.
+
+defvar,
+format, substitute, char-upcase,
++, -, *, and
+/.q, although any symbol name starting with the letter
+q will be mapped to this variable.format, f, farm, and
+various other words starting with f will all map to the
+format function.defvar function completely ignores its first
+parameter. It will always store the result of evaluating its second
+parameter in q. Unlike in Common Lisp,
+multiple invocations of defvar on the same variable will
+overwrite old values.#\Newline and
+single-character constants such as #\x.char-upcase function will give strange results
+if passed something other than a lowercase character.format function takes exactly three parameters.
+The first parameter is ignored; output always goes to
+stdout. The second parameter must have exactly one
+~s format specifier in it, and no other format specifiers
+are permitted.) by
+whitespace../mikeash < mikeash.c > mikeash2.c
+diff mikeash.c mikeash2.c
+(load "mikeash.c")Obfuscation
+Lispob is obfuscated in several ways. First, it’s
+actually two programs in one, which actually share a small amount of
+code. Running a C code beautifier will destroy the LISP
+program contained within. Second and more importantly, it is very badly
+written, which will presumably confuse people who are used to looking at
+well-implemented interpreters.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/mikeash
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 mynx
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/mynx
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anthony C.
+Howe
Location: CATo build:
+makehttps as a starting point. See alternate code below.Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./mynx http://<domain>:port.
+See notes below on the issue of https.Try:
+./mynx http://www.textfiles.com
+
+./mynx manual.htmlAlternate code:
+https as it only scans
+for http in the URL (if not specified it tries to open it
+as a local file). But even if it scanned for https one
+would need to do more work as it would have to set up a secure
+connection before http commands could be sent. Fortunately or
+unfortunately many more websites use https so this entry will not work
+as well as it used to. If one were to try and connect to https://ioccc.org with this
+entry they’ll just get a 301 error.https too (note you have to specify the port in this case)
+but that is all it does. It will not work with https websites as it does
+not set up a secure connection. But should anyone wish to either come up
+with a pipeline (or some other command line) that allows it to work with
+https or to update the code to support https they may. Otherwise you
+must just appreciate the entry for what it once was.Alternate build:
+make altAlternate use:
+mynx.alt as you would mynx. You’d have
+to specify a port at the end of the URL like:./mynx.alt https://www.ioccc.org:443Judges’ remarks:
+mynx will give any Fiery Fox a run for its
+money. A nice complement to last years winning hibachi. The judges double dare
+any eager Obfuscationalists to submit the missing pieces to get a
+functioning LAMP stack.Author’s remarks:
+cc -o mynx mynx.ccc -o mynx mynx.c -lnsl -lsocketcd source ; ./configure ; make./mynx ../manual.html
+mynx.c
+makefile pre-built generic Unix
+README.md
+manual.html
+makefile.in makefile template
+entities.txt ISO 8859-1 entites
+configure.in configure script description
+configure pre-built configure scriptCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/mynx
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 persano
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/persano
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Mauro Persano
+Location: BRTo build:
+makestdout. See alternate code below.To use:
+./persano p q [num frames]Try:
+./persano 3 16 > knot3-16.gifAlternate code:
+_setmode() and _fileno(3) to set
+binary mode on stdout which should let it work with
+Windows.Alternate build:
+
+make altAlternate use:
+persano.alt as you would persano
+above.Alternate try:
+./persano.alt 3 16 > knot3-16.gifJudges’ remarks:
+Author’s remarks:
+SYNOPSIS
+./persano p q [num frames]DESCRIPTION
+(p,q)-torus knot is a
+closed, non-intersecting curve on the surface of a torus in R3 that winds
+p times around one cycle of the torus and q
+times around the other. p and q should be coprime;
+otherwise, the resulting curve will not be a knot (that is,
+imagining the resulting curve as a loop of rubber, there will be a way
+to bend, twist and stretch it, without cutting it 1,
+until it ends up looking just like a circle embedded in R3 2)../persano 3 2 1 > foo.giffoo.gif../persano 5 2OUTPUT FORMAT
+PORTABILITY
+EXERCISES FOR THE READER
+
+
+FOOTNOTES
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+
+
+Inventory for
+2005/persano
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 sykes
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/sykes
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Stephen Sykes
+Location: FITo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./sykes binary_fileTry:
+./try.shJudges’ remarks:
+$C000 of
+course!wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin
+wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin
+wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin
+wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bindd bs=2k count=1 if=/dev/zero of=nullfill.binpet.rom
+file.Author’s remarks:
+Test
+./sykes 6502testPET EMULATION
+./sykes pet.rom
+PRINT "HELLO, WORLD"./sykes pet.rom 6./sykes pet.rom 2
+^A HOME
+^L CLR
+^R RVS
+^E OFF
+^Y INST
+^X STOP (break)
+^F cursor forward
+^B cursor back
+^N cursor down
+LOAD "DEMO"
+RUN.PRG extension should work. (Look, for instance, here: http://www.zimmers.net/anonftp/pub/cbm/pet/ALLFILES.html,
+or try this one: http://www.zimmers.net/anonftp/pub/cbm/pet/games/english/dungeon.prg)
+The filenames must be upper case in order to be loaded by the
+emulator.
+10 PRINT "HELLO!"
+SAVE "HELLO"
+NEW
+
+LOAD "HELLO"
+RUN
+WAIT 6502,126502 EMULATION
+./sykes chess$C000, and starts execution from
+that address also (the reset vector is ignored).$8000, and is
+40 columns * 25 rows. Key presses appear when they occur in
+memory location $A2, and are ORed with
+$80 - this is a way of indicating a fresh character. The
+program can frequently check this byte, and when it sees a new
+character, it can AND it
+with $7F to indicate that it has been read.SEI instruction) if you do not need this.time(3) call is placed at address 0 - this
+can be used as a random seed.Technical description
+curses is used for the screen and keyboard handling.cpp) starting on line
+56. This decodes the 6502
+instructions according to a table and executes them.Bugs
+LOAD and SAVE, it cannot VERIFY
+or OPEN and CLOSE files.IMPORTANT NOTE
+pet.rom is not my work. So I ask the user to
+download it from the Internet. This is to avoid directly infringing any
+copyright.Finally
+./sykes pet.rom -1Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/sykes
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 timwi
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/timwi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Arne Timwi
+Heizmann
Location: DETo build:
+makeTo use:
+./timwi < bf_programTry:
+(echo "20 : ,-->+.>+.<<[>[>>+>+<<<-]>[>>+>+<<<-]>"; echo "[<+>-]>[<<<+>>>-]>[-]<<<<.<-]") | ./timwiJudges’ remarks:
+Author’s remarks:
+: (colon), then the BF program itself.Features
+
+
++-<>[].,).
+ J4mzt?Vazexx-20d~&&~AxdUV!x(~Jz&V)x*(P=J)JUN(dizz)xx_!xx'0&{Vz;}&JjLimitations
+ints, the
+calculations must not exceed the range of an int. (But then
+again, you can use the integer overflow to further obfuscate your BF
+programs in creative ways!)Obfuscations
+#defines to make everything look nice and lineal, and the
+program is merely a recursive main() function with only a
+single return statement which uses nested ternary operators
+to make even the pre-processed code unreadable.1+1+1…etc., and even if you replace these with their
+result, those numbers will still not represent (or even relate to) the
+ASCII codes of the BF instructions.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/timwi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 toledo
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/toledo
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Oscar Toledo
+G.
Location: MXTo build:
+makeTo use:
+./toledo [a ...]Try:
+./toledo a
+./toledo a bAlternate code:
+Alternate build:
+make altAlternate use:
+toledo2 and toledo3 as you would
+toledo above.Judges’ remarks:
+Historical note:
+main() - that was it. In 2023 due to problems with
+clang main() calls another function,
+pain(), which calls itself. But it might be said that the
+Chess is still a single function.Author’s remarks:
+What does this program
+./toledo./toledo a./toledo a bEntering movements
+d2d4 and press the enter key. This will move the pawn at
+D2 to D4, assuming that a pawn is there (as it
+would be in the beginning). The computer will check move legality and
+will warn you of illegal moves. All legal chess moves are permitted.f7f8n (supposing you have a pawn on
+F7), will promote it to a knight; substitute n
+for the desired piece
+(N/Q/R/B).Game status
+Quirks
+Program operation
+Additional features
+
+
+Obfuscation tricks
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/toledo
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 vik
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/vik
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel Vik
+Location: USTo build:
+makeTo use:
+./vik [file.map]Try:
+./vik maze.mapJudges’ remarks:
+main()
+is called again and again. Be sure to pay attention to commas! :-)Author’s remarks:
+Features
+
+
+Build and Run
+./vik [-w <width>] [mapfile]
+width - Specifies the width of the window
+mapfile - Filename containing a mapExamples
+./vik./vik maze.map./vik -w 400 maze.mapmapfile has to be the last argument and
+the -w option if present has to be the first. The map
+definition files and the bitmap files should be located in the current
+directory.Creating mazes
+* character lets the engine know where to position the
+user. The example below shows how a map file can look:
+aaaaaaaaaaaaa
+a a
+a * a
+a bbbb cccccccc
+c c
+cccccccccccccccccccca-z is found, the engine will load the corresponding
+texture bitmap. The bitmap file must be named *.bmp where
+* is substituted with the letter of the wall in the map
+(note that only a, b and c
+exist).a.bmp,
+b.bmp, and c.bmp should be located in the same
+directory as the engine executable (or rather in the current
+directory).Obfuscation
+
+
+? operator.main().for loops and the comma operator.Compiler warnings
+-ansi
+but there are quite a few warnings from lclint. Mainly
+because the program is very optimized for code size.Limitations
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/vik
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2005 vince
+
+
-
+ The International Obfuscated C Code Contest
+ 2005/vince
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Vincent
+Weaver
Location: USTo build:
+makeTo use:
+./vinceTry:
+Alternate code:
+CPP macro (which
+sneaked in accidentally) removed.Alternate build:
+make altAlternate use:
+vince.alt as you would vince above.Alternate try:
+vince as above.Judges’ remarks:
+{}s and
+whitespace to instruct the OpenGL
+development libraries to create beauteous visuals. Even hitting the
+space bar while the program runs produces a “spacey” effect! :-)Author’s remarks:
+ABUSE OF RULES
+
+
+{ } ;
+exceptions in the file size limits.Requirements
+
+
+.c on the end.Background
+Obfuscation
+GRATUITOUSLY_LONG_CONSTANTS’ and
+‘glLongStudlyFunctionNames();’.Usage
+For Fun
+Thanks
+Errors you can get
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2005/vince
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 birken
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/birken
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Michael
+Birken
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: uses gets() - change to fgets() if possibleTo use:
+./birken < file.tofuTry:
+./try.shJudges’ remarks:
+file(1) claims one of the
+.tofu files is Pascal source. :-)Author’s remarks:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/birken
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 borsanyi
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/borsanyi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Szabolcs
+Borsanyi
Location: DETo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./borsanyi string > file.gifTry:
+./borsanyi ioccc@example.com > example.gifJudges’ remarks:
+@ character will certainly challenge a few anti-CAPTCHA
+tools.Author’s remarks:
+Email address to gif
+converter
+Introduction:
+my_email _at_ address _dot_ com.
+But robots are clever enough to sort that out. A more sophisticated
+approach is to create an image file with the email address and put that
+on the web page.Usage:
+make all
+./borsanyi my@example.com > email.gif
+my_favourite_gif_viewer email.gifa-z_A-Z0-9@.-.Obfuscation:
+Questions:
+
+
+Portability:
+-lpthread). The program accepts email addresses not longer
+than 42 bytes composed from letters, digits, and the @._-
+symbols. An address not obeying these rules will cause undefined
+behaviour. The program is not expected to depend on endianness. The
+standard output is used for a binary output, which might cause problems.
+To avoid most caveats, the program does not output the octet
+0x0a. The program assumes the use of ASCII.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2006/borsanyi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 grothe
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/grothe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Aaron Grothe
+Location: USTo build:
+makeTo use:
+./grothe carrier_freq pixelclock horizontal_total < some_input.txtTry:
+./grothe 65000000 10000000 1344 < twinkle.txt./grothe 65000000 10000000 1344 < arabian.txt
+./grothe 65000000 10000000 1344 < olympics.txt
+./grothe 65000000 10000000 1344 < test.txtJudges’ remarks:
+Author’s remarks:
+0-9,#, and *.
+carrier_freq - base frequency used to host music
+pixelclock - refresh rate of the monitor
+horizontal_total - total scan along the horizontal axisxvidtune installed you can get the
+pixelclock and horizontal_total with the
+following commandxvidtune -show | head -n 1 | awk '{ print "pixelclock " $2 * 1000000 " horizontal_total = " $6 }'./grothe 65000000 10000000 1344 < twinkle.txtSeveral example songs
+antang@phakt.usc.edu - Tony:
+4-9-91231,2222-321123123-9-91231,2222-32112321fsufunkyb@aol.com -
+Ben Schmidt:
+1199##9-6633221-9966332-9966332-1199#9-6633221-rdippold@qualcomm.com - Ron
+“Asbestos” Dippold:
+453,54,4569564459,9#95458,8987453 54Obfuscations
+
+
+XsetWindowAttributes declares local variables.y dimension to draw
+carrier frequency and x dimension to draw audio frequency,
+based on Erik Thiele’s Tempest for Eliza.#defines confuses many people :-)pixelclock and
+horizontal_total and which carrier_freq to use
+can be an exercise in obfuscation for the user.static to ensure initialization is EVIL and
+done in several placesstatic declarations & void
+function returns we don’t care about making the code harder to
+read.References
+Tempest-AM Radio Signal Transmitter).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/grothe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 hamre
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/hamre
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Steinar Hamre
+Location: NOTo build:
+makeTo use:
+./hamre math_expression_stringTry:
+./try.shJudges’ remarks:
+Author’s remarks:
++, - (binary and
+unary), *, / and (). Run it by
+supplying an expression as the first argument, and the normalized result
+will be written to stdout../hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2'
+2/31/0 is not a rational number. You will not
+get any answer if you divide by zero.<= 7) as smaller numbers are much easier to remember.
+Also the macros really help hide most of the uses of these numbers away.
+All macros and variables are easy-to-remember single character
+abbreviations, from some language, meaningful to the purpose(s) of the
+macro, I hope.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/hamre
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 meyer
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/meyer
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Raphael Meyer
+Location: USTo build:
+makeTo use:
+./meyer [SEED]Try:
+./meyer [SEED]
+a 0 1a is the row (a-i),
+0 is the column (0-8) and
+1 is the number (1-9).Judges’ remarks:
+Author’s remarks:
+
+
+WYWIWID’ (‘what you write is what it does’)
+anymore.WYWIWID’
+(‘what you write is what it does’). It may be tempting to think that
+Object o;struct not_an_object o;
+
+Starting the game
+./meyer [SEED]Gameplay
+
+
+
+row column number
+row: [a-i]
+column: [0-8]
+number: [1-9].q.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/meyer
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 monge
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/monge
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Maurizio
+Monge
Location: ITTo build:
+makeBugs and (Mis)features:
+
+STATUS: doesn't work with some platforms - please help us fix
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./monge expression ...Try:
+./monge "z = 0" "z = z*z*z + c; Abs2(z) < 4"
+That's not a bug, that's a feature.Alternate code:
+Alternate build:
+make altW, H and
+I. The defaults are (respectively) 400, 300 and \128. If
+you wish to change the image size to 500x500 but keep the iterations the
+same then do:make clobber WIDTH=500 HEIGHT=500 altmake clobber ITERATIONS=512 altAlternate use:
+monge.alt exactly as you would monge
+above.Judges’ remarks:
+i386 and x86_64. Portable it is!
+:)Author’s remarks:
+For the impatient:
+
+
+gcc monge.c -o monge -O3 `sdl-config --libs --cflags`
+
+./monge "z = 0" "z = z*z + c; Abs2(z) < 4"
+
++ and - to
+increase/decrease the iteration count when needed.Introduction
+XaoS’s but it should give
+slightly better results.a-z (lowercase) variables, and the
+special variables c and i are respectively set
+by default to the complex coordinate of the pixel and to the complex
+imaginary i.[variable] = [expr])
+or a comparison with < or >
+([expr1] < [expr2] or
+[expr1] > [expr2]), and you can add spaces as you like
+(as understood by the C function isspace()).
+Operation | Description
+:-------- | :----------
+ +,-,*,/ | Arithmetic operations, priority of * , / over +,- is
+ | respected.
+ |
+ <,> | Compares the real parts of two complex numbers (the imaginary part
+ | is ignored). Any number of conditions is allowed, the iteration
+ | will just stop as soon as one of them fails.
+ Abs2 | Calculates the squared norm, i.e.: Abs2(a+b*i) is (a*a+b*b)+0*i.
+ Re | Extract the real part, i.e.: Re(a+b*i) is a+0*i.
+ Im | Extract the imaginary part, i.e.: Im(a+b*i) is b+0*i.
+ Exp | Calculates the complex exponential, i.e. Exp(a+b*i) is
+ | e^a*(cos(b)+sin(b)*i).
+ Ln | Calculates the principal value of the natural logarithm, i.e.
+ Ln(a+b*i) is ln(a*a+b*b)/2 + atan(b/a)*i.
+
+./monge "z=1" "z=z*z+c; Abs2(z)<4"
+
+./monge "z=c" "z=z*z+c; Abs2(z-c)>0.0001"
+
+c=0.31+i*0.5:./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z)<4"
+
+for c=0.31+i*0.5:./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z-c)>0.0001"
+
+x^3-1:./monge "z=c" "p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) > 0.001"
+
+./monge "z=0" "p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) > 0.001"
+
+./monge "z=0; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"
+
+c=0.56667-i*0.5:./monge "z=c; c=0.56667-i*0.5; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"Compilation and portability
+mmap(2) function (as
+#defined at the beginning of the program). If it is not
+available the macro M(a) will have to be replaced with a
+system dependent function that allocates readable, writable AND
+executable memory (it will not be possible to make this program run on
+paranoid systems (like OpenBSD IIRC) that do not allow rwx
+memory).W, H
+and I at the beginning of the code.Caveats (I just a
+selected few of them!)
+
+
+double, instead of adding a 0 imaginary part to
+treat them as complex numbers.Spoiler
+>1) the pixel is recalculated.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/monge
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 night
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/night
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Night
Location: USTo build:
+makeTo use:
+./nightAlternate code:
+wasd keys.Alternate build:
+make altAlternate use:
+night.alt as you would night above.Judges’ remarks:
+Author’s remarks:
+What it does:
+2^32 that requires 64
+moves to solve. The program will run until finding this global maximum,
+or if you get bored, you can accept a sub-optimal solution by pressing
+any key. On my system, it takes an average of 15 minutes to find the
+maximum, whereas a random search would take an average of 3.5 days.w, a, s, d) to move
+around. q quits and r restarts. Also, the maze
+changes as you move through it, in a predictable way. It should be easy
+enough to figure out the pattern. For best results, use a display with
+bold-text capabilities and color.Issues:
+T.sizeof(unsigned short) must be 2, and
+sizeof(unsigned long) must be 4.CLOCKS_PER_SEC is assumed to be 1000000. If
+it’s a lot less than that, expect delays.Algorithmic obfuscation:
+2102231031201230. Try getting from there to the maze that
+appears on screen.CGAC() replaces a nested for loop
+in a handy way.TGA() returns no solution both
+if no solution exists, and if the search space grows too large, with a
+single test.Stylistic obfuscation:
+G and G().!= when you’ve got ^?if when you’ve got while?for and
+while when you can just duplicate code with the
+preprocessor? Duplication by this macro causes one particular graphics
+line to be replicated 512 times. On my system the preprocessed code is
+over 80KB in length, hindering the preprocessor’s ability to
+deobfuscate. #define ATG srand(time(0)); initscr(); cbreak(); noecho(); start_color(); keypad(stdscr,1);
+ #define AGG A&2?KEY_UP:KEY_DOWN:A&1?KEY_RIGHT:KEY_LEFTCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/night
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 sloane
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/sloane
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Andy Sloane
+Location: USTo build:
+make altTo use:
+./slone.altTry:
+usleep(). The default is
+75000 but you can easily change it. To do so try:make clobber SLEEP=70000 clobber alt
+./sloane.altmake SLEEP=0 clobber alt
+./sloane.altOriginal code:
+Original build:
+make clobber allOriginal use:
+./sloaneJudges’ Comments:
+Author’s remarks:
+sin(3) and cos(3) and hence
+requires the math library.ints without types. The code looks better
+this way, though, I think. There are also no #includes, so
+there may be warnings for undeclared references to
+printf(3), etc. There’s a chance that my failure to include
+math.h or declare sin(3) or
+cos(3) will make the donut not render
+properly – it’s worked on every system I’ve tried so far though.#define hacks, or even #includes,
+and is portable enough to not require any special libraries to
+do the animating. I achieved this with two standard escape codes for
+clearing the screen and moving the cursor back to the top-left.How is it obfuscated?
+Puzzles
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/sloane
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 stewart
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/stewart
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Thomas
+Stewart
Location: USTo build:
+makeTo use:
+./stewart width_and_height iterations file > file.xbm
+convert file.xbm file.pngfile is one of:
+altar box box2 box3 build carpet circles cross cross2 cross3
+crystal curve diamonds diamonds2 dragon dragon2 dragon3
+fern gasket gasket_mod gasket_mod2 ioccc maze octagon
+pentagon pentagons rings rings2 spirals spirals2 spirals3
+spirals4 squares stars stars2 tree tree2 tree3 tree4 triangleconvert(1) belongs to ImageMagick.Try:
+./stewart 400 1000000 maze > maze.xbm
+convert maze.xbm maze.png
+
+./stewart 1024 1000000 gasket > gasket.xbm
+convert gasket.xbm gasket.png
+
+./stewart 1024 1500000 dragon3 > dragon3.xbm
+convert dragon3.xbm dragon3.pngJudges’ remarks:
+#define in the
+output. The selection of input files makes this one endlessly fun to
+play with. Many image viewers will be able to read the results, as will
+a reasonably experienced user who can parse formats in their mind.
+:-)Author’s remarks:
+Execution
+./stewart <m> <n> <ifs>
+m = The size of the picture (picture will be m X m in size).
+n = The number of iterations to run (More will make for a
+ clearer picture).
+ifs = The file to use as input.Example:
+./stewart 1024 1000000 gasket > gasket.xbmCompilation/Testing
+gcc -ansi -Wall. lint also seems to like the
+code. This must be a bug in lint.Entry originality
+Input File
+
+<num ifs> <x min> <y min> <x max> <y max>
+<a> <b> <c> <d> <e> <f> <p>
+<a> <b> <c> <d> <e> <f> <p>
+<a> <b> <c> <d> <e> <f> <p>
+.
+.
+.
+3 0 0 1 1
+.5 0 0 .5 0 0 .33
+.5 0 0 .5 .5 0 .33
+.5 0 0 .5 .25 .433 .34
+4 -5.5 0 5.5 11
+0 0 0 .16 0 0 .01
+.85 .04 -.04 .85 0 1.6 .85
+.2 -.26 .23 .22 0 1.6 .07
+-.15 .28 .26 .24 0 .44 .07num is the number of equations in the IFS.
+x (min, max) and y (min, max) define the
+ranges that will be displayed in the XBM image file.a b c d e f are used to iterative find points that
+lie in the IFS from the algorithm
+x = a * prevx + b * prevy + e;
+y = c * prevx + d * prevy + f;p is for the probability that the equation will
+run.Obfuscations
+void * as my only
+variable (aside from the args for main()). This causes me
+to do much casting and pointer arithmetic to get the correct location
+and completely does away with any meaning the variables could have. This
+also makes the code more convenient to read in the current form vs
+preprocessed. After preprocessing there will be almost 300 casts in the
+code and I believe they are all needed… (I would double check but my
+brain is kinda mushy right now from chasing down a segfault in the
+code.)IFS. Which isn’t all that common for a program to do. I
+mean google only has something like 66,000 hits for “Iterated function
+system” so that means it is obscure, right?Some other minor
+obfuscations
+rand() to generate a pseudo-random
+number. Instead I use XOR and bit shifting.IFSs. This has the added bonus
+of hiding information about the algorithm.Silly things
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/stewart
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 sykes1
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/sykes1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Stephen Sykes
+Location: FITo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./sykes1sykes1.html.Try:
+./sykes1 10Also try:
+time ./sykes1 19186Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz with 16 cores (via
+HyperThreading):
+real 6m35.524s
+user 6m35.159s
+sys 0m0.002s
+real 7m10.786s
+user 7m8.322s
+sys 0m0.110sJudges’ remarks:
+diff -s sykes1.c sykes1.htmlAuthor’s remarks:
+Instructions
+./sykes1./sykes1 some_number19186 solutions to
+choose from../sykes1 19186Implementation
+int s[ ] = { 186, 94, 1426, 3098
+ ,1047 , 122 , 1082 , 3083 , 1039
+ , 569 , 527 , 1054 , 531 } ;186 - this is
+010111010 in binary. Written out like this you can see that
+it is the cross shaped piece:
+010
+111
+0101426):
+000
+000
+010
+
+110
+010
+010
+ +---------+
+ / +----+ /|
+ +-/ /| / |
+ |+----+ |/ +
+ || | + /
+ +| | /
+ | | /
+ | | /
+ | |/
+ +----+Making your own shapes
+int s[ ] = { 187, 94, 402, 30981/64th cube (edges must be removed within each piece). In
+the GIF this is taken care of by color, which is graded from the back to
+the front to ensure edge visibility.Notes
+main() - which
+is recursively called. In fact if you select solution 19186 it will be
+called exactly 159,260,759 times.19186, the program will
+return a solution but it will be a rotation of one of the first
+19186. This is because the cross shaped piece fits 48 ways
+in the 4x4 cube, but only 2 of those ways are unique - you can rotate
+one of those to make any of the other 46. The algorithm used always
+places the cross piece first, so the first two placings of that piece
+result in the 19186 unique solutions.460464
+(24x19186) the program will return without outputting a
+solution. If you can wait that long.--unroll-loops to be helpful
+with gcc.long long int being 64 bits, but
+has no other special requirements.Bugs
+/* at the beginning, and won’t mind the missing html
+and head tags and the lack of end tags.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/sykes1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 sykes2
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/sykes2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Stephen Sykes
+Location: FITo build:
+makeTo use:
+./sykes2Try:
+./try.shJudges’ Comments:
+Author’s remarks:
+man 7 operator) - careful choices
+were made to keep the usage of brackets to a minimum, and to keep the
+character count as low as possible.main(). (gcc does not notice this though, even
+with -Wall.) But anyway it can easily be declared as int at
+the expense of 4 more characters.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/sykes2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 toledo1
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/toledo1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Oscar Toledo
+G.
Location: MXTo build:
+makeTo use:
+./toledo1 [0-9][0-9][0-9][0-9] is a two digit number.Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+./toledo1 11 # start is A8
+./toledo1 18 # start is H8
+./toledo1 81 # start is A1
+./toledo1 88 # start is H1
+./toledo1 44 # start is D5Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/toledo1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 toledo2
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/toledo2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Oscar Toledo
+G.
Location: MXTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./toledo2ctrl-z. As mentioned in the
+author’s remarks and in the below section, it is supposed to crash on
+termination though some noted this does not seem to happen in macOS or
+linux in 2023.Try:
+./toledo2
+10 PRINT "HELLO WORLD!"
+LIST
+RUNAlternate code:
+read(2) and
+write(2).Alternate build:
+make altAlternate use:
+ANSI.SYS to your CONFIG.SYS but this is also
+something we can’t test.toledeo2.alt as you would toledo2
+above.Judges’ remarks:
+C) to be present, but it does not have to be
+one of C.BASIC or C.BIOS - you’re welcome to
+write a standalone 8080 program yourself! How about C.FORTH
+or C.LISP?ADVENTUR); walking in a maze of twisty little passages all
+alike is easier than understanding the code!KAYPROII.ZIP file originally
+came from http://www.retroarchive.org/cpm/os/KAYPROII.ZIP.
+For your convenience, we have included KAYPROII.ZIP in this
+entry. Both the make all and the make alt
+unzip that file, and the make clobber removes those files
+extracted from the KAYPROII.ZIP.Author’s remarks:
+C (NOTE from the judges: running make will do
+this for you), run the emulator, and et voila! you have the public
+domain Palo Alto Tiny
+BASIC (by Li-Chen Wang), published in the very first volume of Dr. Dobb’s
+Journal.
+10 PRINT "Hello, world!"
+LIST
+RUN
+
+10 FOR A=1 TO 10
+20 PRINT A\
+30 NEXT A\
+LIST\
+RUN
+
+10 INPUT A
+20 INPUT B
+30 PRINT A+B
+LIST
+RUNCPM64.COM to files named A and
+B (these will be the disk drives). Now rename the provided
+C.BIOS to C and run the emulator.HALT.COM to stop the emulator (so it
+closes drives) and IMPORT.COM to introduce new files. The
+two files are created automatically by the provided C.BIOS.SOURCE directory:
+ ASM.COM DDT.COM DUMP.COM ED.COM LOAD.COM
+ PIP.COM STAT.COM SUBMIT.COM XSUB.COM./toledo2 DDT.COM> prompt appears, do:
+IMPORT DDT.COMHALT, so the file is closed, and you
+can start the same process with another file.
+
+What is an 8080?
+AF', BC',
+DE', HL', IX or IY),
+no relative jumps, and no instruction beginning with CB,
+DD, ED or FD exists.S (Sign, bit 7), Z
+(Zero, bit 6), P (Parity, bit 2) and C (Carry,
+bit 0).Porting it
+getch()/kbhit() and ANSI terminal:
+read --> Z=kbhit()?getch():0
+write --> putchar(7[o])
+system --> nothing#include <conio.h>
+as well.
+ #include <signal.h>
+ signal(SIGINT, SIG_IGN);getch() is
+part of curses but this is not what is needed.ANSI.SYS to
+CONFIG.SYS.stty is required but circa 2001 it
+was not required.How it works (SPOILER)
+l array contains the 64K memory; it is initialized
+with a boot image loaded from the C file. The program counter
+is the c pointer and registers
+are in o[]. The main loop reads every opcode and separates
+them in one of three common forms. A lot of ternary operators selects
+the instruction.
+o[0] = B register o[1] = C register
+o[2] = D register o[3] = E register
+o[4] = H register o[5] = L register
+o[6] = Flags o[7] = A or accumulator
+76 Quits emulator
+DB 00 Reads key pressed status
+DB 01 Reads key
+DB 02 Reads byte from file (Carry=EOF)
+D3 xx Writes byte from acc. to console
+ED ED 02 Reads sector
+ED ED 03 Writes sector
+FBFA = Low source/target direction
+FBFB - High source/target direction
+FBFC - Sector
+FBFD - Low cylinder
+FBFE - High cylinder
+FBFF - Drive.Other notes
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/toledo2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2006 toledo3
+
+
-
+ The International Obfuscated C Code Contest
+ 2006/toledo3
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Oscar Toledo
+G.
Location: MXTo build:
+makeTo use:
+./toledo3 [1 | 2 | 3 [b]]Try:
+./toledo3 1Alternate code:
+Alternate build:
+Alternate use:
+toledo3-sbar and toledo3-txt as you
+would toledo3 above.toledo3.alt, we presume you
+can open it like any other application.Judges’ remarks:
+Author’s remarks:
+A1, H5, C4, D5? The
+queen is really pointing to the king?WYSIAIE’, or ‘What You See Is An IOCCC Entry’). Pointing
+and clicking to move pieces is the only required action, and of course
+the command-line options:./toledo3 # Two-players mode (useful if you don't have a board at hand)
+./toledo3 1 # Human white - Computer black, level 1 (fast)
+./toledo3 2 # Human white - Computer black, level 2 (medium)
+./toledo3 3 # Human white - Computer black, level 3 (slow)
+./toledo3 1 b # Human black - Computer white, level 1 (fast)
+./toledo3 2 b # Human black - Computer white, level 2 (medium)
+./toledo3 3 b # Human black - Computer white, level 3 (slow)WHAT ABOUT THE ENGINE
+gcc -O3 -fexpensive-optimizations prog.c -o prog -lX11KNOWN “FEATURES”
+
+
+#include <X11/Xlib.h> to #include "layer.c"
+and use a Windows compiler (only tested with Dev C/C++ 4.9.9.2) The play
+level is fixed, though you can change it easily. Of course, this is an
+example of an obfuscated Windows program (there exists another way of
+write them?).CHALLENGES
+UPGRADES
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2006/toledo3
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 akari
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/akari
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeTo use:
+./akari [ input_file | - ] [ output_file | - ] [even]Try:
+./try.shJudges’ remarks:
+Akari is an image downsampling utility that accepts 3
+input formats:
+
+Akari only accepts PGM files with the header:
+P5 <width> <height> 255. Images with extra
+comments such as the ones produced by GIMP will not be parsed
+properly.PPM files with the header
+P6 <width> <height> 255 are accepted.PGM or PPM
+will be downsampled as ASCII art.Author’s remarks:
+Akari is an image downsampling utility. She accepts up
+to 3 arguments:- or
+unspecified, Akari will read from stdin.- or
+unspecified, Akari will write to stdout.Akari to keep
+even pixels on even scanlines. By default
+Akari will keep odd pixels on odd scanlines.Examples:
+gcc akari.c -o akari
+./akari < example.ppm > odd_output.ppm
+./akari - - even < example.ppm > even_output.ppm
+./akari example.ppm odd_output.ppmAkari accepts 3 input formats:
+
+Akari only accepts PGM files with the header:
+P5 <width> <height> 255. Images with extra
+comments such as the ones produced by GIMP will not be parsed properly. PPM (netpbm RGB
+image). Only PPM files with the header
+P6 <width> <height> 255 are accepted.PGM or PPM
+will be downsampled as ASCII art. Since the source code is formatted as
+ASCII art, it’s only natural to try:./akari akari.c akari2.cakari2.c is also a valid C program, and accepts up to 1
+argument. By default, this second program reads text from
+stdin and writes expanded output to stdout. If
+the extra argument is specified, the output text will also pass through
+a rot13 filter.gcc akari2.c -o akari2
+./akari2 < input.txt > expanded_output.txt
+./akari2 rot13 < input.txt > expanded_and_rot13_output.txt./akari2 rot13 < input.txt | ./akari > rot13.txt./akari < akari.c | ./akari > akari3.c./akari < akari.c | ./akari | ./akari > akari4.cakari3.c and akari4.c are still (mostly
+valid) C programs. gcc -Wall will output a few warnings,
+but still produce output executables. The output executables each print
+a message to stdout.brainf#$% program in a C program, for example. For
+comparison, a brainf#$% program is embedded inside akari.c.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/akari
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 blakely
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/blakely
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Philip
+Blakely
Location: GBTo build:
+makeTo use:
+./blakely < blakely.c | head -300Try:
+./try.sh./blakely < t0_3.datJudges’ remarks:
+./blakely - < garden.txtAuthor’s remarks:
+./blakely < blakely.cOverview
+./blakely - < 3.dat./blakely < evolve_to_3.datInput file format
+\n (ASCII 10), including the last line. When designing
+grids, it may help to type full-stops (dots) in place of spaces, and do
+a global replace afterwards. Any deviation from this format will cause
+errors in the output.Limitations
+9802s to
+MAX_SIZE*MAX_SIZE+1 will solve this, although some
+reformatting of the code might have to be done to allow larger
+numbers.Compiler warnings/assumptions
+-Wall -pedantic -ansi options of
+gcc, some warnings suggesting extra parentheses occur (not necessary for
+anyone fully conversant with operator precedence). There is one unused
+variable, v, but unnamed function parameters are not
+permitted in ANSI C, so naming it is necessary, and gcc no longer warns
+about its existence, although earlier versions do.\n to end a
+line will cause problems when reading in files.Obfuscation
+#defines, and
+applying GNU’s indent, although making the location of functions and
+statements clear, by no means makes the code entirely clear. Note that
+expanding out the #defines does not take the program over
+the character limit. The main reason for these is to do with the layout,
+since there are few places that keywords or tokens of over 2 characters
+can be fitted, and requiring the first few lines to be
+#includes would cause similar problems.
+
+2[a] syntax to access the third
+element of the array a.gotos to emulate a for loop.Algorithm
+Program layout
+
+* * * * * * * * * *
+ *****************
+* * * * * * * * * *#defines and
+#includes given in the build-script, as there was no way to
+have sufficient separate lines in the code to do this without causing
+many difficulties. Some rejigging of the grid’s layout as the code was
+fitted into its format was also done, resorting to trial-and-improvement
+in some cases. Occasional use of constructs such as f -= -3
+was made as f += 3 could not be fitted into the required
+format. The fact that the borders would be killed off immediately was
+also helpful../blakely - < blakely.c is therefore
+not recommended.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/blakely
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 borsanyi
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/borsanyi
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Szabolcs
+Borsanyi
Location: DETo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./borsanyi < some_data_fileTry:
+./try.shJudges’ remarks:
+Challenges:
+malloc(3) or alloca(3). How does it build
+the histogram?fork(2) 22 times?Author’s remarks:
+Limitations
+
+
+fork() and
+wait(NULL) are used).Obfuscation
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2011/borsanyi
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 dlowe
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/dlowe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: J. David Lowe
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: missing or dead link - please provide them
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > trained.net/.trained.net:./dlowe file [file ...] < trained.netTry:
+./try.shdlowe-aux-data/ directory, which try.sh refers to, was created by:tar -jxf dlowe-aux-data.tar.bz2Judges’ remarks:
+
+ioccc-winlose-trained.netioccc-winlose-trained.net was trained using the earlystop.pl tool:rm -f ioccc-winlose-trained.net
+./earlystop.pl ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/
+
+ioccc_won_training/ 1/2 of C code of the 20th IOCCC
+winners (except for dlowe.c from 2011) plus 1/2 of
+the C code winners from prior IOCCC contestsioccc_won_test/ 1/2 of C code of the 20th IOCCC
+winners (except for dlowe.c from 2011) plus 1/2 of
+the C code winners from prior IOCCC contestsioccc_lost_training/ 1/2 of C code from entries that
+that did not winioccc_lost_test/ 1/2 of C code from entries that
+that did not win/dev/null.
+training 1 to 1001...
+training 1001 to 2001...
+prior error = 56.746974766043; current error = 58.095691135305ioccc-winlose-trained.net file was
+included in the dlowe-aux-data.tar.bz2 tarball../dlowe dlowe.c < dlowe-aux-data/ioccc-winlose-trained.net
+dlowe.c 0.125108other data sets to try
+./dlowe -8000 dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ < /dev/null > dlowe-aux-data/english-trained.net
+
+./dlowe -8000 png-1/ png-0/ < /dev/null > dlowe-aux-data/png-trained.net
+
+./dlowe -8000 dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ < /dev/null > dlowe-aux-data/xor-trained.net
+
+/ for them to work.Author’s remarks:
+Synopsis
+Description
+2^16 input neurons, 6 hidden
+neurons and 1 output neuron.1 / (1 + e ^ -x).Classifying
+./dlowe file [file ...] < trained.netstdin) and one or more files to classify. The program will
+output one line per successfully-classified file to stderr,
+with the filename and the classification: a number between 0 and 1.Training
+./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > end.net/ for them to work.stdin), two or more corpora (directories containing
+training data), and the number of training iterations to run. The
+program will write some progress data to stderr and, when
+it’s done, will serialize the updated network to
+stdout.stdin).1.
+The last will be assigned a target value of 0. Intervening
+directories (if any) will be assigned intermediate target values.0.3. No momentum
+factor is used.png corpora
+Results:
+
+
+*.gif and
+*.png files from my home computer as a test set;> 0.5 as “probably a
+.png” and < 0.5 as “probably a
+.gif”English corpora
+Results:
+
+
+> 0.5 as “probably English”
+and < 0.5 as “probably French”xor corpora
+01 and 10 respectively.00 and 11 respectively.Results:
+<0.01.Limitations
+dirent API,
+so to get this working on a Windows system you’ll need cygwin+gcc
+(tested) or a dirent compatibility library (untested, but
+they do exist).Obfuscation
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/dlowe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 eastman
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/eastman
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Peter Eastman
+Location: USTo build:
+makeTo use:
+./eastmanTry:
+./eastmanreset.Judges’ remarks:
+Author’s remarks:
+cc -lm eastman.cPortability
+Obfuscation
+ioctl(2) should really be a
+struct winsize, and I should then look up the
+ws_row and ws_col fields, but that makes it
+way too obvious what I’m doing there. Since a
+struct winsize just contains four
+unsigned shorts, I replaced it with an array. And since all
+the values will be much less than 32767, I further
+simplified the type to just short[].printf(3) spec to print a
+single space in a desired color: "\x1B[%dm. I could have
+done something to further obfuscate it, but it’s already
+indistinguishable from line noise, so why bother?while(1), but why write a 1 when I can calculate it from
+the return value of usleep(3) instead? And I could have
+written usleep(80000), but usleep(79383) just
+looks so much better. And so on.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/eastman
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 fredriksson
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/fredriksson
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Kimmo
+Fredriksson
Location: FITo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./fredriksson [-icvtnk#] regexp < fileTry:
+./try.shulimit
+first.Judges’ remarks:
+grep. On the inside, it is a Burrows-Wheeler
+transform decompressor that produces the source code of the actual
+obfuscated approximate grep program and calls it. As an
+exercise, try writing the compressor.Author’s remarks:
+Approximate grep
+grep.Usage
+./fredriksson [-icvtnk#] regexp < file-i, -c, -v and -n
+are the classic ones:
+
+-i Ignore case.-c Count only, prints the number of matches, but not
+the matching lines.-v Invert match.-n Prefixes each printed line by its line number
+(only if -c was not given).grep recognizes two more options, not
+present in normal grep implementations:
+
+-kN Permit N insertions, deletions or
+mismatches of characters in the matches (aka edit-distance).
+E.g. “obfuscated” matches “obfuscation” with
+one deletion and two mismatches. Likewise, “obfuscate” and
+“oversimplify” match with 7 edit
+operations. The default is -k0 (i.e. exact
+match).-t Add local transpositions to the set of allowed edit-operations.
+That is, “ab” matches “ba” with one
+transposition (swap), and “obfuscated” matches
+“bofsuact” with three swaps and two insertions, i.e. use
+-tk5 to find this.
+
+. (dot) matches any character.[
+and ], matches any single character in the list.[a-d] is the same as
+[abcd].\. to match period). You might want to
+protect these with ', i.e. use 'foo\[bar'
+instead of foo\[bar. If you want to use the literal
+- in bracket expression, protect that too
+(\-), otherwise this is not needed. Note that the syntax
+differs from standard (?) grep a bit, i.e. in plain grep you can use
+] and - in bracket expressions by putting
+] as the first character, and putting -
+last.Other uses
+
+
+./fredriksson -k3 cat < file
+
+cat, you can append line numbers too:./fredriksson -nk3 cat < fileOther features
+
+
+ioccc”, with option
+-vk5.Limitations and remarks
+
+
+-Wall) when building
+gives a lot of warning, such as
+suggest parentheses around '&&' within '||',
+value computed is not used,
+implicit declaration of function 'putchar',
+implicit declaration of function 'getchar',
+control reaches end of non-void function and
+format not a string literal and no format arguments. Please
+ignore them all, since they just try to tell you that the source is
+obfuscated.stdin comes from a file, i.e. pipes may or may not work. If
+you want to count only (-c option), then this shouldn’t be
+an issue.sizeof(long)*CHAR_BIT. That does not count things like
+bracket expressions or escape chars, that is, the pattern
+'a[bcd]e\.f' is 5 chars long, not 10 chars. That does not
+mean that the matched substring in the standard input has this limit, as
+using the edit operations can make the string longer. However, no
+assumptions are made for sizeof(long). In fact, you can
+easily use long long instead,$PATH; the
+latter is hard coded to be ‘gcc’, but any compiler would work, provided
+that it supports C99, or long lines as an extension. This code has been
+tested on:
+
+Obfuscations (a.k.a.
+spoilers…)
+
+
+
+ gcc -O3 ag.c -o agp[] and
+(possibly) two specially encoded constants, -~('('*'(') and
+'C'*' '-'-'. The extracted source (ag.c) is
+obfuscated as well.
+
main() contains several logical
+subroutines, selected by the first argument)
+
bzip2(1))long, to speed up the dynamic
+programming)
+
int, char,
+void …)0-9 are
+not)?: constructs are
+present). Two’s complement representation of integers is also abused.
+E.g. instead of writing x++ or x-1, it is much
+better to write x=-~x and ~-x.
+ ./fredriksson -ck0 [0-9] < fredriksson.c3 in the char
+array (only). You can also try
+ ./fredriksson -ck0 [0-9] < ag.cfredriksson at least once (since this
+generates that ag.c file), and this should print
+0."\b", except that the backspace
+\b is not escaped like that; the source uses the raw ASCII
+value (010 octal) instead. Thus when viewing with cat or
+something, that backspace erases the leading quotation mark. Makes it
+appear uncompilable, and it is: if you copy-paste the cat output from
+terminal to some editor, save it, the result would not compile.chars.indent(1) or
+bcpp(1) (C beautifiers) does not beautify it a bit. In
+fact, indent makes it only worse (at least with the default
+options). Running it through the preprocessor does basically nothing,
+since no #defines are used.;, { and } chars is below the
+limit, but most of the whitespace chars are in an initialized
+character array. That is, the number of chars in the program
+exceeds the 2048 limit. However, whitespace is whitespace and the rules
+did not specify that these must be in between the statements. A
+character is a whitespace if isspace() returns non-zero
+value. Even if deleting even one of those chars it breaks the program!
+(This does not apply to the generated source
+ag.c.)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2011/fredriksson
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 goren
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/goren
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Uri Goren
+Location: ILTo build:
+makeTo use:
+echo "some text" | ./gorenTry:
+./try.shJudges’ remarks:
+
+
+echo 'If | is just a representation of a pipe, then how can data stuff it?' | ./gorenecho '| is just a representation of a pipe because I say so! So stuff it!' | ./gorenAuthor’s remarks:
+
+The famous pipe. How people reproached me for it! And yet, could
+you stuff my pipe? No, it's just a representation, is it not?if and
+while. His achievement in improving clarity by omitting
+conditions is impressive, but I think it can be taken further, in two
+ways.?:,
+&& and ||, can be thrown away. Second,
+using setjmp(3) and longjmp(3), which are
+unfortunately not in common use, might make it difficult for a novice
+programmer to understand the code without referring to the man page.Compatibility:
+a >>31). It does work on 64-bit Linux, because all
+functions are below 4GB.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/goren
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 hamaji
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/hamaji
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: bsoup
Location: JP
Name: Shinichiro
+Hamaji
Location: JPTo build:
+makeTo use:
+./hamaji < a_nonogram_fileTry:
+./try.shperl c2nono.pl hamaji.c | ./hamajiJudges’ remarks:
+.nono files and then compare your solution with this
+program!Author’s remarks:
+
+ 1
+ .
+ 112
+
+1 X
+1 X
+3 XXX
+
+1
+1
+3
+-
+1
+1.1
+2invalid”. This means the problem is indeed broken. For
+example, this happens for an input like
+2
+-
+2failed”. This failure can happen when the problem has more
+than one solution or the solver cannot solve the input problem. Here is
+an example input of the former:
+1
+1
+-
+1
+1
+ 11
+
+1 X
+1 X
+ 11
+
+1 X
+1 XDetail
+
+
+Obfuscation
+Portability
+long long. GCC’s -ansi -pedantic check should
+pass:cc -ansi -pedantic -std=c99 hamaji.cscanf(3) differs on linux and
+mac, but this program supports both semantics.sizeof(int),
+sizeof(void*), ASCII, memory layout, undefined evaluation
+order (e.g., a[i++]=i), etc. This program won’t work if the
+size of long long literal is less than 8. By grepping the
+source code of gccgrep LONG_LONG_TYPE_SIZE gcc/config/*/*A few more things
+perl c2nono.pl hamaji.c | ./hamajiCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/hamaji
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 hou
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/hou
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Qiming HOU
+Location: CNTo build:
+makeTo use:
+./hou 'expression'Try:
+./try.shJudges’ remarks:
+./hou '1+2*3'
+./hou '(1+2)*3'+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+Self documenting source
+The ASCII art is valid C
+code
+The only
+multi-byte strings are format strings
+Example input and output
+in the source
+The button layout
+Input parsing
+Author’s remarks:
+Obfuscations
+
+
+printf(3)/sscanf(3) format strings, even after
+preprocessing. No string-encoded lookup table is used.Portability
+
+
+argv to point to writable memory.
+It doesn’t require the actual argv strings to be writable,
+though.%e style numbers like
+1e-4.Spoilers
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/hou
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 konno
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/konno
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Taketo Konno
+Location: JPTo build:
+makeTo use:
+./konno lower_case_wordTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Limitation
+Obfuscation
+
+
+for is not used.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/konno
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 richards
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/richards
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Gregor
+Richards
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: doesn't work with some platforms - please help us fixTo use:
+./richardsTry:
+echo '10 9 8 7 6 5 4 3 2 1*p*p*p*p*p*p*p*p*p' | ./richards
+echo '64 256 128 p/p*p' | ./richardsJudges’ remarks:
+Worst Abuse of the Rules).
+Well, this one does it (expression calculation, that is, not the rule
+abuse) in a different way. The author claims that his calculator does
+just-in-time compilation. What would you do to prove or disprove his
+claim without attempting to unravel the source?Author’s remarks:
+sizeof(int)-sized
+integers). It only implements the commands +,
+-, *, /, p (only for
+numbers), register stacks, macros and comparisons. Wow, you’d think I
+could’ve done better in 2K of code.
+
+alloca.h to
+use alloca, use the compile flag -DAH.mmap(), use the compile
+flag -DNM.memcpy(),
+isdigit(), atoi(), calloc(),
+malloc() and alloca() if you didn’t use
+-DAH.
+
while (a = b)
+(assignments as a condition).main(), even though it’s
+declared to return int.
+
+
+
+-DNM -DAH -fno-stack-checkCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2011/richards
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 toledo
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/toledo
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Oscar Toledo
+G.
Location: MXTo build:
+makeTo use:
+./toledoAlternate code:
+Alternate build:
+FIRE, FORWARD, BACKWARD,
+LEFT, RIGHT, WIDTH and
+HEIGHT. Here are the defaults:
+FIRE= XK_BackSpace:XK_Tab
+FORWARD= XK_Up:XK_w
+BACKWARD= XK_Down:XK_s
+LEFT= XK_Left:XK_a
+RIGHT= XK_Right:XK_d
+WIDTH= 512
+HEIGHT= 288LEFT and RIGHT:make clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a altWIDTH and
+HEIGHT which have an arbitrarily selected lower limit as
+well as the default values.player2:player1 (yes, player 2 comes first!).Judges’ remarks:
+A, B, C,
+D and E macros at compilation.#include "layer.c"Author’s remarks:
+
+ /=========\\
+ \==\ /==/ ||
+ || || /====\ |\/=\ || //==\ ==\ |=\
+ || || || || || || // || =| | |
+ || || //===| || || ||=// \\=\\ ==/ |=/
+ || || || || || || || \\ || User's
+ \===/ \\==// || || || \\ \==// Manual
+Trick: You can fire faster if they explode on anything.
+Believe it or not, it has strategy!battleplayground is surrounded by mountains and
+each level is filled with random obstacles (pyramids and cubes).
+
+
+
+PARENTAL ADVISORY WARNING:
+PLATFORMS TESTED:
+
+
+COMPLETE FEATURE SET:
+
+
+FEATURES THAT
+PROGRAMMERS WILL FIND APPEALING:
+
+
+M and N (see the alternate code).OBFUSCATION TRICKS:
+
+
++++, +- and *+
+undocumented C operators :P
+
+ ....,,,,---++++++--,,..\
+ .,,,....... .$@@@@@@@@@@@@$$@@@@@@@@@@@@@@#+\
+ @@@@@###@@@@$$$@@@@$$$@@@-......-@+......,,,,,,##\
+ =++==++++++++=@@$==#$$$$$---,,,,@@@,,,,,,-------@@,..........,,.\
+ ,===#$$$$$$###$####=======@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=##$@@@@@@@@.
+ +@,,++++++++=+=========++++===++++++++++-+++@@-,,,,,,,,---+++=++++--,,... @.
+ .@. .......,,,,-----++=@=++==@$=+--,,... @.
+ $# S P O I L E R .,,-#@--,,,@$..... @.
+ .@ ..,--+==++-,,,,.,,,,=@+++++====+++++---,,,....@.
+ @+ ..,,-+++++++-,,.. @. ....,,,,,---+@@\
+ ,@ ..,--+++=+++,,.. $# .==+\
+ @#--++==++-,,.. ,@ S P O I L E R .==+\
+ ,#@@$+,,. @. ==+\
+ .,,+++++,,. S P O I L E R $= +=+\
+ ..,-==++-,. ,@ ---\
+ .,-+=+++,.. @. .++-\
+ .,,++=++-,. @+ ==+\
+ .,-++==+-,. +@ ==+\
+ ..,+++=+-,.. .@. +=+\
+ .,-+++++,@@==
+THE HISTORY OF THIS PROGRAM:
+
+
+K() - 3D transformations() - Renderingb() - Line color selectionG() - Explosion animationg() - Moves 3D object backward and forwardF() - Collision detectionT() - Core (also known as main loop :D)main() - Initialization and ‘uncruncher’, what a common
+name!; C programs should start in the cool() function :).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/toledo
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 vik
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/vik
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel Vik
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./vik file.mod > audio_file.rawTry:
+./vik randowan.mod | mplayer -demuxer rawaudio -
+./vik mad_world.mod | mplayer -demuxer rawaudio -./vik file.mod > file.raw; ./raw2wav file.raw > file.wavAlternate code:
+Alternate build:
+make is similar enough try:make altAlternate use:
+vik.alt as you would vik above.Judges’ remarks:
+cc -S vik.cvik.s. On some
+platforms the assembly file is about 128MB in size!Author’s remarks:
+Introduction
+Features
+
+
+Songs
+
+
+Build
+gcc -o vik vik.cUsage
+Convert MOD
+file to raw 44.1kHz stereo audio file
+./vik mad_world.mod > audio_file.rawListen to the MOD
+file (streaming to mplayer)
+./vik randowan.mod | mplayer -demuxer rawaudio -- as it makes mplayer read from
+stdin.)Obfuscation
+~1.2 which means that there are around 2500 characters of
+code carrying information, yet there are only 2037 IOCCC characters of
+actual code. Most of the additional characters are encoded with
+non-counting characters in the frequency table. But there are also
+~50 or so white space characters spread out through the
+source code that carry information.?: operator (sigh)
+mainly to save space, but also to leverage the comma operator and
+precedence more efficiently.Portability
+stdout._setmode(_fileno(stdout), 0x8000);Limitations
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/vik
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2011 zucker
+
+
-
+ The International Obfuscated C Code Contest
+ 2011/zucker
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Matt Zucker
+Location: USTo build:
+makeTo use:
+./zucker > image.ppmTry:
+./zucker "Hello\!\!\!" > hello.ppm
+./zucker faster\! -preview > image2.ppmAlternate code:
+_setmode() and
+_fileno() to set binary mode on stdout which
+the author noted would be necessary for systems that distinguish binary
+and text.Alternate build:
+make altAlternate use:
+zucker.alt as you would zucker
+above.Alternate try:
+zucker.alt instead of zucker above.Judges’ remarks:
+Author’s remarks:
+An image generator
+What it does:
+./zucker > ioccc2011.ppmPreview.app works well; otherwise ImageMagick and/or GraphicsMagick are both
+capable of displaying Netpbm files, and are available on multiple
+platforms.open ioccc2021.ppmconvert ioccc2011.ppm ioccc2011.pngioccc2011.png in your viewer of
+choice.gm convert ioccc2011.ppm ioccc2011.pngioccc2011.png in your viewer of
+choice../zucker "your text" > image.ppm-preview to the command line arguments,
+like so:./zucker faster\! -preview > image.ppmmain() (the provided alternate version will set binary mode on
+stdout in Windows). An ASCII platform is assumed.Pedagogical value:
+
+
+char, float, int,
+typedef, struct, for, and
+return. More difficult concepts such as void,
+if, switch, and while are
+eschewed for simplicity’s sake.putchar(3), cos(3), sin(3),
+atan2(3), sqrt(3), and
+pow(3).Further details (contains
+spoilers):
+X is used both as the number 40 and as the
+ASCII character '('. Maintainability is hindered due to
+hardcoding several aspects of the program in multiple locations. As an
+example, it is impossible to modify either the image width or height
+without changing the source in at least three different places,
+including inside the large string literal J.for loops. The comma
+operator is used to get as much mileage as possible out of statements
+inside of loop declarations. Between for loops, the comma
+operator, and the ternary operator, it was possible to avoid
+if and while altogether.float to int) is needed, the program instead
+simply assigns to a free variable of the desired type instead. Both the
+array[index] and index[array] notations are
+used interchangeably throughout the program.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2011/zucker
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 blakely
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/blakely
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Philip
+Blakely
Location: GBTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./blakely "RPN formula" resolution > output.gifTry:
+./blakely "xx*yy*+" 64 > paraboloid.gif
+
+./blakely 9 32 > empty.gif
+
+time ./blakely 0 250 > flat.gifJudges’ remarks:
+Author’s remarks:
+Remarks
+x and y is
+specified on the command-line with the required resolution, and an
+animated GIF showing a fly-around of the resulting surface is output to
+stdout.Usage
+./blakely xy* 32 > pic.gif
++, -, *, / - usual arithmetic operations
+^ - Exponentiation; valid for constant exponent only
+s - sin
+c - cos
+0-9 - single digit integers
+d - duplicate number on stack
+t - transpose top two elements on stack
+x - x coordinate value
+y - y coordinate value23/
+is two-thirds, rather than 0.-1 <= x,y <= 1
+and for best results, the generated z value should lie
+between -1 and 1.Examples
+N, and more complex expressions take longer to
+compute. For example, increasing the resolution of
+ripple.gif to 250 took ~35 minutes to render on an i7
+processor../blakely xy* 32 > saddle.gif
+
+./blakely xx*yy*1++d5*ct/ 64 > ripple.gifAlgorithm
+x and
+y must be tracked. This is done using an obvious
+stack-based approach.Obfuscations
+#defines. The characters output for the GIF format are
+generated in myriad and wonderful ways, making use of XOR, return values
+from putchar(), and odd expressions. The layout is in the
+form of X Y Z.Limitations
+main() (who uses exit codes anyway?), but clang
+3.1 emits no warnings.Questions
+
+
+b[0]?NETSCAPE and GIF
+hidden in the source?Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/blakely
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 deckmyn
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/deckmyn
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Alex Deckmyn
+Location: BETo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./deckmyn "$(cat deckmyn.c)" "$(cat musicfile.txt)" > sheetmusic.pbmTry:
+./try.shJudges’ remarks:
+Historical remarks:
+$(..) construct. This is not done in the author’s remarks,
+however.Author’s remarks:
+Example use
+./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbmopen greensleeves.pbm./deckmyn "`cat deckmyn.c`" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbmopen short_bass.pbmDescription
+.pbm) of music based on ASCII input. A full manual is
+added as a separate file. Some musical examples
+are also included."`` cat deckmyn.c
+``".Internals
+main(). The only available memory space is from the command
+line arguments and count (argv and argc).
+Parts of argv are cast as int when values
+under 0 or beyond 127 are expected.stdout, byte by byte, from the top left to the bottom right
+pixel.LIMITATIONS
+argv are used for various
+purposes. Therefore, the program name (default deckmyn)
+must be at least 4 characters long, including possibly the
+path. This, along with the ending '\0', gives minimum 5
+bytes of useful memory space. Otherwise, the program may attempt to
+write outside the string.char (signed or
+unsigned) and two’s complement negatives.char as counters for e.g. the
+number of music staves are minor. 127 staves to a page is rather a
+lot.Obfuscations
+int using a
+macro.
+
+argv/argc as memory
+locations is a matter of reducing the memory footprint. Again, it is not
+an obfuscation.c and C, is merely a matter of conforming to
+the standard WYSIWYG
+paradigm common in commercial notation programs (’What You
+C is What You Get). So once again it is not an obfuscation.
+Anyway, it’s a C coding contest, right?argv are
+addressed is a matter of maintaining a diversified code base. It is
+therefore not… Oh all right.printf(3)
+call including a 800+ character nested conditional expression.printf() is also used for its return value.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/deckmyn
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 dlowe
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/dlowe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: J. David Lowe
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./dloweTry:
+./dloweJudges’ remarks:
+-pedantic-errors in the Makefile.Author’s remarks:
+Conway’s Game of DEATH
+Story
+q any time to quit.Features
+
+
+Limitations
+
+
+splash.d, dead.d and
+sprites.d).Wish List
+
+
+Hosts Tested
+
+
+Obfuscations
+struct whose members
+have the same names as global variables.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/dlowe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 endoh1
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/endoh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPmakeTo use:
+./endoh1 < configuration.txtTry:
+./endoh1 < endoh1.c
+
+./endoh1 < pour-out.txt
+
+./endoh1 < fountain.txtendoh1_color as you would
+endoh1 above. make will compile this by
+default.Alternate code:
+Alternate build:
+make alt alt2alt2 is only necessary if you wish to compile the
+deobfuscated version but it is equivalent in function to the original
+entry, endoh1.c.alt versions a default time of 10 seconds is set
+as an alarm so that one can more easily go through the list of files to
+see them all in succession for fun. That is controlled by the variable
+A; 0 disables it.make clobber SLEEP=N altN is number or the letter I.S, the
+sleep time passed to usleep(3), too much.G,
+P and/or V macros, respectively, with the same
+caveat about numbers for S above. For instance if you wish
+to change the viscosity and pressure factors but leave the other macros
+alone:make clobber VISCOSITY=X PRESSURE=Y altX and Y are numbers or the letter
+I and which are, respectively, the viscosity and pressure
+factors.I which would
+prevent the author’s remarks about it from being done.A to 0:make clobber TIMER=0 alt12321 to 50000:make clobber SLEEP=50000 altendoh1.alt and
+endoh1_color.alt as you would endoh1
+above.12321 to 9999:make clobber SLEEP=9999 alt2endoh1.alt and
+endoh1_color.alt as you would endoh1
+above.G,
+P and/or V. For instance:make clobber GRAVITY=5 PRESSURE=5 VISCOSITY=5 altmake clobber GRAVITY=I altAlternate use:
+endoh1.alt, endoh1_color.alt and
+endoh1.alt2 as you would endoh1 and
+endoh1_color above.Alternate try:
+./try.alt.shI.Judges’ remarks:
+Author’s remarks:
+Synopsis
+-DG=1 -DP=4 -DV=8 and
+make your terminal window larger than 80 x 25.cc endoh1.c -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -o endoh1 -lm
+./endoh1 < endoh1.c
+./endoh1 < logo.txt
+./endoh1 < column.txt
+./endoh1 < pour-out.txt
+./endoh1 < tanada.txtWhat it is
+
+ ,___. ,. ,. ,. ,___. ,. ,. ,.
+ |/--' || `' || |/--' `' || |\_.
+ |\__. || ,. ,. ,. ,__/| |\__. ,. ,____. ,. ,. || ,_. |/-' ,_. ,__.
+ |/--' || || || || |/-\| `--\| || |/\/\| || || || ,/-\. || ,/-\. |/-\.
+ || || `\_/| || |\_/| ,__/| || |||||| `\_/| || `\_/\.`\_. `\_/' || `'
+ `' `' `--' `' `---' `---' `' `'`'`' `--' `' `-'`' `-' `-' `'
+
+
+ ,.,. ,.,.
+ ,/\/\. ,. ,. ,. ,/\/\. ,. ,. ,__.
+ |||#/' || `' ,_.|| |||#/' `',_.,__. || ||\\. ,.
+ |||#\. || ,. ,. ,.,/#||| |\//\. ,.|#||##| ,. ,. || ,.,. |\/-' ,.,. ,.|\.
+ |\/--' ||,/\.|| |||#/\/| `\#||| |||#||/\|,/\.|| ||,/'`\.|#| ,/'`\.|\/-\.
+ `\| ||`\#||| |||#||\| ,//\/| ||`\|||||`\#||| ||`\.,/\/\|,.`\.,/'`\| `'
+ `' `' `-'`' `'`-'`-' `-'`-' `' `'`'`' `-'`' `' `'`--'`'`' `'`' `'
+
+
+ ,_.,_. ,. ,. ,. ,_.,_. ,. ,. ,.
+ |#||#| || `' || |#||#| `' || ||,_.
+ ||\/#| ||,. ,. ,.,_.,/| |\||#| ,.,_.,__.,. ,. || ,.,. |||#| ,.,. ,.,_.
+ |||##| |||| || |||#||#| |#||#| |||#||##||| || ||,/||\.||`-',/||\.|||#\.
+ ||`--' ||`\_.|| |||\||#| |#||#| ||||'||\|`\_.|| ||`\||#|`\.,.`\||/'||`--'
+ `' `' |#||| `'|#||#| |#||#| `'`' `'`' |#||| `' |||/' |||| |||| `'
+ `-'`' `-'`-' `-'`-' `-'`' `'`' `'`' `'`'
+
+#
+represents a “wall particle” (a particle with a fixed position), and any
+other non-space characters represent free particles.-DG=1 -DP=4 -DV=8 represent,
+respectively, the factor of gravity, pressure, and viscosity. By
+changing their values, you can see different fluid behavior.Portability
+complex
+types and one-line comments. It also uses usleep(3), which
+may require -D_BSD_SOURCE or so to build with no warning.
+Under these conditions, it should be portable. At least, recent
+compilers with -std=c99 -Wall -W -Wextra -pedantic say
+nothing.gcc -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -std=c99 -Wall -W -Wextra -pedantic endoh1.c
+
+clang -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -std=c99 -Wall -W -Wextra -pedantic endoh1.cI (complex’s imaginary unit), but I bet
+this is cygwin’s issue; it is surely a C99 feature.Obfuscation w/ Spoiler
+#include)’s # serve as walls.double complex to represent any 2D
+vector. But, note that the x-axis and y-axis
+are swapped (real axis = y-axis, imaginary axis = x-axis). The purpose
+of swapping is not only obfuscation, but also short coding: for example,
+to add gravity to total force, force += G suffices, rather
+than force += G*I.-DG=I)double complex a[] contain
+information of one particle: position, wall-flag, density, force, and
+velocity, in turn.G, P, and V as a
+guide to find the calculation code of gravity, pressure, and viscosity
+forces.Notes about Additional Files
+*.txt files are from the judges.Acknowledgments
+ordered suggested creating a color
+version after the contest.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/endoh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 endoh2
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/endoh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./endoh2 > pi.c
+gcc -o pi pi.c
+./pi > 314.c./endoh2 e > e.c\
+gcc -o e e.c
+./e > 271.cTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+What it is
+pi. Then, the generated program:
+
+e
+to the first program, the generated one will compute Napier’s
+constant) rather than pi.Obfuscation
+314*.c and
+271*.c, are almost the same except their shape and constant
+computational part. I tailored the common part to parse in both shapes
+(3.14... and 2.71...), by tweaking the
+computational order and adding meaningless code fragments.0 –
+9), as just 20 bytes: G1%xJ{;Q7wunmuGuu%uu. We
+can decode character n as
+275*s[n+10] - 8*s[n] - 8. I solved the system of Bézout’s
+identity to find the magic string, with the aid of a brute force.
+See find-font-table.rb in detail.#include is a part of
+ASCII-art with comments padded.Portability
+main(). In fact, recent compilers with
+-std=c99 -Wall -W -Wextra -pedantic would say nothing.gcc -std=c99 -Wall -W -Wextra -pedantic spigot.c
+clang -std=c99 -Wall -W -Wextra -pedantic spigot.cSynopsis
+cc endoh2.c -o endoh2
+
+./endoh2 > pi.c
+cat pi.c
+
+cc pi.c -o pi ; ./pi > 314.c ; cat 314.c
+cc 314.c -o 314 ; ./314 > 3141.c ; cat 3141.c
+cc 3141.c -o 3141 ; ./3141 > 31415.c ; cat 31415.c
+cc 31415.c -o 31415 ; ./31415 > 314159.c ; cat 314159.c
+cc 314159.c -o 314159 ; ./314159 > 3141592.c ; cat 3141592.c
+etc...
+
+./endoh2 e > e.c
+cat e.c
+
+cc e.c -o e ; ./e > 271.c ; cat 271.c
+cc 271.c -o 271 ; ./271 > 2718.c ; cat 2718.c
+cc 2718.c -o 2718 ; ./2718 > 27182.c ; cat 27182.c
+cc 27182.c -o 27182 ; ./27182 > 271828.c ; cat 271828.c
+cc 271828.c -o 271828 ; ./271828 > 2718281.c ; cat 2718281.c
+etc...make everything for the process (with no
+cat).-std=c99 option is given.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/endoh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 grothe
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/grothe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Aaron Grothe
+Location: US
+
Name: David
+Madore
Location: FRTo build:
+makeTo use:
+M people with
+N+1 needed to reconstruct:./grothe -secret 1-/dev/urandom 2-/dev/urandom ... \
+ N-/dev/urandom 1+shared1 2+shared2 ... M+sharedMN+1 or more shared files with their proper numbers):./grothe I-sharedI J-sharedJ K-sharedK ... +reconstructedTry:
+./grothe -grothe.c 1+grothe.c.1 2+grothe.c.2
+
+./grothe -cookie_recipe.txt 1-/dev/urandom 2-/dev/urandom 1+cookie_piece1.dat 2+cookie_piece2.dat 3+cookie_piece3.dat 4+cookie_piece4.dat
+
+./grothe 1-cookie_piece1.dat 2-cookie_piece2.dat 4-cookie_piece4.dat 4+cookie_recipe_restore.txtJudges’ remarks:
+atoi(3) conversion.Author’s remarks:
+Description
+N parts where it will take M parts to
+recreate the original file. E.g. you can split the secret recipe for
+Crystal Pepsi into 3 parts and require two of them be available to
+extract the original recipe.Usage
+
+
+Example usage
+./grothe \
+ -cookie_recipe.txt\
+ 1-/dev/urandom 2-/dev/urandom\
+ 1+cookie_piece1.dat 2+cookie_piece2.dat 3+cookie_piece3.dat 4+cookie_piece4.dat./grothe \
+ 1-cookie_piece1.dat 2-cookie_piece2.dat 4-cookie_piece4.dat
+ +cookie_recipe_restore.txtLimitations
+Obfuscations
+
+
+i+=1, i=i+1, i++ and
+++i are all used in the program. The mark of true code
+buggery: “A foolish consistency is the hobgoblin of little minds.” - Ralph Waldo
+Emerson-Wshadow should probably be a part of -Wall in
+gcc.array_index[array_name] instead of
+array_name[array_index] in several places. Still don’t know
+why C continues to allow this (error strings are encoded with offsets
+that are also used to select them in the case statement. All strings are
+located in one function for easy localization).#defines from stdio.h,
+stdlib.h for values _STDIO_H and
+EXIT_SUCCESS used to represent 1 and 0 respectively in the
+program.References
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/grothe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 hamano
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/hamano
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Tsukasa
+Hamano
Location: JPTo build:
+makeTo use:
+./hamano < textfile > output.pdfTry:
+./try.shhint.pdf with a PDF
+reader like acroread hint.pdf or
+evince hint.pdf. With macOS you can do
+open hint.pdf which by default will open
+Preview.app. You may of course use your pdf viewer to open
+the file directly instead.echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf
+cc -Wno-implicit-function-declaration -xc hello.pdf -o hello2
+./hello2 | gcc -Wno-implicit-function-declaration -xc - -o ./hello3
+./hello3Judges’ remarks:
+Author’s remarks:
+
+
+Obfuscations
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/hamano
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 hou
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/hou
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Qiming HOU
+Location: CNTo build:
+makeTo use:
+./hou syntax-file file-to-processTry:
+./try.shremarks.htm file in your web browser.Try (Windows):
+
+copy header.htm hou.htm /y
+hou html.txt hou.c >> hou.htm
+start hou.htmJudges’ remarks:
+2321237?Author’s remarks:
+Disclaimer
+Syntax files
+%s. Other % characters in the format
+string must be escaped with another %. The space character
+can be used in the regular expression by escaping it with
+[] or "".
+() [] * + ? | ""
+ "char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;./hou ansi.txt ansi.txt
+perl patho.pl < ansi.txtLimitations
+
+
+\n and it doesn’t
+work in [].M.| doesn’t obey precedence rules and some
+extra ()s may be required.Why obfuscated
+#defines and quite a number of
+unconventionally written constants. While the preprocessor may remove
+the former, the later would remain regardless of beautification and
+preprocessing.References
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+
+Inventory for
+2012/hou
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 kang
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/kang
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Seonghoon
+Kang
Location: KRTo build:
+makeTo use:
+echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kangTry:
+./try.sh # try various languages
+
+./en.sh # English 0 through 13
+
+./de.sh # German 0 through 13 with both umlauts and without (additional 'e')u or o in a string in
+the source code and yet it gets uno right?Alternate code:
+Alternate build:
+make altAlternate use:
+echo vier | ./kang.alt
+echo uno | ./kang.altAlternate try:
+./de.alt.sh # German 0 through 13 both with and without umlaut
+./en.alt.sh # English 0 through 13f to
+v?Judges’ remarks:
+echo f hundr|./kangecho hundr|./kangAuthor’s remarks:
+Synopsis
+forty-two)
+and writes a corresponding decimal number (e.g. 42). Too
+long for one-liners, alas, but it still qualifies as a short
+program as it has less than 0x100 bytes.
+
+zero.forty-two and
+forty two are same. So does period or comma.TWO,
+Two, two are the same.one and a are interchangeable:
+one hundred and a hundred are the same.and is optional: one hundred twenty-three
+and one hundred and twenty-three are the same.billion is
+109 and trillion is 1012.
+
+hundred, thousand etc. do not
+work.one million million does not work. Get used to
+one trillion!Requirements
+
+
+int main(int, int) should be accepted by
+the linker. (Original version only).char should be at least 1 byte long (as dictated by the
+standard), int should be at least 32 bits long,
+long long should be at least 64 bits long.char should wrap around, if
+your char is unsigned.EOF even
+if it does not equal -1 (it has to be negative per the
+standard but not necessarily -1) and both
+signed char and unsigned char, for example.
+Furthermore it is endian-independent.Obfuscations (SPOILERS!)
+
+
+main() function are reused as normal
+variables.?: ternary
+operator and || short-circuiting operator.for loops and nothing
+else.~-a instead of
+a-1, ~a?...:... instead of
+a!=-1?...:..., etc.,) for multiple statements. The number
+of them is minimized, however, as it is too easy to (ab)use them.n["string"] instead of "string"[n]. Both
+are fine for this program but I went to the former just for fun.
+
+"1+DIY/.K430x9G(kC[" is 18 bytes long, but
+actually 19 bytes including the final NUL character are used.two hundred and three, it actually writes
+0x203 as hexadecimal.n) have dual uses.main-er within it!
+zero one tw- th(i)r- fo(u)r- fi- six-
+seven- eigh- nin- ten eleven twelve
+hundred(s) thousand(s) million(s) billion(s) trillion(s)
+a and -teen -ty
+r n tw- tr- fr- f- s-
+sn- g- nn- tn ln twl
+nr(s) tsan(s) lln(s) blln(s) trlln(s)
+a an -tn -tytrl
+instead of trlln). This is also handy for ignoring plurals.
+But that would make it so that the table does not fit in the printable
+byte—112 is already almost 27!a,
+b and g) are interpreted as sequences of two
+characters (ny, nn and nw
+respectively). Asides from a smaller lookup table, it has many good
+consequences:
+
+a and and share the common prefix,
+ny, and can be discarded altogether. Note that
+ny itself does not appear from other entries.thousand is interpreted as tsan, which is
+equivalent to tfyn in the octal scheme. As it is the only
+entry with tf prefix, it can be shorten by one
+character.Acknowledgement
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/kang
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 konno
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/konno
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Taketo Konno
+Location: JPTo build:
+makeTo use:
+./konno NTry:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+konno.alt as you would konno above.Judges’ remarks:
+Author’s remarks:
+Remarks
+./konno 30
+./konno 90
+./konno 102
+./konno 109
+./konno 165Obfuscation
+7&O<<!o>>!o+297&O>>29Limitation
+int is 4.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/konno
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 omoikane
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/omoikane
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+make/dev/urandom file. There
+is also a version that should theoretically work with Windows which
+distinguishes binary and text. See alternate
+code below.To use:
+./nyaruko [seed.txt] < original.bin > output.c
+bash output.c > key.c
+perl output.c > data.c
+
+cat key.c data.c > output.c
+
+cc output.c -o output
+./output > regenerated.bin/dev/urandom then you
+should specify a seed file or use the alternate version which reads in the compiled
+binary itself.Try:
+./try.shAlternate code:
+/dev/urandom, which is the default for the original entry.
+This is useful if your system does not have a /dev/urandom
+file and you do not want to specify an extra file. The second alternate
+version is like the first except it also should theoretically work with
+Windows, setting binary mode on stdin and
+stdout.Alternate build:
+make altmake alt2Alternate use:
+nyaruko.alt or nyaruko.alt2 as you
+would nyaruko above.Alternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+Usage
+Nyaruko is a binary to text filter. Given some input on
+stdin, Nyaruko will produce C code that
+reproduces this input on stdout:./nyaruko < original.bin > output.c
+gcc output.c -o output
+./output > regenerated.binbash output.c > key.c
+perl output.c > data.cdata.c still compiles, but produces a
+different message on stdout instead of the original input.
+This message is a hint to why the code is formatted the way it is.cat key.c data.c > output.c
+cat data.c key.c > output.cNyaruko generates a unique random key for
+every message, using /dev/urandom as the seed. If given an
+extra command line argument, Nyaruko will seed using that
+file instead of /dev/urandom:./nyaruko seed.txt < input.bin > output.c/dev/urandom, users should always specify this extra seed
+argument to avoid indeterministic keys, or else use the alternate
+version which will by default read the compiled alternate version
+itself, which might or might not be deterministic, depending on where
+and how it’s used.Features
+Nyaruko more obfuscated
+than usual programs:
+
+Nyaruko recycles variables and buffers to reduce
+internal state. The variable names are also carefully chosen for
+mixed-case madness.Nyaruko employs some preprocessor magic to share much
+of the same code and state between the encoder and decoder, and to
+increase occurrences of smileys ;)
+
+uuencode for files larger than ~13K, and better than
+base64 for files larger than 20K.Nyarlathotep, the Crawling Chaos. The most obvious
+thing to do with chaos is to make a random number generator, and the
+most obvious thing to do with a random number generator is to make one-time-pads for
+encryption.Compatibility
+Nyaruko has these environment dependencies:
+
+sizeof(unsigned int) == 4.Nyaruko has been to verified to work with these
+compiler/OS combinations:
+
+stdin and stdout are
+not opened in binary mode by default, this means Nyaruko
+may not faithfully encode files on MingW.Extra files
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2012/omoikane
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 tromp
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/tromp
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: John Tromp
+Location: USTo build:
+make all # On a 64-bit machine (default)
+
+make tromp32 # On a 32-bit machineBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./tromp [-b]./tromp32 as you would ./tromp if on a
+32-bit machine.To use:
+cat ascii-prog.blc data | ./tromp -b
+cat binary-prog.Blc data | ./trompTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+nth enclosing lambda (denoted n in
+so-called De
+Bruijn notation) as 1^{n}0. That’s all there is to BLC!S = \x \y \z (x z) (y z), with De Bruijn
+notation \ \ \ (3 1) (2 1), is
+00 00 00 01 01 1110 10 01 110 10.#defines and
+#includes, and compiles to a (stripped) executable of under
+6K in size.0
+and 1 for output.
+0: OK; result is a finite list
+5: Out of term space
+6: Out of memory
+1,2,3,4,8,9: result not in list form-DA.A half byte
+cat\x x (\ 1
+in De Bruijn
+notation) which is the identity function. When its encoding
+0010 is fed into the universal machine, it will simply copy
+the input to the output (well, not that simply, since each byte is
+smashed to bits and rebuilt from scratch). Voila: a half byte cat:$ echo " Hello, world" | ./tromp
+Hello, world/) will do, e.g.:$ echo "*Hello, world" | ./tromp
+Hello, worldBad programs
+echo -n "U" | ./trompn can only appear within at
+least n enclosing lambdas. For instance, here the term
+\ 5 is not closed, causing the interpreter to crash when
+looking into a null-pointer environment:echo ">Hello, world" | ./trompA Self Interpreter
+
+ 01010001
+ 10100000
+ 00010101
+ 10000000
+ 00011110
+ 00010111
+ 11100111
+ 10000101
+ 11001111
+ 000000111
+ 10000101101
+ 1011100111110
+ 000111110000101
+ 11101001 11010010
+ 11001110 00011011
+ 00001011 11100001
+ 11110000 11100110
+ 11110111 11001111
+ 01110110 00011001
+ 00011010 00011010
+ 19468
+ 05580
+ 05f00
+ bfe5f
+ 85f3f
+ 03c2d
+ b9fc3f8
+ 5e9d65e5f
+ 0decb f0fc3
+ 9befe 185f7
+ 0b7fb 00cf6
+ 7bb03 91a1a
+$ (cat uni8.Blc; echo " Ni hao") | ./tromp
+Ni haoA prime number sieve
+
+ 000100011001100101000110100
+ 000000101100000100100010101
+ 11110111 101001000
+ 11010000 111001101
+ 000000000010110111001110011
+ 11111011110000000011111001
+ 10111000
+ 00010110
+ 0000110110
+nth bit in the output indicates whether n is
+prime:$ cat primes.blc | ./tromp -b | head -c 70
+0011010100010100010100010000010100000100010100010000010000010100000100oddindices.Blc, which will print the indices of all odd
+characters (with LSB = 1)
+separated by a given character:
+$ (cat oddindices.Blc; echo -n " "; cat primes.blc | ./tromp -b) | ./tromp | head -c 70
+2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97A Space filling program
+hilbert.Blc, at 143 bytes, is a very twisty
+“one-liner” (shown in hexadecimal):
+ 1818181 8111154 6806041 55ff041
+ 9d f9 de 16 ff fe 5f 3f
+ ef f615ff9 46 84 058117e 05
+ cb fe bc bf
+ ee86cb9 4681600 5c0bfac bfbf71a
+ 85 e0 5c f4
+ 14d5fe0 8180b048d0800e078 016445f
+ fe 5f
+ f7 ffffe5fff2fc 02f7ad97f5bf ff
+ ff bf ff ca af ff
+ 7817ffa df76695 4680601 57f7e16
+ 05 c1
+ 3fe80b2 2c18581 bfe5c10 42ff805
+ de ec 06 c2 c0 c0
+ 60 8191a00167fb cbcfdf65f7c0 a20n arbitrary characters of input, and draws a
+space filling Hilbert curve of
+order n:$ (cat hilbert.Blc; echo -n "1") | ./tromp
+ _
+| |
+
+$ (cat hilbert.Blc; echo -n "12") | ./tromp
+ _ _
+| |_| |
+|_ _|
+ _| |_
+
+$ (cat hilbert.Blc; echo -n "123") | ./tromp
+ _ _ _ _
+| |_| | | |_| |
+|_ _| |_ _|
+ _| |_____| |_
+| ___ ___ |
+|_| _| |_ |_|
+ _ |_ _| _
+| |___| |___| |
+
+$ (cat hilbert.Blc; echo -n "1234") | ./tromp
+ _ _ _ _ _ _ _ _
+| |_| | | |_| | | |_| | | |_| |
+|_ _| |_ _| |_ _| |_ _|
+ _| |_____| |_ _| |_____| |_
+| ___ ___ | | ___ ___ |
+|_| _| |_ |_| |_| _| |_ |_|
+ _ |_ _| _ _ |_ _| _
+| |___| |___| |_| |___| |___| |
+|_ ___ ___ ___ ___ _|
+ _| |_ |_| _| |_ |_| _| |_
+| _ | _ |_ _| _ | _ |
+|_| |_| | |___| |___| | |_| |_|
+ _ _ | ___ ___ | _ _
+| |_| | |_| _| |_ |_| | |_| |
+|_ _| _ |_ _| _ |_ _|
+ _| |___| |___| |___| |___| |_A Brainfuck
+interpreter
+
+$ od -t x4 bf.Blc
+0000000 01a15144 02d55584 223070b7 00f032ff
+0000020 7f85f9bf 956fe15e c0ee7d7f 006854e5
+0000040 fbfd5558 fd5745e0 b6f0fbeb 07d62ff0
+0000060 d7736fe1 c0bc14f1 1f2eff0b 17666fa1
+0000100 2fef5be8 ff13ffcf 2034cae1 0bd0c80a
+0000120 e51fee99 6a5a7fff ff0fff1f d0049d87
+0000140 db0500ab 3bb74023 b0c0cc28 10740e6c
+00001600, 1 and 4
+to distinguish among ,-.+<>][) followed by a
+], followed by the input for the Brainfuck program.
+$ more hw.bf
+++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.]
+$ cat bf.Blc hw.bf | ./tromp
+Hello World!bf.Blc is the exact same size
+as hw.bf.A BLC assembler
+$ echo "\f\x f (f (f x))" > three
+$ cat parse.Blc three | ./tromp
+000001110011100111010Converting between bits and
+bytes
+inflate.Blc and its inverse
+deflate.Blc allow us to translate between BLC and BLC8. If
+you assemble a byte oriented program, you’ll need to compact it into
+BLC8:echo "\a a ((\b b b) (\b \c \d \e d (b b) (\f f c e))) (\b \c c)" > reverse
+cat parse.Blc reverse | ./tromp > reverse.blc$ cat deflate.Blc reverse.blc | ./tromp > rev.Blc
+$ wc rev.Blc
+ 0 1 9 rev.Blc$ cat rev.Blc - | ./tromp
+Hello, world!
+^D
+!dlrow ,olleHSymbolic Lambda Calculus
+reduction
+symbolic.Blc shows individual reduction
+steps on symbolic lambda terms. Here it is used to show the calculation
+of 2^3 in Church numerals:$ echo "(\f\x f (f (f x))) (\f\x f (f x))" > threetwo
+$ cat parse.Blc threetwo | ./tromp > threetwo.blc
+$ cat symbolic.Blc threetwo.blc | ./tromp
+(\a \b a (a (a b))) (\a \b a (a b))
+\a (\b \c b (b c)) ((\b \c b (b c)) ((\b \c b (b c)) a))
+\a \b (\c \d c (c d)) ((\c \d c (c d)) a) ((\c \d c (c d)) ((\c \d c (c d)) a) b)
+\a \b (\c (\d \e d (d e)) a ((\d \e d (d e)) a c)) ((\c \d c (c d)) ((\c \d c (c d)) a) b)
+\a \b (\c \d c (c d)) a ((\c \d c (c d)) a ((\c \d c (c d)) ((\c \d c (c d)) a) b))
+\a \b (\c a (a c)) ((\c \d c (c d)) a ((\c \d c (c d)) ((\c \d c (c d)) a) b))
+\a \b a (a ((\c \d c (c d)) a ((\c \d c (c d)) ((\c \d c (c d)) a) b)))
+\a \b a (a ((\c a (a c)) ((\c \d c (c d)) ((\c \d c (c d)) a) b)))
+\a \b a (a (a (a ((\c \d c (c d)) ((\c \d c (c d)) a) b))))
+\a \b a (a (a (a ((\c (\d \e d (d e)) a ((\d \e d (d e)) a c)) b))))
+\a \b a (a (a (a ((\c \d c (c d)) a ((\c \d c (c d)) a b)))))
+\a \b a (a (a (a ((\c a (a c)) ((\c \d c (c d)) a b)))))
+\a \b a (a (a (a (a (a ((\c \d c (c d)) a b))))))
+\a \b a (a (a (a (a (a ((\c a (a c)) b))))))
+\a \b a (a (a (a (a (a (a (a b)))))))$ cat symbolic.Blc primes.blc | ./tromp | head -1
+\a (\b b (b ((\c c c) (\c \d \e e (\f \g g) ((\f c c f ((\g g g) (\g f (g g)))) (\f \g \h \i i g (h (d f))))) (\c \d \e b (e c))))) (\b \c c (\d \e d) b)cat symbolic.Blc primes.blc | ./tromp | head -16
+\a \b b (\c \d c) (\c c (\d \e d) (\d d (\e \f f) (\e e (\f \g g) ((\f (\g \h \i\a is for ignoring the rest of the input (to which
+the universal machine applies the decoded lambda term). The
+\b b (..) (...) is the list constructor, usually called
+cons, applied to a head (a list element) and a tail
+(another list). In this case the element is (\c \d c),
+which represents the boolean true, and which we use to represent a 0
+bit. This is the bit that says 0 is not prime. The next list element
+(following another cons) is (\d \e d). Another
+0 bit, this time saying that 1 is not prime. The third list element is
+(\e \f f), a 1 bit, confirming our suspicion that 2 is
+prime. As is the next number, according to (\f \g g). We
+can see that the tail after the first 4 elements is still subject to
+further reduction. The bit for number 4 will show up for the first time
+in line 30, as (\g \h g), or 0, as the result of zeroing
+out all multiples of the first prime, 2.Performance
+$ time cat primes.blc | ./tromp -b | head -c 210 > /dev/null
+real 0m0.043s
+$ time cat uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+real 0m0.191s
+$ time cat uni.blc uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+real 0m1.919s
+$ time cat uni.blc uni.blc uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+real 0m23.514s
+$ time cat uni.blc uni.blc uni.blc uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+real 4m52.700sObfuscation
+0, 1,
+2, 3 serve multiple purposes?u+m&1? do?Portability
+int and int *, causing many warnings;
+ note: expected 'int *' but argument is of type 'int'
+ warning: assignment from incompatible pointer type
+ warning: assignment makes integer from pointer without a cast
+ warning: assignment makes pointer from integer without a cast
+ warning: incompatible implicit declaration of built-in function 'calloc'
+ warning: incompatible implicit declaration of built-in function 'exit'
+ warning: passing argument 1 of 'd' makes pointer from integer without a cast
+ warning: passing argument 1 of 'p' makes pointer from integer without a cast
+ warning: pointer/integer type mismatch in conditional expressionread(2),
+write(2), exit(3) and calloc(3),
+the latter two incompatibly. 32 bit and 64 bit executables are separate
+Makefile targets, involving a change from
+int to long and from a hardcoded sizeof of 4
+to 8.How the program works
+Acknowledgements
+References
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/tromp
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 vik
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/vik
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel Vik
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./vik e base.png filename > encodedimg.png./vik e base.png SomeRandomText > encodedimg.png./vik d encodedimg.png./vik e base.png source.png > encodedimg.png./vik d encodedimg.png > restored.pngTry:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+vik.alt as you would vik above.Judges’ remarks:
+
+
+Author’s remarks:
+Introduction
+IDAT and IHDR
+chunks of the source image. Any additional chunks are copied into the
+resulting image.Bonus Extractor:
+./vik e ioccc.png chocolate.png > encodedimg.png
+./vik b encodedimg.png./vik e ioccc.png .+[.+] > encodedimg.png
+./vik b encodedimg.pngObfuscation
+main() function. main()
+is called recursively and quite extensively, but it gives the benefit
+that all invocations of the function have the same parameters,
+argv and argc. This really helps readability,
+as a programmer doesn’t need to remember several variable or function
+names. I also tried to reduce the number of keywords, and the program
+only has four for loops followed by a single
+return statement. There is a little bit of use of the
+ternary (?:) operator, but this is really there to keep the
+program as simple as possible.Portability
+stdout._setmode(_fileno(stdout), 0x8000);Limitations
+Extendability
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/vik
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2012 zeitak
+
+
-
+ The International Obfuscated C Code Contest
+ 2012/zeitak
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Adar Zeitak
+Location: ILTo build:
+makeTo use:
+./zeitak < file.cfile.c is the file to be checked for nesting
+errors. For example, you may try incorrect.c
+and the program itself.Try:
+make testAlternate code:
+Alternate build:
+make altAlternate use:
+zeitak.alt as you would zeitak
+above.Judges’ remarks:
+Author’s remarks:
+Nesting Errors Detector
+What does it do
+(,
+[, or { has a matching closing one and vice
+versa. It also checks that every " or ' is
+closed.Features
+
+
+printf(")");
+
+Mis-Features
+
+
+\") are ignored, so the following line
+will produce an error:printf("\"");Obfuscation
+
+
+stdio.?:
+operator).Additional obfuscations
+include:
+
+
+Compilation/Portability/Running
+Notes
+
+
+char to be one byte and
+pointers to be at least two bytes long.
+
Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2012/zeitak
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 birken
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/birken
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Michael
+Birken
Location: USTo build:
+make altTo use:
+./birken.alt < 17_columns_wide_paint_by_numbers_filereset to restore the
+terminal. This will clear the screen.Try:
+usleep(3). The
+default is 13500 but you can reconfigure it should you wish
+(see below)../try.alt.shmake clobber SLEEP=7500 altbirken.alt as above.SLEEP=3750. Doing this you might find the right value
+to your liking; use ctrl-c to terminate the program early but note that
+the terminal is likely to be messed up. In that case try:resetOriginal code:
+Original build:
+make allOriginal use:
+birken as you would birken.alt
+above.Original try:
+./try.shJudges’ remarks:
+ /* *\
+ /....Author’s remarks:
+About This Document
+*.txt, *.png and
+*.gif.Abstract
+Algorithm Overview
+




Single Square Emitters
+
J, T and L tetriminos are used
+interchangeably within each pattern to produce the protruding square at
+the bottom. The algorithm assigns those tetriminos to the 3 colors
+present in the sprite. The remaining tetriminos are assigned arbitrary
+colors. And, all the colors remain constant during gameplay.
2 + 16 + 2 = 20 squares. However, it turns out
+that 20 is too small.I tetriminos, are
+unsupported.
S and Z
+tetriminos. But,
+that will always leave holes in the upper row.
20 * 3 + 1 = 61, which is not evenly divisible by 4 and
+hence not constructible out of tetriminos. However,
+a width of 21 yields 21 * 3 + 1 = 64, which can be built
+with 16 tetriminos. That width actually enables the algorithm to render
+sprites up to 17 pixels wide.J, T and L tetriminos are used
+interchangeably to produce the emitted square and 3 squares of those
+tetriminos contribute to the row above it, there are
+21 - 3 + 1 = 19 single square emitting patterns. However,
+due to mirror symmetry, there are really only 10 patterns. Clearing 3
+rows works for the majority of them. But, an exhaustive computer search
+revealed that 2 of the patterns require more. The next possible option
+is 7 rows since 21 * 7 + 1 = 148, requiring 37 tetriminos.
+As the images below show, those patterns do exist.

Platforms
+T tetrimino on top one
+of the squares of the last generated row. The remaining tetriminos
+support each other down to that first T. Meaning, as long
+as the previously generated row contains at least 1 square, like the red
+square below, then it is possible to construct a flat platform above it
+for the generation of the next row.
J or
+L tetrimino that will
+remove those rows is not inserted until the square emitters are done
+generating the next row of the sprite on top of the platform. That final
+piece precludes square emission in the first and last 2 columns. But, as
+discussed above, the square emitters are limited to the 17 inner columns
+due to the geometry of the J, T and
+L tetriminos used in the process.T tetrimino, only the
+10 patterns shown above exist.Program Input
+0 to 7 correspond to pixels with colors from
+the palette below.
+
+*.txt files contain different sprites in this
+textual format that can be fed into standard input. Several examples
+take advantage of the Tetris play-field
+background color. Instead of using character 0, internal
+regions marked as transparent are effectively rendered as black.Program Output
+ANSImation
+fflush(3) (N.B: see birken.alt.c).IOCCC Size Tool Bug
+2013-07-30-v17. The first line of the program is
+reproduced below.
+char*_ = "'""/*";$ ./iocccsize -i < prog.c
+8$ ./iocccsize -i < birken.c
+2048Obfuscations
+"Tetris",
+"ELORG", "DVK" and the aforementioned
+"Tea". ELORG is
+the abbreviation for Elektronorgtechnica, the former Soviet
+state owned computer organization that handled the worldwide Tetris
+intellectual property rights. DVK is the line of Soviet
+PDP-11-compatible personal computers capable of running Alexey
+Pajitnov’s original 1984 Tetris prototype.l=0, O=0, O=1 and
+while(O). "Tetris" also makes a second
+appearance of sorts:[T][e][t]--; while(R+i) { sT, orientated appropriately to reflect its name and the
+first letter in the title of the game, is just a moment away from
+producing such a text block.#
+character, which is 1 beyond the ASCII value of ", making
+it easier to pack into a string. None of the resultant values are beyond
+ASCII 127. The coordinates for all 19 rotations fit in a string of
+length 38.
{ tetrimino index, drop x-coordinate }. As mentioned, there
+are 19 distinct rotations, requiring 5 bits of storage for the tetrimino index.
+Another 5 bits is required for the drop x-coordinate since there are 21
+columns in the play-field. Necessarily, the pair is stored as 2 separate
+characters. By offsetting them by 40, the ( character, the
+resultant string almost resembles a long and complex mathematical
+expression. The program takes advantage of mirror symmetry by only
+storing 10 single square emitter patterns and 5 platform patterns. The
+pattern lengths are not encoded within the string. Rather, they are
+embedded within the string decoding logic.J
+exchanges with L and S exchanges with
+Z, necessitating a second list of 3-bit color values. Pairs
+of color values (6 bits) fit comfortably into a character that is offset
+by #. The result is a string of length 19.Obfuscations
+
+
+-1.x + 1, is used
+multiple times to determine if a value is not -1.
+Similarly, expressions of the form x - y are used to
+determine if x != y.x["..."] trick appears once.i is less than necessary.4&&L
+and m&&e==m suggests that they always evaluate to
+true.(i & 3) - 3, which identifies pattern 3 and 7 as
+longer.Beyond Obfuscation
+





I, S
+and Z to produce the protruding square. A series of
+rectangular regions are constructed above those tetriminos to erode
+them down to a single emitted square.Example Files
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/birken
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 cable1
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/cable1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Adrian Cable
+Location: USTo build:
+makeTo use:
+./cable1 name group1 group2Try:
+./try.shJudges’ remarks:
+./cable1 Cooper Mac PC./cable1 Noll Mac PC./cable1 Broukhis Mac PC./cable1 Jobs Mac PC./cable1 Gates Mac PC./cable1 Ballmer Mac PC
+
+
+https://fosstodon.org/@iocccAuthor’s remarks:
+Presidents of the
+United States of America!
+republican as the 2nd command-line argument, and
+democrat as the 3rd (or equivalent strings of your
+choice).Why is this entry
+obfuscated/interesting?
+Notes
+
+
+./cable1 roosevelt republican democrat../cable1 fdr republican democrat.Compiler warnings
+clang warns about a missing type specifier for
+main(), and that implicit function declarations are invalid
+in C99 (but still accepts them).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/cable1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 cable2
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/cable2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Adrian Cable
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./cable2 file.bmp [color]Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+OCR
+- Obfuscated Character Recognition of Handwritten Text
+Features
+
+
+Why is this entry
+obfuscated/interesting?
+
+
+for, while, if,
+do, goto, continue,
+break and heaven knows what else! So, in this program we
+only use for, so absolute beginners can get into the code
+straight away.x^y or x-y instead
+of x!=y, using ~x in place of
+x!=-1 for conciseness, mixing x[y] and
+y[x] for variety, educational #defines, and so
+on.main() is the most useful function in all of C - so it
+is a mystery to the author why most programs use it only once. Here we
+use it over and over for maximum benefit.P does the
+interesting part of it, but how?$, but how can a string defined in that way ever get
+printed?Other notes
+
+
+Bugs/features
+
+
+Compiler warnings
+clang warns about unused expression results, missing
+type specifiers, and incompatible pointer conversions - all just a fun
+consequence of the obfuscations.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/cable2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 cable3
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/cable3
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Adrian Cable
+Location: USTo build:
+makeTo use:
+./cable3 bios-image-file floppy-image-file [harddisk-image-file]Try:
+./runmeQUITEMU. You might have
+to be at the top level directory of the drive, A: or
+C:.Alt+XXX key combination, press
+(^A / Ctrl+A) then the key, so for example to
+type Alt+F, press (^A / Ctrl+A)
+then F.Fxx key, press ^F /
+Ctrl+F then a number key. For example, to get the
+F4 key, press ^F / Ctrl+F then
+4. To get F10, press ^F /
+Ctrl+F then 0.Page Down key, press ^F /
+Ctrl+F then O (letter O, not digit zero). To
+send a Page Up key, press ^F /
+Ctrl+F then E. Other key combinations are left
+for the discovery of the user.Alternate code:
+Alternate build:
+make is available and will function:make altAlternate use:
+cable3.alt as you would cable3
+above.Judges’ remarks:
+#include <unistd.h>. This has been done in the entry
+but not the alternate version. This should not affect the usability of
+the program but will trigger a warning which we have disabled in the
+Makefile.Author’s remarks:
+A tiny
+but highly functional PC emulator/virtual machine
+
+
+RULE 2 ABUSE DISCLAIMER
+
+
+iocccsize -i < cable3.c returns 1977 (the year the
+4.77 MHz 8086 CPU was announced)Why is this entry
+obfuscated/interesting?
+
+
+x[y] and
+y[x], don’t use any flow control keywords except for
+for, use K&R-style declarations to honor the C
+language’s rich cultural heritage (plus it saves a byte), and
+occasionally go overboard with nasty nested indexes to give things like
+this:
+--64[T=1[O=32[L=(X=*Y&7)&1,o=X/2&1,l]=0,t=(c=y)&7,a=c/8&7,Y]>>6,g=~-T?y:(n)y,d=BX=y,l].Compiling on different
+platforms
+-fsigned-char) and iOS. You will need to adjust the Makefile if your system lacks
+sdl-config to correctly point to the SDL libraries and
+header files.stty. However Windows has no stty. Therefore
+the Makefile includes a -D option to define a “keyboard
+driver” KB which as it stands is suitable for Unices, but
+maybe not non-UNIX platforms. For example, for Windows/MS Visual Studio,
+instead of the Makefile definition of KB, use something slightly
+different - add the following entry to the Preprocessor Definitions list
+in the Project Properties page:KB=(kb=H(8),kbhit())&&(r[1190]=getch(),H(7))POSIX portability note
+#include <unistd.h>Usage
+./cable3 bios-image-file floppy-image-file [harddisk-image-file]stty cbreak raw -echo min 0
+./cable3 bios floppy.img harddisk.img
+stty cooked echoTo use the emulator -
+floppy mode only
+fd.img provided, which is a FreeDOS boot
+disk.stty
+needs to be used to put the keyboard into raw mode (and afterwards it
+needs to be put back to cooked). So, run the emulator using something
+like this script (provided as runme):stty cbreak raw -echo min 0
+./cable3 bios fd.img
+stty cooked echoTo use the emulator -
+floppy + HD mode
+hd.img.stty cbreak raw -echo min 0
+./cable3 bios fd.img hd.img
+stty cooked echoFDISK to partition the
+hard disk. When it’s done FDISK will reboot the emulator.
+Then you can use FORMAT C: and you are done. The resulting
+disk image is in the right format to be mounted on a real Windows PC
+using e.g. OSFMount (Windows), hdiutil
+(macOS), or mount (linux/unix), providing an easy way to
+copy files and programs to and from the disk image. Or, you can install
+programs from regular floppy disk images (see Floppy disk support below).Keyboard emulation
+ioctl(2) or platform-dependent equivalents to obtain real
+scan codes from the keyboard, the emulator BIOS does the reverse of a
+real PC BIOS and converts ASCII characters to scan codes, simulating
+depress/release of the modifier keys (e.g. shift) as necessary to work
+like a “real” keyboard. The OS (DOS/Windows) then converts them back to
+ASCII characters and although this process normally works seamlessly
+don’t be surprised if there are issues, for example, with non-QWERTY
+e.g. international keyboards.Alt+xxx and Fxxx.Alt+XXX key combination, press
+(^A / Ctrl+A) then the key, so for example to
+type Alt+F, press (^A / Ctrl+A)
+then F.Fxx key, press ^F /
+Ctrl+F then a number key. For example, to get the
+F4 key, press ^F / Ctrl+F then
+4. To get F10, press ^F /
+Ctrl+F then 0.Page Down key, press ^F /
+Ctrl+F then O (letter O, not digit zero). To
+send a Page Up key, press ^F /
+Ctrl+F then E. Other key combinations are left
+for the discovery of the user.Text mode support
+B800) in
+80x25 CGA 16-color text mode.stdout. Direct video memory accesses for the
+80x25 CGA color text mode are converted to ANSI terminal
+escape sequences. If you are using a terminal which does not support
+ANSI (e.g. you are compiling the emulator with MS VC++ and
+running in a Windows console window) then PC applications that directly
+write to video memory in text mode might be unusable.CGA I/O ports are not supported except for the
+CGA refresh register at 0x3DA, which some
+applications use for timing or synchronisation.437) includes
+various extended ASCII characters for things like line drawing. You
+might want to set the font in your terminal program to something that
+includes these (e.g. on Mac OS X there is a freeware font called Perfect DOS VGA
+437 which does the trick).CLS command to clear the screen and all will be well
+again.Graphics mode support
+0x3B8 and 0x3BA including video memory
+bank switching (segments B000/B800), which
+some games use for double-buffered graphics. CGA graphics modes are not
+supported.Dual graphics card support
+BIOS
+CPU and memory emulation
+0:0, BIOS data area including keyboard buffer at
+40:0, CGA text video memory at B800:0,
+Hercules dual-bank graphics memory at
+B000/B800:0, and BIOS at
+F000:100. Unlike a real PC, in the emulator the CPU
+registers are memory-mapped (at F000:0), which enables
+considerable optimisation of the emulator’s instruction execution unit
+by permitting the unification of memory and register operations, while
+remaining invisible to the running software.
+
+0F 00 - output character in register AL to
+terminal.0F 01 - write real-time clock data (as returned by
+localtime()) to memory location ES:BX.0F 02 - read AX bytes from disk at offset
+512*(16*SI+BP) into memory location ES:BX.
+Disk is specified in DL (0 = hard disk,
+1 = floppy disk).0F 03 - write AX bytes at memory location
+ES:BX to disk at offset 512*(16*SI+BP). Disk
+is specified in DL as per 0F 02.CS:IP == 0:0 (which would
+be nonsensical in real software since this is where the interrupt vector
+table lives). The supplied fd.img disk includes a small
+program QUITEMU.COM which contains a single
+JMP 0:0 instruction, to allow the user to easily quit the
+emulator without shutting down the terminal.Floppy disk support
+Hard disk support
+DOS FDISK seeing only 31.9MB as the
+volume size.Mouse
+Real-time clock
+Timers
+0x40 is simulated in a
+broken way which is good enough for most software. On a real PC this has
+a default period of 55ms and is programmable. No programmability is
+supported in the emulator and the period may be about right or
+completely wrong depending on the actual speed of your computer.PC speaker
+Software supported
+
+
+
+
+
+
+
+
+
+
+
+
+Compiler warnings
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/cable3
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 dlowe
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/dlowe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: J. David Lowe
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./dlowe [number...][number...] is one or more number, space
+separated.Try:
+./try.shecho 'IOCCC winning entry 2013/dlowe' > ioccc.txt
+./try.sh
+rm -f ioccc.txt./diff.shJudges’ remarks:
+#include <stdio.h>
+int main() {
+ printf("%d %d %d\n", (int)(-1.0/0.0), (int)(0.0/0.0), (int)(1.0/0.0));
+}
+-2147483648 -2147483648 -2147483648
+-2147483648 0 2147483647
+1840985120 -2033041452 35979112make all will compile fun.c
+but to provide a different compiler you can do something like:make CC=clang funAuthor’s remarks:
+sparkl
+Synopsis
+$ ./sparkl 0 1 2 3 4 5 6 7
+▁▂▃▄▅▆▇▉
+
+$ echo "sparkline of file lengths: $(wc -c * | awk '{print $1}' | xargs ./sparkl)"
+sparkline of file sizes: ▁▁▁▃▃▂▁▂▁▁▉./slflen.shDescription
+sparkl will display a sparkline graph, which you can
+use to very quickly get a sense of the shape of your data.Limitations
+
+
+Obfuscation
+-D
+flags.Acknowledgements
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/dlowe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 endoh1
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/endoh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./endoh1 [file.lazy]Try:
+./try.shcc -E endoh1.c | lessJudges’ remarks:
+Author’s remarks:
+Remarks
+less endoh1.c
+gcc -o endoh1 endoh1.c
+./endoh1$ lazy hello.lazy
+Hello, world!lazy is a
+reference implementation of Lazy K. At the same time, hello.lazy is a valid C program that uses
+endoh1.c as a library.$ gcc -o hello -xc hello.lazy
+$ ./hello
+Hello, world!#include "endoh1.c". Note that # is a comment
+in Lazy K.Obfuscation
+
+
+Limitation
+(S K) instead of (SK), “`sk”,
+**i*i*i*ii*i*i*ii, or 11111100011100.Portability
+
+
+
+
-Wall -W -Wextra -pedantic say
+nothing.gcc -Wall -W -Wextra -pedantic prog.c
+clang -Wall -W -Wextra -pedantic prog.c
+tcc -Wall -W -Wextra -pedantic prog.c
+
+__INCLUDE_LEVEL__. It is a gcc extension, and also
+supported by clang. If your compiler does not support it, you cannot use
+the program as a library. But you can compile and run it as a standalone
+program, at least. In fact, tcc does not support the macro, but does
+work.Spoiler
+S (K I) is translated to a normal C code,
+(s)((k)(i)), or simply s(k(i)).Abuse of function pointers
+s(x)(x)(x)(x)...s have? Unfortunately, C does
+not provide a “recursive type”, such as
+typedef f (*f)();.typedef void *(*(*(*...(*(f))()...)())())p.Code duplication by macros
+
+
+void *x1; void f1(void *y) { return apply(x1, y); }
+void *x2; void f2(void *y) { return apply(x2, y); }
+void *x3; void f3(void *y) { return apply(x3, y); }
+...
+void *(h[]) = { f1, f2, f3, ... }S K
+I) one program can use.A B C and D. (Note
+that closures are allotted only when parsing; after the evaluation
+starts, “out of closure” cannot occur.)Short cording
+v s[]={0,0,s+6,s+2,s+4,s,s+3,s+5,s+1}; is? I found this by
+using an SMT
+solver.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/endoh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 endoh2
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/endoh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+make checkcheck rule will check if you
+have both and if either is not found it will report it and tell you
+where to download one or both before exiting.Try:
+cat jpeg.cjpeg.jpg in an image viewer program.Judges’ remarks:
+behind the ruby curtain —
+it’s a straightforward bitmap comparison.Author’s remarks:
+Highlights
+
+
+
+
Notes
+endoh2.c contains fragments of the main program
+as a comment which iocccsize -i does not
+count. I gratefully thank the judges for spoiling the size rule this
+year.Legal
+
+Copyright (c) 2004, 2005 Tristan Grimmer
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/endoh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 endoh3
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/endoh3
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./endoh3Try:
+echo 'CDEFGABc' | ./endoh3 | ruby wavify.rb > cde.wavJudges’ remarks:
+A
+modern day (2023) note about the award ‘Most tweetable 1-liner’ and
+twitter:
+Author’s remarks:
+Remarks
+cc -o endoh3 endoh3.c
+echo "CDEFGABc" | ./endoh3 > /dev/dsp/dev/dsp is not available on your system, use an OSS
+sound wrapper such as padsp or aoss:echo "CDEFGABc" | ./endoh3 | padsp tee /dev/dsp > /dev/nullecho "CDEFGABc" | ./endoh3 | sox -q -traw -r8000 -b8 -e unsigned-integer - -tcoreaudioecho "CDEFGABc" | ./endoh3 | ruby wavify.rb > cde.wavcde.wav./dev/dsp you can do so like:cat twinkle.abc | ./endoh3 > /dev/dsp
+cat menuet.abc | ./endoh3 > /dev/dspObfuscation
+endoh3ram program:
+
+89/84.? I found it by using the Stern-Brocot
+tree.Limitation
+
+
+
+
C D E F
+G A B (in low octave)c d e f
+g a b (in high octave)z
+
A (an eighth note)A2 (a quarter note)A3 (a dotted quarter note)A4 (a half note)
+
+^C _C
+
+
C1/2
+
+
C0.5 instead.c' C,T:title L:1/4Known Bugs
+E, such as C2E2.C2 E2.Portability
+
+
+Legal
+z1092. You know, it is “the famous
+song”.Spoiler
+(c % 32 + 5) * 9 / 5 % 13 + n / 32 * 12 - 22
+'C' (ASCII 67) => 3
+'D' (ASCII 68) => 5
+'E' (ASCII 69) => 7
+'F' (ASCII 70) => 9
+'G' (ASCII 71) => 10
+'A' (ASCII 65) => 12
+'B' (ASCII 66) => 14
+'c' (ASCII 99) => 15
+'d' (ASCII 100) => 17
+'e' (ASCII 101) => 19
+'f' (ASCII 102) => 20
+'g' (ASCII 103) => 22
+'a' (ASCII 97) => 24
+'b' (ASCII 98) => 26
+'K' => 4 (= C#)
+'L' => 6 (= D#)
+'U' => 8 (= F#)
+'V' => 11 (= G#)
+'P' => 13 (= A#)pow(2, n / 12.0).
+Then, how can we calculate pow without math.h?
+pow(2, 1.0 / 12.0) is approximated by 89/84..
+(I found this approximation by using the Stern-Brocot
+tree.) We can gain the frequency by multiplying the value by
+n times.for(c = 0; c < len; c++) putchar(a = n * D);D is a frequency and a is a variable
+whose type is char. By assigning float to
+char variable, the implicit type conversion is performed
+from float to char (modulo 256).(long)(n*D) if you are
+pedantic.)for-loop.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/endoh3
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 endoh4
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/endoh4
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./endoh4 < file
+./run.sh filerun.sh command line it will feed to the program endoh4.c.Try:
+./run.sh cube.txt./run.sh solids/archimedian-solid/a11-truncated-icosahedron.txtJudges’ remarks:
+./run.sh).
+When it runs there is an animation for the computation to work out the
+convex hull.Author’s remarks:
+Spec
+
+
+stdin,
+
+
+
+
"',;;;,;'"math.h.)Portability
+-pedantic and -Wextra.Tips
+tput to hide the terminal
+cursor.tput civis
+./endoh4 < cube.txt
+tput cnorm./run.sh cube.txtBonuses
+cc -DS=120,40 -o endoh4 endoh4.c./endoh4 < endoh4.c # or ./run.sh
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/endoh4
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 hou
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/hou
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Qiming HOU
+Location: CNTo build:
+make allBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./hou [scene-file-name] [options]stdout, preferably with an
+auto-refreshing PPM image viewer ready. Refresh the image every time the
+output refreshes, all effects should be more or less recognizable when
+you see 16.Try:
+./hou BIG
+./hou old_default.scene BIG
+./hou otherroom.scene
+./hou otherroom.scene NAIVE
+
+
+
+
+
+hou (but not Qiming Hou :-) ) in order to end the
+program.Judges’ remarks:
+a.c.gz. We do not include it but it can be generated
+like:cc -Wall hou.c -o hou -lm
+./hou > a.cAuthor’s remarks:
+Using hou
+./hou [scene-file-name] [options]hou runs, it writes a progressively refining image to
+a ppm file specified in the scene. The initialization may take a while,
+but once it’s done, a rough preview should be available in seconds.
+Leave hou running for the night, and you get a high quality
+result like the attached *.jpg files. Kill hou
+manually after you’re satisfied with the image quality.Features
+
+
+./hou otherroom.scene gives a rough idea about the overall
+illumination at 16 samples per pixel (i.e., when the program prints 16),
+whereas the naive approach ./hou otherroom.scene NAIVE only
+produces a mess of white dots../hou overnight? No
+problem! You can kill and resume a rendering session whenever you want.
+The renderer automatically saves the progress every 16 samples and
+resumes where it’s left off when restarted. Also, each scene/parameter
+combination gets a different saved session so you don’t have to worry
+about conflicts.Abuse of the rules
+
+
+grep “size limit”).
+Please see the Self-imposed
+restrictions section below for more details.hou does not terminate (as suggested by the second line
+of rule 6).Self-imposed restrictions
+
+
+cc(1) and make(1). No gzip(1)
+compression! a.c.gz doesn’t fit in 2053 bytes, anyway.#define (or
+cc -D) at all.fopen()ed with
+"rb" / "wb" for Windows compatibility. The PPM
+header has a comment line for non-standard-compliant viewers
+(specifically, my old HDRShop 1.0). And there is a nice text message
+saying “please wait…”. Despite the messy look, a.c and
+hou.c compile warning-free (hou.c even wastes 18 bytes on
+#include<stdio.h> just for putchar(3)).
+a.c compiles mostly clean in the C99/ANSI modes of
+clang and gcc (with -Wall --pedantic). The only warning
+generated is a pedantic one:
+"string constant too long".Comments and why obfuscated
+
+
+double, and assumes int to
+be 32-bits.Spoiler
+
+ 3225 3225 3225 9 9 3225 3225
+ 1 1 1 1 1 1 1 1 1 1
+ 4225 1226 1 1 1 1 1222 1226
+ 1 1 1 1 1 1 1 1 1
+ 4226 1 4226 8 4222 4226 1 13DDDA (3D Discrete Differential Analysis) ray tracer, a
+PSSMLT (Primary Sample Space Metropolis Light Transport)
+light path sampler, all squeezed into the size limit using a
+PPM compressor (Prediction by Partial Matching, and yes,
+the output format is chosen for the pun..).PSSMLT uses the Metropolis-Hasting algorithm to sample a
+32D unit hypercube. Each point in the hypercube is interpreted as a
+sequence of random numbers, and is sent to a path tracer to generate a
+light path. The point’s Metropolis-Hasting energy is then defined as the
+corresponding path’s contribution value to the final image. Since each
+path is sampled with a probability proportional to its energy, the
+sample distribution directly corresponds to the final image, which can
+then be produced as a simple per-pixel histogram of all generated paths.
+The robustness comes from a state mutation strategy that actively tries
+to explore the neighborhood of high energy peaks (e.g. paths that happen
+to hit the light source in otherroom.scene). In addition, a rudimentary
+form of lens path stratification is added to balance the attention each
+pixel receives. The Metropolis-Hasting process completely avoids the
+tell-tale pixel sampling loop required in most other image generation
+methods.3DDDA tracer is chosen for scalability: its
+performance doesn’t get much worse as scene complexity increases.
+Another benefit is that with the DDA code in place one can
+naturally use hierarchical grids as an acceleration structure. The
+downside, of course, is that the setup involves quite a few divisions,
+which naturally turns into divisions-by-zero. Fortunately, the IEEE754
+standard has a nice set of rules just for this purpose and the
+arithmetics are organized in a specific way to take advantage of this.
+The shader interpreter component is relatively straightforward, just an
+expression evaluator stripped to the bare minimum – it doesn’t even
+support numerical constants natively. A final little bit is a
+just-good-enough PRNG (Pseudo Random Number Generator) to replace the
+low precision Windows rand() and the non-C99 Unix
+drand48(3). An overnight session would run through its
+short period many times, but that doesn’t necessarily map to the same
+set of paths in PSSMLT. After all, Metropolis-Hasting used
+an even worse PRNG in their 1953 paper.PPM compressor uses statically weighted fixed order
+contexts with an arithmetic encoder tweaked for iocccsize.c. The encoder emits octet-space
+pairs where each octet encodes ~6.5 bits of information and each space
+encodes 2 bits (thanks to the generous definition of “space” in iocccsize.c). The compressor actively shuffles
+the variable names around until the compressed string happens to contain
+enough {};s to pass the final iocccsize.c test. There are a few other
+tweaks:
+
+PPM model uses mostly whitespace characters for
+weights.'"' and
+'\\'.PPM
+implementations.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/hou
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 mills
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/mills
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Mills
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./millsTry:
+./mills &Judges’ remarks:
+Author’s remarks:
+The Program
+Usage Notes
+Control-C in the original
+window. Note that if you want to restart the program again, you should
+wait a minute or two before doing so. For details as to why this is
+necessary, feel free to Google "TIME_WAIT",
+"SO_REUSEADDR" and "SO_REUSEPORT" (with the
+quotes). And while you are there, click on an ad. They could use the
+money.n=1,setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&n,sizeof n),Details of Operation
+
+
+
+
+User-modifiable Features
+
+
+-DLT=x1,y1,z1,x2,y2,z2,... defines the coordinates
+of the lights in the scene. It should be a comma-separated list of
+coordinates (x, y, z), three per light.-DNL=n defines the number of lights. It should be
+equal to the length of the list above (three times the number of
+lights).-DEY=x,y,z defines the position of the viewer (the
+eye point) for the scene. The eye is looking at the origin
+(0, 0, 0).Other Build Flags
+INADDR_ANY to
+allow everyone to experience the server’s output. The Judges suggested
+that I instead restrict the bind to INADDR_LOOPBACK to
+reduce security alarms. As a compliant veteran of innumerable post-ship
+late feature additions, I have modified the Makefile to inject the new code without destroying
+the beautiful spherical symmetry of the source code. In addition, I have
+altered the word sin_port to the more family-friendly
+version win_port (via
+-Dwin_port="sin_addr.s_addr=htonl(2130706433),R.sin_port")
+to protect against curious impressionable youth trying to learn about
+sockets on the Internet.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/mills
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 misaka
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/misaka
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeTo use:
+./horizontal_cat [files...] > [output]
+./vertical_cat [files...] > [output]Try:
+make understanding./try.sh./vertical_cat - -Judges’ remarks:
+Slight diversion
+Author’s remarks:
+Overview
+Misaka is a file concatenation utility, with at least
+two modes of operation:cc misaka.c -o horizontal_cat
+./horizontal_cat [files...] > [output]
+
+./horizontal_cat misaka.c misaka.c > misaka2.c
+cc misaka2.c -o vertical_cat
+./vertical_cat [files...] > [output][files...] is a list of text file names. Use
+- to read from stdin.Details
+Horizontal cat
+cat. The best thing
+about it was that it was named “cat”. That, and it’s
+useful for quickly showing contents of a file. Though it was primary
+meant for concatenating files, that function only seem to work if I
+wanted to concatenate files vertically.cc misaka.c -o horizontal_cat
+./horizontal_cat files...horizontal_cat concatenates files horizontally and write
+the output to stdout. Each input file is padded with spaces
+on the right so that the original text alignments are preserved.- is specified as a file name,
+horizontal_cat will read from stdin. Unlike
+cat, horizontal_cat loads all input to memory
+first. Thus you can specify - multiple times to get
+stdin multiplied horizontally. For example, if you have
+seq(1) in your shell, you can add line numbers to both
+sides of misaka.c like this:seq -f ' %.0f ' 45 | ./horizontal_cat - misaka.c -Vertical cat
+horizontal_cat must know the maximum width of
+all files before writing any output, all files must be processed at
+least twice. To support stdin, file must be buffered to
+memory. This lead to the feature that horizontal_cat can be
+used to duplicate stdin.stdin doubling feature might be useful
+even for concatenating files vertically, so I included a vertical mode.
+But supporting vertical mode with command line options would be no fun.
+Instead, vertical mode is enabled by concatenating the source code
+horizontally:./horizontal_cat misaka.c misaka.c > misaka2.c
+gcc misaka2.c -o vertical_cat
+./vertical_cat files...vertical_cat works more or less like cat,
+except you can use vertical_cat to duplicate
+stdin:./vertical_cat - -Long cat
+horizontal_cat and vertical_cat, I
+thought, maybe all I really wanted was just more cats. So I implemented
+one more mode, this one is enabled by concatenating misaka.c vertically:./vertical_cat misaka.c misaka.c > misaka3.c
+gcc misaka3.c -o long_cat
+./long_catlong_cat outputs ASCII art of a cat to
+stdout. You can make this cat exponentially longer by
+concatenating more files vertically (up to 31 levels high, depending on
+sizeof(int) for your compiler):./vertical_cat misaka.c misaka.c misaka.c > misaka4.c
+gcc misaka4.c -o loong_cat
+
+./vertical_cat misaka.c misaka.c misaka.c misaka.c > misaka5.c
+gcc misaka5.c -o loooong_cat
+
+./vertical_cat misaka.c misaka.c misaka.c misaka.c misaka.c > misaka6.c
+gcc misaka6.c -o loooooooong_cat./vertical_cat misaka.c misaka.c | ./horizontal_cat - - > misaka7.c
+gcc misaka7.c -o long_fat_cat
+
+./vertical_cat misaka.c misaka.c | ./horizontal_cat - - - > misaka8.c
+gcc misaka8.c -o long_faat_cat./horizontal_cat misaka.c misaka.c | ./vertical_cat misaka.c - > misaka9.c
+gcc misaka9.c -o same_as_long_catperl bf.pl misaka9.c
+MISAKA
+MISAKA MISAKAReturn value
+horizontal_cat and vertical_cat will exit
+with zero status on success.horizontal_cat and
+vertical_cat will report the offending file name to
+stdout, and exit with nonzero status.horizontal_cat and vertical_cat ran out
+of memory, they will exit with nonzero status without outputting
+anything.Compatibility
+horizontal_cat makes the following assumptions about
+input files:
+
+Misaka has been verified to work on these following
+compiler+OS combinations:
+
+Misaka requires a C99 compiler due to the use of single
+line comments. Misaka does not depend on any other C99
+features.Obfuscation
+
+
+gcc -Wall should provide a hint to where the mode switch
+happens, it does not output any irrelevant other warnings (verified on
+4.6.3).Extra files
+
+
+About
+MisakaMisaka is
+inspired by a particular stackable figure:Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/misaka
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 morgan1
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/morgan1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yves-Marie
+Morgan
Location: FRTo build:
+makeTo use:
+echo "2013/10/03" | ./morgan1Try:
+echo "1985/10/28" | ./morgan1
+
+echo "1996/12/31" | ./morgan1
+
+echo "1986/03/31" | ./morgan1 # Comet Halley (look for 'Ha')
+
+echo "1997/04/01" | ./morgan1 # Comet Hale-Bopp (look for 'Hb')Judges’ remarks:
+Author’s remarks:
+Instructions
+
+
+Bonus
+
+
+Limitations
+
+
+math.h
+functions).Obfuscation
+
+
+main() function with some for
+loops.for loop.Compilation warnings
+
+morgan1.c:38:3: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
+morgan1.c:40:34: warning: value computed is not used [-Wunused-value]
+morgan1.c:56:6: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
+morgan1.c:58:50: warning: value computed is not used [-Wunused-value]
+morgan1.c:61:5: warning: suggest parentheses around ‘-’ inside ‘>>’ [-Wparentheses]
+morgan1.c:38:49: warning: '&&' within '||' [-Wlogical-op-parentheses]
+morgan1.c:38:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
+morgan1.c:55:13: warning: '&&' within '||' [-Wlogical-op-parentheses]
+morgan1.c:56:14: warning: '&&' within '||' [-Wlogical-op-parentheses]Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/morgan1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 morgan2
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/morgan2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yves-Marie
+Morgan
Location: FRTo build:
+makeTo use:
+./morgan2./morgan2 XJudges’ remarks:
+Author’s remarks:
+How to play
+Start of the game
+Moving in the stack
+Up and Down key to move the cursor in
+the stack. Press Enter to either:
+
+Placing a domino
+Up, Down, Left and
+Right keys to move in the grid. Press Enter on
+an empty position to place the domino.Enter on an occupied
+position.Scoring
+
+
+End of the game
+
+
+q when you have
+finished…Strategy
+
+
+Limitations
+
+
+Obfuscation
+
+
+Compilation warnings
+
+morgan2.c:46:65: warning: value computed is not used [-Wunused-value]
+morgan2.c:23:24: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/morgan2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2013 robison
+
+
-
+ The International Obfuscated C Code Contest
+ 2013/robison
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Arch D.
+Robison
Location: USTo build:
+makeTo use:
+./robison
+# enter an expression
+
+echo expression | ./robisonTry:
+./try.shJudges’ remarks:
+
+plus minus, div times (and what not).
+on standard input percent be feeding.
+when interactive one values more than throughput.
+one can compute M(23209).Author’s remarks:
+Oh, The Strings You Can C!
+
+But the thing I abhor is numerical ops!
+No increment, decrement, or subscripting blech,
+No addition, subtraction, or bitwise bool glop.
+As for pointer arithmetic – totally yech!
+I find NOTS are a bang, and relations a ball.
+I like calling routines, and recursions in essence.
+But the thing I like MOST is a string dot h CALL!
+Take string len of this, and string copy that.
+From my keyboard I pause, to hear subroutines dear:
+The bark of string chrr, and the purr of string CAT!
+From where an arg points: string calls only go forth,
+So how to go back, to be Turing complete?
+From standard dot H, to the rescue, q SORT!
+Does my program compose a tattoo for your shin?
+Play crosswords or translate from Urdu to Tzouby?
+To give it a whirl, just punch 2 + 2 in.
+Take unary minus and also subtract.
+Summing hairs of a walrus? No longer a fuss.
+Parenthetical grouping – no pushing a stack!
+Subtract an octillion
+- it’s simply divine.
+To compute a remainder, inscribe a percent.
+For the sign of the answer, see C ninety nine!
+Are the lengthiest figures the program can gnash.
+Go over that limit, by even a digit:
+Risk incorrect answers, or witness a crash!
+What about duodecimal, ternary, hex?
+Try the base as an option (of course in base ten)
+Any base two to twenty – for that is the specs.
+Divide babbage (in base seventeen) by cafe –
+a nice fad, but avoid a division by nix:
+No errant result, but you could wait all day!
+or King
+Tutankhamun; for him it’s a romp.
+Addition by cats, and if given two figures,
+to tell which is bigger, sort down and string CMP!
+starts at the left and works to the right.
+Yet more innovation: like Henry Ford’s
+cars,
+With a pound and define, mass production of vars!
+With the C lib for strings, you can hack with a flair.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2013/robison
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 birken
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/birken
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Alexander
+Prishchepov
Location: US
Name: Michael
+Birken
Location: USTo build:
+makeSTARDATE. See Alternate code below.To use:
+./prog < some_secret_or_something
+
+./prog http://host[:port]Try:
+./prog < README.mdecho "IOCCC 2014!" | ./prog./prog http://127.0.0.1:1701/dev/null ?Alternate code:
+Alternate build:
+make clobber PORT=31337 altSTARDATE, try:make clobber TIME=5000000 altAlternate use:
+prog.alt as you would prog above.
+Remember that ports < 1024 are privileged ports that unprivileged
+users cannot use.Judges’ remarks:
+Authors’ remarks:
+Abstract
+To use web server
+./prog < secret_file_to_be_downloaded./prog < prog.cTo use client-side
+downloader
+./prog http://host[:port]./prog http://127.0.0.1:1701HTML content
+Exploration
+Inspiration
+STARDATE constant makes timing
+configurable; and, the constant k stands for Khan
+(in the final engagement in Star
+Trek II: The Wrath of Khan, the damaged Enterprise managed to
+disable the USS Reliant’s
+shield generator by accessing its prefix code: 16309).Secondary size limit
+-i command line option is used, the value printed is
+0.Transmission protocol
+revealed
+Configuration
+0.5 seconds. This is microsecond tunable via the
+STARDATE constant defined at the top of the source code.
+Increase the value in the event of transmission errors. Decrease the
+value to download faster and less reliably.Obfuscations
+
+
+O and l were selected for their
+resemblance to 0 and 1 respectively.Compiler warnings
+#include <asm/byteorder.h>
+#include <ctype.h>
+#include <netinet/in.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/unistd.h>Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/birken
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 deak
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/deak
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ferenc Deak
+Location: unknownTo build:
+makeX1, X2, Y1 and
+Y2 (which were magic numbers). See Alternate code below.To use:
+./progTry:
+./progAlternate code:
+Alternate build:
+make altX1, X2, Y1 and/or
+Y2, which default to: -2, 1,
+-1.3 and 1.3 respectively. For instance:make clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 altAlternate use:
+prog.alt as you would prog.Alternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+Portability
+The application
+double _[]={-2
+,1,-1.3 ,1.3, 0, 0,0,0
+,0 ,0,50, 80, 0,0,0 ,255
+, 8,0}; int main (
+ int j) {if (j== 1 ){ if(
+ _[12] >_[10] )_[17]=1 ;} if
+ (_[13] >_[11 ] ||_[17]==1) return 1
+ ;_[6] = _ [13] / _[11]*(_[1]-_[ 0])
++_[ 0]; _ [7]=_[12]/_[10]*(_[3]-_[2] )+_
+[2];_[8]=_[9]=_[14]=0;l2:_[4]=_[8] * _ [8]
+;_[ 5]= _ [9]*_[9];_[9]=2*_[8]*_[9]+ _[7
+ ];_[8 ] = _ [ 4 ]-_[5]+_[6];_[14 ]++
+ ;if((_ [14]< _ [15])&&(_[4]+ _[ 5]
+ <_[16 ])) goto l2; putchar(
+ " #@*+ "[( int) _[14]%
+5 ]);_ [13 ] ++ ; main (
+0) ;_[12]++; _[13] =0
+;if(_ [17] !=1) putchar
+(0xa); main(1);}/* <-- Configure here: X1, X2, Y1, Y2 */ is
+intentionally not obfuscated so that the adventurous programmer can
+manually modify the coordinates of the fractal to be drawn on the
+screen.Compiler warnings
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/deak
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 endoh1
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/endoh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./prog > foo.cTry:
+./try.shmake rake but
+this is not necessary to fully enjoy the entry. make rake
+will run the rake.sh script and then
+prog if all is built okay. If rake is not
+installed then it will check that gem is installed. If
+gem is not installed it will tell you where to get it and
+then tell you how to install rake. Otherwise, if
+rake is installed it will try running rake and
+if that fails to run it will tell you to run a gem command
+as either root or via sudo and then to try running
+make rake or ./rake.sh again. If
+rake succeeds it will run ./prog which can be
+used to build main.c../prog and
+main?Judges’ remarks:
+make treacl
+./treacl./prog < prog.c > treacle.c
+make treacle
+./treacleAuthor’s remarks:
+Remarks
+Spoiler
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/endoh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 endoh2
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/endoh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./prog < input > outputTry:
+echo Hello | ./prog
+
+echo Hello | ./prog > hello.c
+make hello
+./helloJudges’ remarks:
+Author’s remarks:
+Remarks
+For more information /
+background reading:
+
+
+__INCLUDE_LEVEL__.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/endoh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 maffiodo1
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/maffiodo1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Sandro
+Maffiodo
Location: ITTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+cat game.level | ./prog 320 200 800 300 128 144 game.rgba game.wav 10343679
+
+Try:
+./giana.sh
+
+./mario.sh
+ls # show files including games
+wumpus.bas # play Hunt the Wumpus
+advent.gam # you know what this is! :-)
+starwars # animated Star Wars 'film'ROWS=800 COLS=800 ./mario.sh
+
+ROWS=800 COLS=800 ./giana.shJudges’ remarks:
+tabsize=4 to see the
+magic of the formatting of the code. In vim you can do:
+:set tabstop=4.vimrc file! You can also use expand as
+described below by the author if your terminal has enough rows and you
+don’t want to move about in the code. The vim command should immediately
+take effect.Author’s remarks:
+Remarks
+tabsize=4 to see the magic.expand -t 4 prog.ccat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet telehack.com 23starwars
+
+Running under macOS
+
+
+42921241593243070463Regarding how to compile
+SDL1.
+
+incompatible pointer types: because all pointers are
+declared to int or char, to save bytes.type specifier missing, defaults to 'int': because I
+need to save bytes.using the result of an assignment as a condition without parentheses:
+because while(c=getchar()) is not evil.How it works
+Parameters
+
+
+Sprites
+
+sprite_size = image_width / 8
+Position | Description
+:-----------------|:--------------
+0 | Player standing right
+1 | Player walking right frame 0
+2 | Player walking right frame 1
+3 | Player jumping right
+4 | Player standing left
+5 | Player walking left frame 0
+6 | Player walking left frame 1
+7 | Player jumping left
+8 *(second row)* | Super player standing right
+9 | Super player walking right frame 0
+10 | Super player walking right frame 1
+11 | Super player jumping right
+12 | Super player standing left
+13 | Super player walking left frame 0
+14 | Super player walking left frame 1
+15 | Super player jumping left
+24 | Player dead
+32 | Player won
+40 | Super player wonLevels
+stdin.C[333*7],d=333;
+
+Screen X : x position of the object in the
+level.Screen Y : y position of the object in the
+level.Sprite : id of the sprite to be used for
+the object.CLASSFLAGS : a bitmask that describe how the object
+behaves.CLASSPARAM0: a parameter that depends on
+CLASSFLAGS.CLASSPARAM1: a parameter that depends on
+CLASSFLAGS.CLASSFLAGS must be a combination (bitwise OR) of some of
+these constants:
+
+ENEMY (1) An enemy. CLASSPARAM0 can be 0 if the enemies don't move, 1 if the
+ initial move direction is right, -1 if that direction is left. All
+ enemies that walk will change their direction after 20 steps. The
+ sprite of an enemy must have 2 other adjacent sprites: SPRITE-1,
+ used when the enemy dies, and SPRITE+1, used when it moves.BLOCK (2) A wall. Player can walk over the object but can not pass through it.OBJECT BLOCK (4) When the player hits the object from below, a new object is created.
+ CLASSFLAGS of the new object is defined in CLASSPARAM0. The sprite
+ used for the new object is defined in CLASSPARAM1. The sprite of the
+ new object must have an adjacent sprite: SPRITE+1, used when the
+ block is hit.POWERUP (8) This is a power-up like the classic Mario mushroom. When the
+ character hits the power-up object, the character becomes the Super
+ character. If CLASSFLAGS has the bit ZOOM, the character height will
+ be doubled. The Super character can hit the enemies without dying,
+ but when this happens, the Super character goes back to being
+ normal.END (16) When the player hits this object the level ends; the player wins.ZOOM (32) This flag can be used with POWERUP to indicate a power-up that
+ will double the size of the player (like the Mario mushroom).DESTROY (64) When the player hits the object (e.g. the classic Mario coin) the
+ object disappears but the engine does not count the points, so,
+ from the player point of view, this object is useless.DESTROYUP (128) This object is like a BLOCK but when the player hits the object
+ from below, the object disappears.CLASSFLAGS is 0 the object only has an
+aesthetic function.-1.Limitations
+Super character becomes bigger
+(ZOOM flag), the character can collide with blocks and get
+stuck inside them. This is a KNOWN BUG. When your player become bigger,
+stay away from blocks!Credits
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2014/maffiodo1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 maffiodo2
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/maffiodo2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Sandro
+Maffiodo
Location: ITTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog argTry:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+cat image.rgb | ./prog.altJudges’ remarks:
+Author’s remarks:
+Remarks
+stdin and print the ASCII ART to
+stdout.
+
+Screen size
+d=80,Something to try
+cat image.rgb | ./prog " .:;Y0"convert -geometry 80x source.jpg image.rgb./prog " :1"
+./prog " .:;Y0"
+./prog " .:-=+*#%@"
+./prog " .,:!-iots&8%#@$"121 byte version
+d=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}}Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2014/maffiodo2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 morgan
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/morgan
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yves-Marie
+Morgan
Location: FRTo build:
+makeTo use:
+./prog [arg ..]Try:
+./try.shJudges’ remarks:
+Author’s remarks:
+Remarks
+make(1) clone.make(1) syntax and
+will execute rules for goals given in arguments if they need to (based
+on timestamp of dependencies of rule targets).Supported features
+
+
+name=value.Makefile found in previous contest archives.
+Simply use this program instead of make. It will
+recursively use itself for sub-make (the MAKE= assignment
+inside Makefile will be ignored to continue using
+itself).Limitations / Known issues
+
+
+Makefile.$< and $@ are supported for
+automatic variables in commands.-j option).:= += ?= syntax for
+variable assignment.Compilation warnings
+
+prog.c:22:15: warning: return makes integer from pointer without a cast [enabled by default]
+prog.c:23:72: warning: signed and unsigned type in conditional expression [-Wsign-compare]
+prog.c:12:11: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/morgan
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 sinon
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/sinon
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeTo use:
+cp -f prog.c run.c; ./hecate.shTry:
+./try.shy or Y to
+exit at this point.Judges’ remarks:
+Author’s remarks:
+Summary
+cp prog.c run.c
+gcc -O0 run.c -o run && ./run | tee run.c
+gcc -O2 run.c -o run && ./run | tee run.c
+...Details
+
+
+
+
+Compatibility
+
+
+Miscellaneous features
+perl prog.c | bashCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/sinon
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 skeggs
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/skeggs
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Cel Skeggs
+Location: USTo build:
+makeTo use:
+./progJudges’ remarks:
+main(). But how? How is
+main() able to call code that was written and compiled just
+in time for execution?Author’s remarks:
+TABLE OF CONTENTS
+
+
+BACKSTORY
+KNOWN COMPILER WARNINGS
+wc -c.
+
+
+
+fprintf(3) invocations
+don’t use all their parameters. The program should still work
+fine!
+
+
+
+#include statement is expensive, and I’m
+broke.
+
+return statement is too
+much. This will never actually occur, but some C compilers think they
+know more about my program than I do! :P-fPIC is irrelevant for
+shared libraries. If so, you should remove it from the
+Makefile.OBFUSCATION?
+WHAT OBFUSCATION? THIS IS A PERFECTLY NORMAL C PROGRAM!
+THE COOL PART
+dlopen(3), and…dlsym(3) like a normal
+programmer, I mark one of the generated functions with
+__attribute__((constructor)). This means that it gets
+called immediately on load, so it can make its functions available.THE NOT-SO-COOL PART
+#defines.# operator in a preprocessor macro) -
+this allows me to pass C code in arguments to the macros, meaning that
+it gets interpreted as C code instead of a string by the iocccsize tool, so it gets counted as smaller!
+:DA SLIGHTLY COOL PART
+WAIT WHAT
+MISCELLANEOUS STUFF
+TROUBLESHOOTING GUIDE
+
+
+%cinclude "prog.c", is
+prog.c the name of the original source code file?ncurses.h (like a nice system)
+or ncurses/ncurses.h (like a rude system) ?-fPIC (or other arcane
+invocations) to compile a shared library? If so, make sure that you
+include it in the -DCC argument in the build
+script.-fPIC?
+(Like Cygwin.) You might need to remove it from the build
+script.__attribute__((constructor))? It needs to.err. Maybe it will help you figure
+out why a runtime- generated program failed. The failing program should
+be found in t.c.
+
+Q&A
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/skeggs
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 vik
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/vik
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Daniel Vik
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: known bug - please help us fixTo use:
+./prog > foo.cTry:
+echo 'Want to hear me beep?' | ./prog > audio_file.raw
+
+echo 'No. I want chocolate!' | ./prog | mplayer -demuxer rawaudio -Alternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above as
+well as below.Judges’ remarks:
+./prog < prog.c > prog.raw./prog < README.md | mplayer -demuxer rawaudio -Author’s remarks:
+Remarks
+mplayer(1), you can listen to the
+Morse audio.-’ as it makes
+mplayer(1) read from stdin.Convert audio
+file with Morse signals to text
+./prog e < audio_file.rawPortability
+stdout.main() before any code in order for the program to run
+correctly:_setmode(_fileno(stdout), 0x8000);Known Issues
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/vik
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2014 wiedijk
+
+
-
+ The International Obfuscated C Code Contest
+ 2014/wiedijk
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Freek Wiedijk
+Location: NLTo build:
+makeTo use:
+./progTry:
+./try.shindent(1) found by the shell
+type -P indent and sed(1) found by the shell
+type -P sed but if you want to change these, say to try a
+different beautifier, you can do it like:INDENT=bcpp ./try.shbcpp(1) instead of
+indent(1). Do similar for sed(1) only use the
+name SED.Judges’ remarks:
+Author’s remarks:
+Remarks
+
+
+w word
+datatype.w(*)(w,w*) works just as
+well.-std=c99 -Wall -Wextra -pedantic.Y.Y is on lines
+29-30:
+W_f = \x.f(xx)
+Y = \f.W_f W_f
+
+_ force
+function (John Tromp notes that if Turing’s fixed-point combinator
+(\xy.y\z.xxyz)(\xy.y\z.xxyz) had been used, all
+applications could have been strict).Y to implement factorial on native
+ints.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2014/wiedijk
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 burton
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/burton
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dave Burton
+Location: USTo build:
+makeTo use:
+./prog "expression"./progTry:
+./try.sh./progman ./calc.1Alternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+hands digits!”Author’s remarks:
+calc
+- an integer expression calculator that outputs in both hex and
+decimal
+Notes
+calc. Onomatopoeia of sorts, in
+the visual realm. The formatting was easier: Form Follows Function
+(although Hou did this better). It was tempting to call it
+iCalc, with i for integer (and it was written on an
+iDevice), but sanity prevailed.prog.c vs prog.alt.c
+1+1, 1-1, 1|1,
+and 1^1 when using an ARM based computer, although
+1*1 and others worked correctly. This occurs because some
+platforms by default treat char as
+unsigned char. The original code has this weakness, which
+can be corrected by adding -fsigned-char to the compile
+line.char signedness.Why is this entry
+obfuscated/interesting?
+grep '[0-9]' prog.c || echo no digits!for and return. It is
+if-less, switch-less, while-less,
+and hopeless. Literally, if not figuratively. ;-)iocccsize -i, and can be reformatted without changes (as in
+rule2.c) to exactly 4096 octets.calc is interesting, if for no other reason
+than it is practically useful: Hex/decimal conversion, arithmetic,
+byte-swapping, bit-shifting, and logical operations with memory, on the
+command line, or interactively.But the
+question is why is the entry obfuscated?
+
+
+typedefs instead of
+#define, so the types remain useful even in the debugger,
+and source code beautifiers will not undo careful presentation.#defines are used here in the best spirit of the
+preprocessor: to shorten repetitive constructs, not for
+obscurity.for,
+return, typedef, void,
+char, short, unsigned and
+long; 10 if #include and #define
+are counted."syntax_error!" right up
+front, filling the reader with confidence.indent(1) and clang-format(1), after running
+it through the preprocessor, sustaining its better qualities.strtol(3) code is pretty
+tricky. No special attempt was made to replace operations with obscure
+mathematical relations, as the (lack of) beauty is in the parsing – ask
+not where is the modulus operation, but how does it know when to mod –
+okay, but where is add and subtract? And really, who doesn’t enjoy a
+setjmp(3) in the argument list?Compiler warnings
+calc is C99 compliant, and is ANSI/C90 compliant except
+for wanting 64-bit long long. Changing the two
+long long typedefs to long, and compiling with
+gcc -m32 yields a program that operates on 32-bit values,
+with wrap-around of shifts mod 32:
+1<<48
+65536 0x00010000cc prog.c -o prog). This is my workaday compiler. gcc
+is also clean with -ansi, and -std=c99.
+-Wno-return-type -Wno-parentheses -Wno-empty-body-ansi -pedantic, there are two
+warnings, which can be ignored:
+
+ISO C90 does not support 'long long'-Wall -std=c99, both are quite noisy, and all can
+be ignored:
+
+array subscript has type 'char' [-Wchar-subscripts]value computed is not used [-Wunused-value]operation on 'j' may be undefined [-Wsequence-point]Test Suite:
+e, it echoes
+stdin to stdout. This allows for a convenient
+test suite:ln -sf prog eprog
+PATH=. eprog < test.in | diff - test.outSpoilers:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/burton
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 dogon
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/dogon
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Gil Dogon
+Location: ILTo build:
+makeWIDTH and
+HEIGHT variables when compiling (default 1024 x 800):make clobber WIDTH=640 HEIGHT=480To use:
+./progTry:
+./progAlternate code:
+q to
+0x82000820000000 instead of 0x820008202625a0
+to see a bug that they avoided, writing:
+To see this bug in action change the assignment above
+to q=0x82000820000000`, and look towards the negative
+direction of the main tunnel.Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Alternate try:
+Judges’ remarks:
+Author’s remarks:
+What is it?
+./prog with no arguments on an X11-compatible
+system. The scenery, though pseudo-randomly generated should be
+strangely familiar, especially to those still in their teenage years.
+You can navigate using the keyboard arrow keys and the function keys.
+Your speed is a linear function of (n-1) where
+Fn is the last function key you have pressed, and you
+always move in the direction you are looking at. Be aware that you are
+probably some kind of a Creeper as is obvious from looking at the
+program, hence your movement is destructive to the environment. So after
+pressing F12 for warp speed, and moving around randomly, you might find
+yourself in a 3D maze of twisty little passages, from which there is
+only one Esc(ape) key. Note that in theory if you have a specialty
+keyboard with 32 function keys you may even press F31 to reach infinite
+improbability drive speed, though the author had never tested this
+feature. However a hidden comment in keysymdef.h suggests
+the existence of a mythical Sun Keyboard with 35 function keys :)Full disclosure:
+Some extra features:
+
+
+Portability issues:
+
+
+sizeof(int)==4. This seems to cover
+pretty much everything that supports X-windows so would be broken only
+on quite ancient machines, embedded processors, or some big iron 64 bit
+system where sizeof(int)=8.keysymdef.h. I have searched far and wide the lord
+Google’s domain, yet was unable to find a version of the file where
+those assumptions were broken. This enables the important support of up
+to 32 function keys keyboards without spilling over the size limit, and
+allows us to use such fun expression for arrow view control as the
+following:*(a&1?&C:&B)-=(.05 -a/2%2*.1)*!(a-1&4092^3920)Precision issues:
+Obfuscations:
+Portable SIMD programming:
+long long arithmetic’s capability. I think the C99 standard
+assures us that long long has at least 64 bits. Most of
+those bits are unused in normal programs, however here we use them more
+wisely. For example, in the inner loop of the program you have the
+innocent looking expression i+=d. What it does in fact, is
+a SIMD addition of two vectors, each with three signed fixed point
+coordinates, advancing our ray in 3D space!P,
+and the assignment q=0x820008202625a0 sets our creeper
+original position to about (32.5, 32.5019, 2441.406).i+=d
+expression above i has 3 positive components, but
+d has arbitrary signed components, as our ray may face in
+any direction. It seems things should not work, specially as we defined
+both i and d as unsigned! However
+notice that the T (and P) macros convert
+float to signed long longs.i are positive. This only gets
+broken a bit when the final accumulation has a least significant
+negative component. To see this bug in action change the assignment
+above to q=0x82000820000000, and look towards the negative
+direction of the main tunnel.o=o*b>>8. Of course some spare bits are needed
+between the components, so they are spread in the long long
+and reordered as RBG.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/dogon
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 duble
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/duble
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Etienne Duble
+Location: FRTo build:
+makeTo use:
+echo Some text | ./progTry:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+lrand48(3)? Why does the program dump core, when it does :)
+?Author’s remarks:
+Introduction
+prog.c vs prog.alt.c
+How to build
+clang:CC=clang make -emakeHow to use it
+Basic mode:
+$ echo 'I am testing this thing.' | ./prog
+[... rendering ...]
+
+$ ./prog < lorem-ipsum.txt
+[... rendering ...]Interactive mode:
+$ ./prog
+> hello world!!!
+[... rendering ...]
+>Obfuscation:
+
+
+if
+statements, ternary conditionals, and jump-related instructions.
+Instead, recursion is heavily used.
+
+O_o at the top of the
+source file.Limitations:
+Charset
+
+a-z, A-Z, '.' ':' ',' ';' '!' and '?'.\n). Other chars are simply
+ignored (most of the time ;)Stack size
+Line rendering
+Subtleties and extra
+features
+Handling more than text docs?
+$ ./prog < prog.cA ‘draft’ mode
+DRAFT will
+enable the ‘draft-mode’. Try for example:$ echo 'testing the draft mode' | DRAFT=1 ./progThe subtle interactive mode
+isatty()). Did you notice that
+this program does not perform any such detection, but still behaves (or
+seems to behave) appropriately?Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/duble
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 endoh1
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/endoh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anonymous
+2015
Location: JP
Name: Yusuke Endoh
+Location: JPTo build:
+maketcpserver to use.
+If you do not have this program see FAQ 3.14
+- How do I compile and install tcpserver for entries that require
+it.To use:
+tcpserver -v 127.0.0.1 10333 ./prog ioccc.txtJudges’ remarks:
+stdeye-o”
+and “<--mouth”. Can you find any other tributes?Author’s remarks:
+Whirlwind tour
+cc -O3 -std=c99 \
+ -Wall -Wextra -pedantic -o prog prog.c \
+ -Delta_u="Du*laplacian(u)-u*v*v+F*(1-u)" \
+ -Delta_v="Dv*laplacian(v)+u*v*v-v*(F+K)" \
+ -DF=0.040 -DK=0.060 -DDu=0.200 -DDv=0.100 \
+ -DUV_BACKGROUND=1,0 -DUV_DROP=-0.5,0.5 \
+ -DTIMESTEP=1.0 -DSPEED=2 -DRGB=255:128:192tcpserver command in the ucspi-tcp package, which was
+created by Daniel J.
+Bernstein, IOCCC 1991 “Best
+of Show” (README.md).tcpserver -v 127.0.0.1 10333 ./prog ioccc.txthttp://127.0.0.1:10333/ in a modern
+browser supporting HTML5. You can use the mouse cursor to place drops
+into the Petri
+dish interactively.Description
+
+du/dt = F(u, v) + Du * laplacian(u)
+dv/dt = G(u, v) + Dv * laplacian(v)F(u, v) and G(u, v) represent
+reactions of each substance, and the parameters Du and
+Dv are diffusion coefficients. By changing the functions
+and parameters, you can see a wide range of behaviors.Configuration
+Model:
+
+-Delta_u=<expression> -Delta_v=<expression>
+\frac{\partial u}{\partial t} = D_u \Delta u - u v^2 + F (1 - u)
+\frac{\partial v}{\partial t} = D_v \Delta v + u v^2 - v (F + K)
+-Delta_u="Du*laplacian(u)-u*v*v+F*(1-u)" \
+-Delta_v="Dv*laplacian(v)+u*v*v-v*(F+K)"Du, Dv, F, and K
+are parameters of that model.Initial
+pattern:
+
+-DUV_BACKGROUND=<u0>,<v0> -DUV_DROP=<u1>,<v1>u and v. All cells have (u0, v0)
+by default.(u1, v1).Simulation speed:
+
+-DTIMESTEP=ts -DSPEED=spdTIMESTEP is a simulation time step. The bigger, the
+faster but more unstable.SPEED is a frame skip parameter. The bigger, the faster
+but more sluggish.Rendering color:
+
+-DRGB=r:g:bExamples
+Makefile. Do
+one of the following commands and open
+http://127.0.0.1:10333.
+make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 ioccc.txt
+make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 center.txt
+make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 line.txt
+make gray-scott-2 && tcpserver -v 127.0.0.1 10333 ./gray-scott-2 ioccc.txt
+make gray-scott-3 && tcpserver -v 127.0.0.1 10333 ./gray-scott-3 ioccc.txt
+make gray-scott-4 && tcpserver -v 127.0.0.1 10333 ./gray-scott-4 ioccc.txt
+make fitzhugh-nagumo-1 && tcpserver -v 127.0.0.1 10333 ./fitzhugh-nagumo-1 ioccc.txt
+make fitzhugh-nagumo-2 && tcpserver -v 127.0.0.1 10333 ./fitzhugh-nagumo-2 ioccc.txt
+make oregonator && tcpserver -v 127.0.0.1 10333 ./oregonator ioccc.txtCompatibility
+C part
+-std=c99 -Wall -Wextra -pedantic. Since it uses
+long long for 64bit integers, C99 is required.Browser part
+
+
+tcpserver alternatives
+inetd and xinetd
+instead of tcpserver. Here is an example inetd
+configuration.
+10333 stream tcp nowait nobody /path/to/prog /path/to/prog /path/to/initial-pattern.txtInternal
+
+
+References
+
+
+
+
+
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+
+
+Inventory for
+2015/endoh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 endoh2
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/endoh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./progTry:
+./try.shJudges’ remarks:
+
+
+less prog.c
+
+more prog.cAuthor’s remarks:
+cat prog.c
+gcc -w -o prog prog.c
+./progless prog.c. You will see an
+emphasized string if your terminal supports bold.wc -c prog.c. This is very long
+one-liner.vim or
+emacs.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/endoh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 endoh3
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/endoh3
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./progTry:
+./try.sh1984/mullender, and then see what it looks like at the end.
+Send INTR to end the program.cc -o prog prog.c foo.c
+./prog
+^C # if necessary, where ^C is ctrl-C, interrruptprog as whatever foo.c is in the joke
+PDP-11 emulator.Judges’ remarks:
+Author’s remarks:
+Hint / Compatibility
+
+
+main() function.Spoiler
+wget https://www.ioccc.org/1984/mullender.c
+clang -o prog prog.c mullender.c
+./progInternal
+__attribute__((constructor)), which is
+a GCC extension, to hijack the main() function call. And
+then it interprets main() as an instruction sequence.
+
+
+
+
Limitations
+One more thing
+stdout:
+short main[]={5568,1,-30460,12,2782,0,-29921,2056,-4864,6873,770,30054,11886,
+24948,114,21716,-28851,14043,-8944,32691,-16187,-12247,22692,-9781,-20403,
+-11771,16546,18710,17873,9233,31304,-32215,-24382,-28247,-25916,10466,24988,
+-3404,-4177,-28528,-531,-3016,17300,-28552,-7708,-26180,-4297,-367,-2312,
+-25611,28535,-8533,24004,25421,-1224,-5354,-20807,-21589,-6761,-5203,-1055,
+-6715,-26673,-1433,-17732,-24198,14681,-3714,-6660,-14891,-25575,20349,-7701,
+-8336,31433,16695,-14773,26819,3096,-12584,-28808,17825,-21200,-32399,15877,
+-28890,-3728,-27126,21375,-32630,-7615,32004,-29230,-6611,-5508,-28921,12418,
+27204,-5725,9643,3520,26836,-29347,2101,-29311,9320,29287,-29990,-6593,29825,
+-29114,16232,25641,20672,-23501,-32127,-6546,-956,10474,-29647,1070,5516,13760,
+-27814,-32488,-28006,-17968,-3146,10963,19234,22132,23988,7142,5523,9639,-6888,
+-11428,7964,23099,-16822,16518,31109,-12958,10351,2434,3091,3625,2244,27512,
+-28559,-10724,-19377,23625,30056,11478,-21176,27660,26517,-29037,-9390,12297,
+-11903,5980,-21927,-7483,6671,11249,29638,-23827,-26358,-6856,-1063,-5303,
+26636,25797,31818,26798,-4243,-18772,-13266,27472,-12005,-10642,-22524,24373,
+-13111,-9062,6274,-20002,24150,22189,-14965,-31249,-13934,-6341,-18384,-32054,
+-29246,10622,-9260,19428,-15485,2724,23810,16447,11627,18604,2739,27812,30295,
+-21538,-31786,11355,-11308,-9006,-4987,25363,-18927,-21130,-31213,-27411,17231,
+-19608,20232,27754,16476,11213,-19803,-24048,30918,-25329,21233,-10160,13519,
+11828,26653,-6703,10893,6871,-12417,24471,20310,-12137,-19677,4457,-19530,
+10147,17724,533,-10055,27076,10264,11274,-10511,4809,25208,16065,-5105,-19953,
+3772,-12124,13475,-27559,-9955,26446,15133,15207,-23640,6425,-11010,28688,
+-20064,26353,-889,-25008,10380,-14449,-6894,18920,-23900,16902,-31018,16093,
+20875,-19576,4585,13126,18589,24789,19424,31274,-5059,-14538,-3125,-16527,
+-25070,-9013,26628,15756,-7652,30841,-1283,17707,25717,-18315,-6342,6880,
+-19176,6995,5672,2853,-9044,-3409,-14421,-7522,13108,20582,-25317,1376,-5648,
+13821,17300,1220,-29437,-25832,-8332,-15575,-9744,28297,31995,-1217,23852,
+14382,31059,9160,-3296,20287,-28357,24449,-10323,-21992,-4655,-32548,13237,
+-15083,-25226,-21121,2015,-8996,-20247,-27551,-14771,-16089,-6920,-9645,21578,
+7142,-5613,14029,24730,-29253,13931,-3862,-16634,-7388,16951,15771,31302,
+-22186,-6716,18416,1698,-26200,-16231,9821,-10886,-4994,-30527,-9448,-16923,
+29549,-11207,-14909,-3643,-27548,17865,28859,29753,17616,16874,-17733,9424,
+21435,-31715,24544,8666,30844,25075,-18267,12027,-5346,2717,19615,-4548,-21763,
+28514,11691,22268,-2338,1406,-27379,-23568,-24525,13633,11295,-14715,7877,
+-27669,3475,20345,7779,-17849,2184,7132,4079,-24937,11585,22740,5810,-10855,
+16203,-6371,23235,-7,-24828,-11205,-11006,-10,-17812,-14274,11504,-27517,463,
+4498,-32180,-9775,-3190,-22435,-18662,-30146,-31834,-26449,-19374,-12616,
+-10596,14341,-10089,-18449,-16535,21439,21191,-1651,7695,-30009,-23339,-8675,
+-20774,21588,-2793,8218,-14337,-10866,14060,-15343,31712,25247,-8539,18074,
+-28683,-7363,-7663,-3563,-30718,17771,28687,-30495,30584,14022,-28053,5292,
+-31576,-32486,-15470,-1330,23551,-2185,-10829,-13216,-4825,-2964,-14668,24559,
+-4930,23731,-1152,-11493,-2321,15987,-27073,-20305,-24065,-25048,32750,-27440,
+-1169,-25633,-4356,-24993,30439,-17165,-4580,8662,22655,-4588,-6162,-3122,
+31986,-2569,20371,-12320,-25613,-16133,-25644,23677,12254,5855,26325,-13425,
+-15903,-1930,-28488,31222,31153,17607,-2758,7594,-8868,30434,-2518,27956,
+-19424,7370,6199,-17602,17347,-14358,25588,11611,-25209,-23701,-27444,-29788,
+2680,-27406,9318,22483,-28356,28482,4577,-14891,17323,-30152,2507,2977,5004,
+-11696,-31623,-15149,13357,28938,-14048,19490,-19860,-26050,10842,-24922,
+-20986,8847,-31184,28519,-29168,32195,10516,25713,-3493,670,31283,-12769,
+-17461,11357,13180,26133,15944,18051,-32167,-27990,16813,17676,21787,-17578,
+11173,19093,2836,656,-15239,4632,23937,4106,-21655,-7494,-21575,-17647,-18465,
+-14654,-29990,-10707,-12440,21465,5822,26164,-1404,-14303,-26635,-6900,-23611,
+11998,-18551,971,27579,13325,4579,23059,29281,22291,29880,-17546,25664,-14990,
+-526,-35,28218,-3214,11965,11263,6633,30719,32400,-29,-3733,24383,32678,-27542,
+-4444,6196,5975,-19722,11902,16840,-11680,11146,-26391,-8980,21573,-9043,2349,
+-12887,5916,-2996,10410,-23374,26338,11867,-14518,18281,14450,-5815,13842,359,
+25450,27043,3355,13423,-20880,-26311,-30720,-2503,-6046,-18156,-18558,-14774,
+-15664,-29001,3365,-12689,10233,23608,24692,12039,15445,18411,-27469,3764,
+-10841,22672,23844,2282,-12443,2851,-27163,13651,13738,17201,-29819,27414,
+-29764,-5308,-16171,-32427,-26312,-7460,-27376,-6004,25717,29254,-15015,8754,
+15493,22232,-28513,-23355,23676,7736,10571,-8120,-16677,7696,32549,-2646,25538,
+3498,30960,-28459,24716,12655,-10496,402,26209,482,-16661,-20350,-3403,14015,
+32299,11262,-25886,4092,-7843,-100,-1975,-58,-3729,-19269,-23583,-6929,20000,
+-6089,17780,-3250,29830,19954,-29277,27896,10330,9277,-25358,31279,-14454,
+24203,-30170,12872,-21973,-25773,-10502,-6647,-26143,6394,-13479,-24559,23007,
+-21844,1505,24702,-23187,-24364,-20470,20765,-7107,15674,9404,17408,17964,
+19820,18952,2154,-26052,30056,-3227,17770,-8557,-31018,-27700,-25974,9003,
+18218,22730,-19981,6737,3532,1562,-23626,14990,28472,-5270,17358,-32204,-29197,
+-3647,4296,8588,25302,-23906,30328,-29119,-24392,8992,-16557,31530,-31216,
+14107,13041,-6976,7529,-8296,17865,-1462,8181,-21588,-131,-10177,-25931,-14627,
+8301,3708,-32097,20808,13892,-21179,1192,20853,3249,-8774,20843,3520,24954,
+-14215,-25170,-16170,2390,25964,-23923,-17464,-7177,-27568,-9880,-4647,-7323,
+15388,2113,-12338,-7737,26255,26818,-22156,-19610,-911,-17057,-556,29935,27647,
+31806,23676,-18132,-19234,-10869,-3715,24983,-10900,-29564,19856,-16392,-31860,
+-25826,24077,12080,15383,-29852,-2266,-27217,31931,-3183,17385,-14211,19050,
+-2449,-468,-2871,-11466,973,2866,649,1367,-8688,-24069,20992,25139,-25850,1184,
+15851,785,16951,12160,22337,-21851,1849,-18801,14247,-429,-12682,30881,-11273,
+-24819,-9794,8389,-27287,7525,16633,1328,-26650,32607,-8217,31912,7774,-16188,
+-3546,-6550,-16279,-32696,1940,2577,-23723,-6484,2009,-424,27833,-21763,-13902,
+7044,27360,-18450,27889,23987,3137,-7669,-5784,-7490,24946,32302,26464,-15513,
+28898,2493,-17645,-4615,-13434,-20884,-4058,-29951,-22281,24784,21083,-8536,
+22147,-11261,-15069,20659,2993,19029,21909,6748,-3263,1401,30960,11000,-16871,
+-30566,-14959,-26356,-2885,21526,-26531,31063,12857,4992,-5067,3130,-17602,
+-1732,-6593,30200,24679,3267,310,20733,24863,-15669,7875,-4577,-13821,-22325,
+15548,29744,3733,-14547,21459,22122,3854,-2572,30197,-24770,-21263,8793,-8316,
+1571,28191,-16143,-6446,31524,-26496,-17349,-29097,2806,11281,-7041,-683,14149,
+19689,-22094,-1657,-30904,183,-15226,-6358,25461,461,1495,28345,-10554,-4004,
+27119,13484,-21600,-12272,-7272,-14064,-299,10697,11280,19066,-9841,-7265,
+-18002,19906,-17247,21482,-10939,-5897,-22300,-13978,27575,-8684,-6222,-19041,
+5788,-30863,-10134,15142,2895,14705,-17713,12940,-21535,-11619,29416,18417,
+-24973,24867,-26462,-24910,-32556,-26705,-7187,-7750,-758,-14809,20289,9260,
+13778,-1422,30301,-1922,30646,27662,-15465,-912,29340,13846,-1263,28887,-20019,
+32421,-29411,-27632,-7495,-8368,29230,-6386,-19536,-5235,2054,1854,23563,12348,
+-15165,-2936,-28063,-15760,20126,-25531,4963,-5739,23182,16895,-17258,-10470,
+-3969,-7742,-140,4475,-24014,-31961,19231,27153,-18551,20157,26443,11530,
+-22214,2284,-24238,-31051,-26422,9088,29868,18458,8488,-9515,6799,-12507,54,
+-19441,-32665,12561,23560,4725,-28617,-14800,-10224,-13503,-17636,-16823,
+-24072,18735,-29798,-23658,-670,-21769,7489,-6468,-8961,-14785,22255,11582,
+-29831,16303,-19652,2922,-4362,22966,16173,-18446,-6148,27381,-8493,-32289,
+24005,-3027,-18665,-16472,-17793,-27027,-7443,17854,31365,-17726,-2510,-17546,
+14893,21773,-23634,21117,32533,6637,-1106,-8152,-3672,-113,-2149,-34,-22700,
+-4102,-28533,-14104,-10086,4378,13695,-15320,-28258,2246,7595,30021,13281,
+-11968,-29983,14274,27152,26713,19434,17058,1142,-3043,-16496,18630,-11976,
+29168,-3634,32746,27287,-268,16711,-8712,-471,12895,17406,-22548,-3969,-10733,
+13128,10530,-31667,7929,-32277,30926,-1983,8401,-7705,6790,4532,1442,26728,
+29600,-15358,21622,9744,11406,15989,-30741,-15044,29913,24534,6774,-3755,17623,
+19647,18762,10042,9653,-5889,2408,-32579,-6285,-28559,-30655,6294,-21175,4390,
+1668,25437,2821,21066,-13680,5274,-27253,-5248,-26307,29744,-26428,25358,17196,
+15199,-29784,-4604,25653,-8048,-23131,-28995,31340,-9558,26186,11268,27916,
+9646,-7389,-11384,-29116,-4100,160,18394,7856,738,-25920,12148,24713,-31664,
+8203,-25556,13494,30352,29161,30898,1432,-5991,25411,1344,-4019,22299,15685,
+-16401,-23136,-28110,11874,-18945,1879,2,0,-32256,-20996,-18169,29220,12,0,0,0,
+335,-27277,-30776,20480,0};Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/endoh3
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 endoh4
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/endoh4
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./prog <a number of arguments>Try:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+Author’s remarks:
+gcc -o prog prog.c
+./prog @
+./prog @ @
+./prog @ @ @
+./prog @ @ @ @
+./prog @ @ @ @ @ @
+./prog @ @ @ @ @ @ @ @
+./prog @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/endoh4
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 hou
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/hou
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Qiming HOU
+Location: CNTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+echo something | ./prog
+./prog < fileTry:
+echo "" | ./progJudges’ remarks:
+./prog < prog.c | cut -c-5
+./prog < Makefile | cut -c-4./prog < large_fileAuthor’s remarks:
+double.pow(2,(?/12)) and
+exp(-?*?) (names redacted). You can also find a bunch of
+cosines and polynomial evaluations.Why obfuscated
+printf,
+int main(), array indexing), there isn’t a single integer.
+Even getchar() and EOF are immediately
+converted.bool counts as an integer type too, there is no
+boolean either. No comparison, no if, no ?:,
+no || &&. Everything is done in a
+single loop that terminates on printf(3). Straight up
+arithmetic.floor(3) and ceil(3) are technically
+double-to-double functions, but they feel like cheating. Yes
+cos(3), no floor(3).Limitations
+
+
+double type as
+IEEE754-compliant 64-bit floating point numbers. The 80-bit intermediate
+format used by x87 is considered as an violation of this. The code
+should print an error message on such platforms.
+
+volatile. The code is
+formatted to warn about that, though.
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/hou
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 howe
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/howe
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anthony C.
+Howe
Location: CATo build:
+makeTo use:
+./prog file1 file2
+
+./prog -d file1 file2Try:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+-d, is compatible with
+POSIX diff(1) and is suitable for use with
+patch(1).Author’s remarks:
+Features
+
+
+patch(1).Description
+diff(1) tool using an O(NP)
+algorithm, compared to the older O(ND) difference
+algorithm used by some versions of diff(1). Its output
+is based on the default diff(1) output described by POSIX
+and the
+Open Group Base Specifications. The output is suitable for use with
+patch(1).-d option simply writes the edit distance between
+file1 and file2.Observations
+diff(1). The
+bottleneck appears to be in the file I/O and line hashing with an
+average +0.05s slower. Using a huge file like “War And Peace” for
+testing offsets the diff(1) optimised file I/O.Support Files
+
+
+patch(1)
+support.References
+
+“An O(NP) Sequence Comparison Algorithm”;
+http://myerslab.mpi-cbg.de/wp-content/uploads/2014/06/np_diff.pdf
+http://www.isthe.com/chongo/tech/comp/fnv/index.html
+https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+IEEE Std 1003.1, 2013 Edition
+http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html
+Algorithmica, 1986, pages. 251-266
+http://www.xmailserver.org/diff2.pdf
+Software-Practice And Experience, Vol. 15(11). 1025-1040 (November
+1985)
+http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.189.70&rep=rep1&type=pdf
+Comm. of ACM, Vol. 18, June 1975, pages 341-343
+http://www.mathcs.emory.edu/~cheung/Courses/323/Syllabus/DynProg/Docs/Hirschberg-LCS-1975.pdf
+http://programmers.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speedCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/howe
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 mills1
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/mills1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Mills
Location: USTo build:
+makeTo use:
+./progTry:
+./progJudges’ remarks:
+./try.shmake clobber all DW=199999 DW=22 DH=16 DA=50 DI=-150
+./prog
+# Game parameters
+#
+DU=99999 # Time between steps in microseconds.
+ # Make it larger if the game is too fast for you.
+
+DW=28 # Pipe-to-pipe spacing, in columns.
+ # Farther apart is easier.
+
+DD=20 # Space between pipes.
+ # The difference between DD and DW is the width of a pipe.
+ # Narrow pipes are easier to fly though.
+
+DH=8 # Height of gap in pipe.
+ # Make this larger to make the game easier.
+
+DA=100 # Acceleration due to gravity (scaled by 256).
+ # Smaller values make you glide slower.
+
+DI=-200 # Impulse velocity of a flap (scaled by 256).
+ # Make larger if you want a less intense tapping experience!
+
+DB='"<o^="' # Sprite for player when gliding.
+ # HINT: Try using various emojis.
+ # NOTE: The string MUST be enclosed inside double quotes.
+
+DF='"<ov="' # Sprite for player when flapping.
+ # HINT: Try using various emojis.
+ # NOTE: The string MUST be enclosed inside double quotes.
+
+DG='"Tap to Flap!"' # Instruction text.
+ # Change to your native tongue.
+ # NOTE: The string MUST be enclosed inside double quotes.
+TAP!! TAP!! TAP!!
+FLAP! FLAP! FLAP!Author’s remarks:
+The Program
+Instructions
+Customization options
+
+
+-DU: Time between steps in microseconds. Make it larger
+if the game is too fast for you.-DW: Pipe-to-pipe spacing, in columns. Farther apart is
+easier.-DD: Space between pipes. The difference between
+D and W is the width of the pipe. Narrow pipes
+are easier to fly though.-DH: Height of gap in pipe. Make this larger to reduce
+the challenge.-DA: Acceleration due to gravity (scaled by 256).
+Smaller values make you glide slower.-DI: Impulse velocity of a flap (scaled by 256). Make
+this smaller if you want an intense tapping experience!-DB: Sprite for player when gliding.-DF: Sprite for player when flapping.-DG: Instruction text. Change to your native
+tongue.curses library on POSIX doesn’t
+natively support wide characters (needed for UTF-8 support, which is
+needed for emojis), you may need to make some changes to the
+Makefile to get emojis to work on your system. To help you
+get started, I’ve included some example substitutions for emojis sprites
+and instruction text; for example, typemake EMOJI=beer LANGUAGE=spanishmake EMOJI=globeMakefile). Don’t forget to make clobber first
+(or use make -B). If the output doesn’t look right, you may
+need to link with the “wide” version of ncurses. On MacOSX
+10.11, it should work with the current -lcurses; on Linux,
+you might need -lncursesw. See the Makefile to
+make this change if you need to. Or buy a Mac.LANG environment
+variable set to use UTF-8. Again, if this is too complicated, maybe just
+go and get that Mac.Future additions
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/mills1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 mills2
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/mills2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Mills
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog compressed_file.ZTry:
+./try.shJudges’ remarks:
+atob
+functionality. Now we wish for a compress(1)-like
+compressor using a similar idea. c=0) :( OAuthor’s remarks:
+The Program
+zcat(1)
+command for printing compressed files that have been created by the
+compress(1) command.compress(1) usually requires a
+fairly large amount of memory to build the decompression tables (in
+fact, compress(1) has a command-line option to control the
+size of the decompression tables, since some of the early systems to
+which it was ported (*cough*MS-DOS*cough*)
+did not have enough memory to use the full 16-bit codes). This version
+has no large static or dynamic tables. It is able to decompress 16-bit
+files using a single function and a few ints.compress(1) hanging about on your system, I’ve provided
+compressed copies of this year’s IOCCC rules and guidelines files. To
+print them, just do./prog ioccc_guidelines.txt.Z
+./prog ioccc_rules.txt.ZThe Details
+
+
+compress(1) encoder reserves a code word that
+clears the coding tables. When this is encountered, the computation of
+offsets and bit sizes reset.compress(1) decoder is designed to always read a
+block of eight code words at the same time, so that it need only read
+N bytes to get eight N-bit code words. When
+the “clear” code is encountered, the entire eight-word block is flushed
+(since the decoder didn’t know the word size would change). The program
+needs to account for this extra flushing.Limitations
+compress(1) in its
+default mode, the maximum word size will be 16 bits and “block mode”
+will be enabled. You are unlikely to find any files that don’t use
+“block mode”, since all versions of compress(1) after 2.0
+(circa 1984) use it by default and have no documented way to disable it.
+Reducing the bit depth is still possibly by using the -b
+flag. Modern systems have no problem with the 200 KB or so needed for
+16-bit decoder tables, so the need for reducing the table size has
+passed, hence this program always assumes 16-bits… However, should you
+find a file that needs a smaller table, feel free to change the
+hard-coded 16 in the source into the appropriate number and
+recompile.compress(1), which might have come to pass in an alternate
+universe where the VAX
+on which compress(1) was authored had been big-endian.
+Luckily for us, it wasn’t, and neither are most of the systems you might
+want to compile this for.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/mills2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 muth
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/muth
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dominik Muth
+Location: DETo build:
+makeTo use:
+make -B [MACHINE=your_machine.h] [TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] runTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Preprocessor Turing Engine
+Features
+
+
+#ifs or other conditional directives, only
+#defines#include
+
V=0 (default) only prints the final tapeV=1 additionally prints one tilde character per machine
+step (slow)V=2 additionally prints details on each machine step
+(slow; generates large files)run runs ./prog and filters a
+little statistics out of the verbose outputX (defaults to 3) sets the maximum number of steps:
+M(X) ~ 8XLimitations
+X) steps,
+you will see unexpanded macros in the output.Compiler warnings
+V=1 or V=2 is used, you may see
+“warning: string length is greater than the length '4095' ISO C99 compilers are required to support”.Programming
+Tape Symbols
+_) must be explicitly declared
+using#define sym_SYMBOL(sym, _SYMBOL) sym#define sym_1(sym, _1) symTape
+#define tape ((((,),...l2), l1), c, (r1, (r2..., (,))))
+
+l1, l2, … are the symbols to the leftc is the symbol at the current positionr1, r2, … are the symbols to the
+right(,) represent the continuations of the
+tape, filled with underscore symbols (_). They are expanded
+on demand.State Machine
+
+#define CURRENT_SCANNED (WRITE, MOVEMENT, NEXT)
+
+CURRENT is the current state.SCANNED is the symbol at the current position.WRITE is the symbol to be written to the tape.MOVEMENT is L for left, R for
+right; don’t specify anything if you want no movement.NEXT is the next state.A defined, which becomes the
+initial state of the machine.break as in#define A_1 (2, break)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/muth
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 schweikhardt
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/schweikhardt
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Jens
+Schweikhardt
Location: DETo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog nTry:
+./try.shJudges’ remarks:
+cc -Weverything -pedantic -std=c11 -Dtyp=uint64\_t -O3 prog.c -o prog
+ complexity of the solution
+yummo quotient = -----------------------------------
+ complexity of the problem statement
+
+./prog 2410
+./prog abfff
+./prog 27f8cebf
+./prog 246f8fddf
+./prog 2e95ab51ffea9de
+./prog e6a5c22fd7bde9f
+./prog 1b7dd73a937485bf
+./prog 7d3237680d190a77e53751b
+./prog 302ab3d052fb87c06228d249581be0e4less(1).Author’s remarks:
+The TL;DR version
+What this program does.
+n. If n is even,
+divide it by 2 to get n/2. If n
+is odd, multiply it by 3 and add 1 to obtain
+3n + 1. Repeat the process indefinitely.1.
+
+n = 6 is
+
+
+−1, −2, −1
+
+−5, −14, −7, −20, −10, −5
+
+−17, −50, −25, −74, −37, −110, −55, −164,
+−82, −41, −122, −61, −182, −91, −272, −136,
+−68, −34, −171. The number n is specified in
+hexadecimal (without 0x prefix) as the first argument. The
+program prints the given number in zero-padded hex and each iteration
+along with a line count in decimal. The example above looks like this
+(compiled with 64 bit word size):$ ./prog 6
+0000000000000006
+0000000000000003 1
+000000000000000A 2
+0000000000000005 3
+0000000000000010 4
+0000000000000008 5
+0000000000000004 6
+0000000000000002 7
+0000000000000001 8n is only limited by the argument size limit
+of your shell/OS (the program implements arbitrary size
+bignums). To query this on your POSIX system, run$ getconf ARG_MAX
+262144$ printf 'obase=16;10^100\n' | bc
+1249AD2594C37CEB0B2784C4CE0BF38ACE408E211A7CAAB24308A82E8F1000000000\
+0000000000000000
+$ ./prog 1249AD2594C37CEB0B2784C4CE0BF38ACE408E211A7CAAB24308A82E8F10000000000000000000000000 \
+| less
+[...]n the program behavior is one of the
+following 3:
+
+n < 4FFDD776055A0000 (~1018) so don’t try
+anything less than that.n leads to a sequence with ever bigger
+numbers, so that eventually the bignum cannot be stored in
+memory. If this happens, the program outputs laugh (more
+likely) or throw up (less likely) and stops. You
+might have found a number for which the sequence
+diverges. If confirmed, this disproves the conjecture.n leads to a cycle not including 1
+(i.e. runs forever, repeating the same sequence over and over). You have
+disproved the conjecture and should certainly submit a paper to the
+nearest mathematical journal.Design objectives
+
+
+bignums are required.bignums. Make the user select the widest type
+supported by the implementation and then crunch away. If a non-standard
+128bit type is available, it should be usable.Program Obfuscation
+
+
+#include lines#define and
+#include linesLook at the original source
+
+ ala Alanine
+ cys Cysteine
+ asp Aspartic acid
+ glu Glutamic acid
+ phe Phenylalanine
+ gly Glycine
+ his Histidine
+ ile Isoleucine
+ lys Lysine
+ leu Leucine
+ met Methionine
+ asn Asparagine
+ pyl Pyrrolysine
+ pro Proline
+ gln Glutamine
+ arg Arginine
+ ser Serine
+ thr Threonine
+ sec Selenocysteine
+ val Valine
+ trp Tryptophan
+ tyr Tyrosine
+ asx Asparagine or Aspartic acid
+ glx Glutamic acid or Glutamine
+ xle Leucine or Isoleucine
+ unk Unknown
+and Androgynine
+xor Xenoricine
+not Notanamine
+tla Triletraminemet is
+“main()'s Exit Type” (int), ala
+is “A Large Algebraic” (bignum),
+ile an “Incremented Local Entity” (index
+counter), gly means “Grow Larger memorY”,
+gln is “Grown Larger Now” (after
+realloc(3)), not is a
+“Not Overflowing Type” (recursive!), unk is
+the “UNit (Known as 1)”, trp is the
+“Tabula Rasa Product” (zero), phe is
+“Print HEx” and so on.Convert ANSI trigraphs to
+ASCII
+C pre-process
+the source ignoring
+#include lines<stdint.h> and EOF + __STDC__
+trivialities). Did you gain any insight through this?C
+pre-process the source ignoring ‘#define’ and ‘#include’ lines
+#define? Which #define directives? How many
+4K source files do you see that don’t use a single #define
+directive or abuse the build file? Even though the “no
+#define” rule I submitted myself to made it hard, I could
+use __LINE__ and stdio.h macros
+EOF, L_tmpnam, BUFSIZ,
+FILENAME_MAX, TMP_MAX to obfuscate at least
+something.Run it through a C
+beautifier
+.indent.pro with FreeBSD indent:$ cat .indent.pro
+ -bad /* blank line after decls */
+ -bap /* blank line after functions */
+ -br /* braces on if line */
+ -i8 /* indent */
+ -l999 /* line length */
+ -npcs /* no space after function call names */
+ -npsl /* don't break procedure type */
+ -ut /* use tabs */
+ -ce /* cuddle else */
+ -nip /* no parameter indentation */
+ -di1 /* declaration indent */
+ -Tand
+ -Tmet
+ -Tthr
+ -Tpro
+ -Tser
+ -Tala
+
+#includes of non-suspicious standard
+headerstypedefsstatic for internal
+linkage even! This must be a first in IOCCC
+history.main lastconst-poisoned: automatics,
+statics, arguments, even main__STDC_VERSION__ was a bit tough to arrive at,
+since 199901L has too many bits set. But I realized that I only needed a
+number larger than 199409 and less than 199901. 199680 has only 4 bits
+set and writing it as (256 + 128 + 4 + 2) * 512 minimizes
+the character count. That’s what judges get when they don’t like
+programs that are longer than they need to be.Examine the algorithm
+/* run */
+if (non-NULL and nonempty argv[1]) {
+ n = convert(argv[1])
+ print n /* 2hx */
+ while (n != 1) { /* one */
+ if (n is odd) { /* odd */
+ m = deep copy of n /* cpy */
+ n <<= 1 /* shl */
+ n += m /* add */
+ increment n /* inc */
+ } else { /* eve */
+ n >>= 1 /* shr */
+ }
+ print n /* 2hx */
+ }
+}Bignums are represented as the two member
+structs:typedef struct {
+ size_t places; /* number of places in base 2 to the power of (8*sizeof(type)) */
+ type *number; /* dynamically allocated memory for number */
+} bignumCompile it (with
+flags to enable all warnings)
+clang -Wall -Wextra -Weverything -Dtyp=uint32_t prog.c all
+you can do? Clang has implemented a new warning? Bring it on!Execute it
+argv[1] and interprets them as a hex digit. In ASCII the
+characters a-f, A-F and 0-9 are
+converted as expected../prog "$(cat prog.c)" # Kind of quine?
+./prog "$(cat rules guidelines)" # A jackpot? Maybe next year...
+./prog "$(cat /bin/ls)" # Number cut short at first NUL byte.Assumptions made
+
+
+EOF macro from <stdio.h> must
+expand to -1 since it is used to decrement a pointer and do
+some other math. None of the tools catch this one. The program
+self-protects against unusual systems with
+#if EOF + __STDC__ followed by #error goofy!.
+In the rare event your system is goofy, replace all EOF
+tokens with (-1) and remove the #error
+directive.sizeof(typ) << 3, it will
+work correctly on 24-bit or 36-bit systems with 9 bits/byte, or systems
+where sizeof(typ) is 1 even for int and so on.
+On such systems, it will only use 8 * sizeof(typ) bits per
+place. It does not work when CHAR_BIT <= 7.Results of various checkers
+cppcheck
+cppcheck --enable=all --force -I/usr/include -Dtyp=uint32_t prog.cflawfinder
+typ macro being
+defined:$ flawfinder prog.c
+Flawfinder version 1.31, (C) 2001-2014 David A. Wheeler.
+Number of rules (primarily dangerous function names) in C/C++ ruleset: 169
+Examining prog.c
+FINAL RESULTS:
+ANALYSIS SUMMARY:
+No hits found.valgrind
+
+valgrind --leak-check=full --show-leak-kinds=all ./prog 6
+[...]
+==14615== HEAP SUMMARY:
+==14615== in use at exit: 4,096 bytes in 1 blocks
+==14615== total heap usage: 4 allocs, 3 frees, 4,108 bytes allocated
+==14615==
+==14615== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 1
+==14615== at 0x4C236C0: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
+==14615== by 0x4F62175: ??? (in /lib/libc.so.7)
+==14615== by 0x4F62073: ??? (in /lib/libc.so.7)
+==14615== by 0x4F514EE: ??? (in /lib/libc.so.7)
+==14615== by 0x4F51265: vfprintf_l (in /lib/libc.so.7)
+==14615== by 0x4F3E001: printf (in /lib/libc.so.7)
+==14615== by 0x40101E: phe (in ./prog)
+==14615== by 0x400A9F: main (in ./prog)
+==14615==
+==14615== LEAK SUMMARY:
+==14615== definitely lost: 0 bytes in 0 blocks
+==14615== indirectly lost: 0 bytes in 0 blocks
+==14615== possibly lost: 0 bytes in 0 blocks
+==14615== still reachable: 4,096 bytes in 1 blocks
+==14615== suppressed: 0 bytes in 0 blocks
+==14615==
+==14615== For counts of detected and suppressed errors, rerun with: -v
+==14615== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)printf(3) allocated a single
+4K block for which no matching free(3) existed. But how to
+free memory allocated deep down in the guts of the Standard I/O library?
+After some serious head scratching it hit me. The only chance I have is
+telling the system I no longer want to do I/O, maybe then it would free
+that buffer. A reading of C99 7.19.5.1, “The fclose function”, was
+encouraging:
+
+setbuf or
+setvbuf function is disassociated from the stream (and
+deallocated if it was automatically allocated).fclose(stdout) before returning and now:
+valgrind --leak-check=full --show-leak-kinds=all ./prog 6
+==14571== Memcheck, a memory error detector
+==14571== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
+==14571== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
+==14571== Command: ./prog 6
+==14571==
+0000000000000006
+0000000000000003 1
+000000000000000A 2
+0000000000000005 3
+0000000000000010 4
+0000000000000008 5
+0000000000000004 6
+0000000000000002 7
+0000000000000001 8
+==14571==
+==14571== HEAP SUMMARY:
+==14571== in use at exit: 0 bytes in 0 blocks
+==14571== total heap usage: 4 allocs, 4 frees, 4,120 bytes allocated
+==14571==
+==14571== All heap blocks were freed -- no leaks are possible
+==14571==
+==14571== For counts of detected and suppressed errors, rerun with: -v
+==14571== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)FlexeLint
+
+
+/* and
+lint). /*lint -w4 turn on everything */
+ /*lint +esym(534,*) no demonstrator defaults */
+ /*lint -e966 indirectly included header file not used */
+ /*lint -esym(9058,_*) tag not used outside typedef */
+ /*lint -misra(2) */
+
+ #include <stdio.h>
+ int main(void)
+ {
+ printf("hello, world\n");
+ return 0;
+ }malloc(3) and printf(3) are
+right out. But that’s too restrictive for an IOCCC hosted application,
+so I ignored these:
+
+FlexeLint’s -w4 option and disabling all noise
+from system headers. Then I dealt with the remaining messages by
+addressing them or suppressing them in such a way that the set of
+suppressions was minimal. At the end of the day, this is what
+remained:
+ // === Tested with FlexeLint 9.00L on FreeBSD 11 ===
+ // Compiler:
+ // "4.2.1 Compatible FreeBSD Clang 3.6.1 (tags/RELEASE_361/final 237755)"
+
+ -w4 // Enable maximum pickiness
+ -passes(6) // Recommended in FlexeLint manual for torture testing
+ +fsc // Make string literals have type const char*
+ +fnr // ptr-returning functions may return NULL
+ -strong(AJX,and,pro,ser,ala) // strong types
+ -strong(AcJcm,thr) // thr is strong, but most arithmetic is okay
+ -strong(AarJemorX,met) // met is strong, but some use is okay
+ +libclass(angle) // All <headers> are system headers
+ -wlib(1) // Only errors for system headers
+ -i/usr/include // System headers
+ -i/usr/local/lib/supp/ansi // Comes with FlexeLint
+ -d__GNUC__=4 // Pretend...
+ -d__GNUC_MINOR__=2 // I'm...
+ -d__GNUC_PATCHLEVEL__=1 // someone else.
+ -d__builtin_va_list=char* // Fake this compiler extension
+ -d__inline= // Delete this compiler extension
+ -d__attribute__(x)= // Delete this compiler extension
+ +e900 // Announce number of messages produced
+
+ // MISRA 2004 checking
+
+ /usr/local/lib/supp/lnt/au-misra2.lnt // Enable all MISRA checking
+ -elib(960) // Don't check FreeBSD system headers for required rules
+ -elib(961) // Don't check FreeBSD system headers for advisory rules
+ -e829 // stdio.h used
+ -e522 // MISRA 14.2 Highest operation, lacks side-effects
+ -esym(960,17.4) // pointer arithmetic other than array indexing used
+ -e971 // char without signed/unsigned
+ -e974 // stack usage report
+ // Use verboten functions, Req. Rules 20.4 malloc() et al., 20.11, exit()
+ -esym(586,malloc,realloc,calloc,free,exit)
+
+ -e911 // implicit promotion of smaller than int to int
+ -e921 // cast from integral to integral
+ -e925 // cast from pointer to pointer
+ -e958 // padding required in struct
+
+ +e9??? // Enable all 9xxx informational messages, except:
+ -e9079 // conversion from pointer to void to pointer to other type
+ -e9087 // cast performed between a pointer to object type and a
+ // pointer to a different object type
+ -e9141 // global declaration of symbol
+
+ // Messages due to code in FreeBSD headers.
+ //
+ -dlint // The "lint" macro is tested in x86/_types.h
+ -elib(537) // Repeated include file
+ -e793 // external identifiers > 6 chars
+ -e935 // (unsigned) int within struct (actually the size_t)
+ -estring(960,_*) // Could be defined at block scope
+ -e964 // Header file not directly used
+ -e966 // Indirectly included header file not used
+ -elib(970) // int outside typedef
+ -esym(9003,_*) // could be defined at block scope
+ -elib(9047) // FILE pointer dereferenced
+ -esym(9058,__*) // tag not used outside typedef
+ -e9092 // NULL does not expand to a pointer (but plain 0)Compulsory obfuscations
+char type shall be used only for
+the storage and use of character values.” This forbids using character
+constants in expressions other than assignments to char
+objects. A consequence is that printing digits with
+'0' + digit is not allowed (even though '0' is
+technically an int!) so I am forced to output hex digits
+withprintf("%c", (met)tyr + 32 + 16 + ((8 + EOF) * ((met)tyr / (8 + 2))));printf("%c", '0' + tyr + 7 * (tyr / 10), MISRA?typedefs that indicate size and signedness
+should be used in place of the basic types.” Well, if you can’t infer
+the size and signedness from typedef int met, you’re not a
+real C programmer.~ and
+<< are applied to an operand of underlying type
+unsigned char or unsigned short, the result
+shall be immediately cast to the underlying type of the operand.”
+Because the program must work for any unsigned type chosen for the
+typ macro, including the narrow types enumerated in the
+rule, a lot of redundant casting ensues. It gets worse with the next
+rule…const ser glx = (ser)((asx > (ser)64u) ? (ser)((ser)asx + (ser)8u + (ser)1u) : (ser)asx);
+not.not[leu] = (and)((and)not.not[leu] | (and)(((and)glx % (and)16u) << (and)lys));return now cause
+another useless indent level. The first three if
+statements in main() cause a silly 24 character indent. The
+maximum indent is forced to 8, which is way too high for a sane
+function.void would
+draw a lint warning, so I use the printf(3) result in
+expressions,lys -= 4 * printf("%c", (met)tyr + 32 + 16 + ((8 + EOF) * ((met)tyr / (8 + 2))));
+val += printf("\n") / ((__LINE__ * L_tmpnam) + TMP_MAX);
+val -= (printf(" %d\n", val) > BUFSIZ) ? FILENAME_MAX : EOF;lys -= 4;
+/*nop*/
+++val;if ((p = malloc(n)) == NULL) and requires separate
+statements, in other words, bloat.const if the pointer is not used to
+modify the addressed object.” in conjunction with lint’s “Note 952:
+Parameter could be declared const” causes
+const-poisoning for all functions,static void phe(const ala not);
+static void gly(ala *const not, const and his);
+met main(met val, const pro *const his[]);Why the “laugh” and “throw
+up” messages?
+If you have a 128 bit type
+typ macro:clang -Dtyp=__uint128_t -o prog prog.cclang -Dtyp=uint8_t -o prog8 prog.c
+clang -Dtyp=uint16_t -o prog16 prog.c
+clang -Dtyp=uint32_t -o prog32 prog.c
+clang -Dtyp=uint64_t -o prog64 prog.c
+clang -std=c89 -Dtyp="unsigned long" -o prog89 prog.cSCN or PRI macros to do the scanning and
+printing of variables of these types. With a 128 bit type the program
+can represent numbers up to 340282366920938463463374607431768211457
+(3.4 * 1000000000000000000000000000000000000000) as a
+single “place”, enough to explore yet untested numbers for the rest of
+your life.How big a number
+can I test with 4 GB of RAM?
+ARG_MAX, probably minus some overhead for the environment
+variables (use env(1)
+to trim your environment). In bits this leaves you with
+2 to the power of (4 * ARG_MAX).bignums in memory for
+addition. If you hit a divergent number, this will cause out-of-memory
+(“laugh”) somewhere near 216,000,000,000
+(4GB/2 * 8bits/byte). Sadly, I don’t have a test case
+:-)3*n* + 1 to 4*n, and
+assume we never need to divide by two (which is quite optimistic). Then
+each iteration shifts left by 2. This would take 8 billion seconds, or
+about 250 years. If you want to get famous, you better remove
+some of the RAM, use an ancient box, or reduce available memory
+resources with the ulimit(1) built-in of your shell.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2015/schweikhardt
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2015 yang
+
+
-
+ The International Obfuscated C Code Contest
+ 2015/yang
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeTo use:
+echo Some text | ./progTry:
+./try.shJudges’ remarks:
+Fuuko and so the
+source file referred to in their remarks uses fuuko.c. The
+Makefile will compile everything so you need not
+worry about this.Author’s remarks:
+Fuuko is a sea star generator.
+Feed her some input through stdin to get lots of sea star
+patterns on stdout.cc -O3 -std=c90 fuuko.c -lm -o fuuko_c90
+echo IOCCC | ./fuuko_c90 > output_c90.ccc -O3 -std=c99 fuuko.c -lm -o fuuko_c99
+echo IOCCC | ./fuuko_c99 > output_c99.cg++ -O3 -std=c++98 fuuko.c -lm -o fuuko_cpp98
+echo IOCCC | ./fuuko_cpp98 > output_cpp98.cg++ -O3 -std=c++11 fuuko.c -lm -o fuuko_cpp11
+echo IOCCC | ./fuuko_cpp11 > output_cpp11.ccc -O3 -std=c11 fuuko.c -lm -o fuuko_c11
+echo IOCCC | ./fuuko_c11 > output_c11.cstdout, filled with pointer dereferences (C stars).Fuuko and give them pointers all day
+long.Compatibility
+Fuuko has been tested under these environments:
+
+Features
+Fuuko is still able to
+exploit a few of those. It should be an interesting exercise for the
+reader to figure how she did it.Fuuko.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2015/yang
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 algmyr
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/algmyr
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Anton Älgmyr
+Location: SETo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+cat prog.c | ./prog # Print garbage: might mess up your terminal
+./prog <file1> <file2> > out.raw
+./prog -d 2 0 out.raw # Decode the first (0th) channel out of twoTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+What is this?
+-d flag. Usage instructions is output if run with the
+-h flag, albeit not in an immediately legible format.Details
+-h flag is given, usage instructions is
+used as a source. Else if file paths are present as arguments those will
+be used. Else stdin is used.{10, 32-126} then that character is output into frequency
+space of an audio signal (44.1 kHz single precision float, endianness
+should depend on system endianness) through stdout. Any
+other character will be interpreted and outputted as a space.Limitations
+int is less than
+32 bits.-d or -h is
+fully possible if it is not the first file provided, even though I am
+not sure why you would want to do that.Obfuscation:
+
+
+ifs.#defines, sadly.Data encoding:
+' '
+to '_'. The space was chosen as zero because the data
+contains a lot of zeroes, and quite helpfully the size tool ignores
+whitespace even in strings. Without this fact the program would have
+been too large and the decoding feature would have had to go.
+Fortunately this hole in the size spec was readily available. :)Math:
+floats are used for the waveforms,
+the standard math library is not used at all! Most arithmetic is done
+purely on integers. The only major exception is generating a table of
+sine values which are interpolated to give high resolution waveforms.
+Can you see when the generation is triggered, and how it is done?Printing a string:
+char array not from a
+file descriptor without adding additional logic? Answer:
+ungetc(3) into stdin, one char at
+a time (to be standards compliant). This is used to print the usage
+instructions.Compilation warnings
+gcc -Wall -Wextra -pedantic-Wmisleading-indentation which is sensible
+considering the source code. Whileclang -Wall -Wextra -pedantic-Wempty-body (I like
+loops without bodies), -Wstring-plus-int (since apparently
+some people think string+int is a concatenation) and one of
+the weirder warnings I have seen from me splitting a negative constant
+with whitespace. Compiling usingclang -Wall -Wextra -pedantic -WeverythingMisc
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/algmyr
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 anderson
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/anderson
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Derek
+Anderson
Location: USTo build:
+makeTo use:
+./prog < textfileTry:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+Author’s remarks:
+Compiling the program:
+cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o progfor loop initial declarations, along with additional
+warnings about variable length arrays and lack of a return
+statement.Additional info:
+stdin, will
+produce a pattern of squiggly lines. This pattern is deterministic, and
+it shouldn’t be too difficult to determine from whence they come. There
+is even a comment that describes the highlighted phenomena in the
+source, for those that require a small nudge. With denser text blocks,
+such as an essay or similar prose, the output can be rather pretty, in
+an chaotic emergence sort of way. Try using this file, or the source
+file as inputs.a at the top of the
+source. Other adjustments, such as the exact printed characters, are
+rather easy, once sufficient reverse engineering has occurred.
+Improvements such as proper handling of tabs are left as an exercise to
+the reader.(j=k,j) (near the middle
+of the source) is changed to (j=k,k), the program produces
+different output. The author used gcc 5.4.0, compiled for
+x86_64-linux-gnu. Enabling or disabling optimization
+produces the same results. The author is not sure who is the culprit,
+but instead shrugged and moved on with life. Of course, YMMV with your
+own environment.for loops, one nested in the other. There are also a bunch
+of direct variable assignments, such as j=k. There is some
+filler fluff, such as 0-0+0, but all that sort should be
+rather easy to spot. It was mostly added for the purpose of making
+certain things line up right, and only secondarily to obfuscate.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2018/anderson
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 bellard
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/bellard
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Fabrice
+Bellard
Location: FRTo build:
+makeTo use:
+./prog > lena.ppmTry:
+eog lena.ppm # On Linux
+open -a Preview lena.ppm # On macOS
+
+pngtopam < Lenna.png | pnmscale 0.25 | cjpeg -arithmetic -dct float -quality 14 > small.jpgpngtopam(1) (or pngtopnm(1) for older
+versions) and pnmscale come from the netpbm project and
+cjpeg(1) comes from libjpeg-turbo. If you
+don’t have these tools already see FAQ 3.15 -
+How do I compile and install netpbm for entries that require it? and
+FAQ 3.16 - How do I compile and install
+libjpeg-turbo for entries that require it?.Alternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog.Judges’ remarks:
+small.jpg will be approximately of the same
+size as the raw image data in the program. Compare the level of the
+detail and the artifacts of small.jpg and
+lena.ppm.Author’s remarks:
+
+
+./prog d < lena512.bin > lena512.ppm
+./prog d < fruits.bin > fruits.ppm
+./prog d < vintage_cars.bin > vintage_cars.ppm_setmode(0, 32768); _setmode(1, 32768); must be added
+at the start of the main() function to avoid unwanted carriage return
+characters in the output.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/bellard
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 burton1
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/burton1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dave Burton
+Location: USTo build:
+makeTo use:
+./prog < any-fileTry:
+./try.shAlternate code:
+-Wno- options.Alternate build:
+make altAlternate use:
+prog.alt as you would prog.Judges’ remarks:
+Author’s remarks:
+stdin.
+
+SPOILER:
+
+
+execve(2), or functions built
+upon it (system(3), popen(3), etc).main(){system("hd");} // it's turtles all the way down!char O,o[ 20];L(O){
+putchar ( O+ 48+39 *(9<
+O));} I(O) {L(~ 15);
+O|| puts(o);} main (l){
+for(;~(l=getchar()) ;I(O
+&=15 ))o[ O++ ]=4<
+(4^l >>5) ?l: 46,L
+(l>> 4),L (l&15);O&&
+I(o[ O]=0 );}//157c// 119
+char O,o[20];main(l){for(;~(l=getchar());O||puts(o))o[O++]=isprint(l)?l:46,O&=15,printf("%02x ",l);O[o]=0;O&&puts(o);}
+// 116
+char O,o[20];main(l){for(;O++[o]=~(l=getchar())?4<(4^l>>5)?l:46:0;(O&=15)||puts(o))printf("%02x ",l);O>1&&puts(o);}
+// 115
+char O,o[20];main(l){for(;O[o]=~(l=getchar())?4<(4^l>>5)?l:46:0;(O=-~O&15)||puts(o))printf("%02x ",l);O&&puts(o);}
+// 113
+char O,o[20];main(l){for(;~l;(O=~l?printf("%02x ",l),-~O&15:!O)||puts(o))O[o]=~(l=getchar())?4<(4^l>>5)?l:46:0;}
+// 112
+char O,o[20];main(l){for(;~l;(O=~l?-~O&printf("%02x ",l)*5:!O)||puts(o))O[o]=~(l=getchar())?4<(4^l>>5)?l:46:0;}
+// 111
+char O,o[20];main(l){for(;~l;O||puts(o))O=(O[o]=~(l=getchar())?4<(4^l>>5)?l:46:0)?-~O&printf("%02x ",l)*5:!O;}
+// 110
+char O,o[0];main(l){for(;~l;O||puts(o))O=(O[o]=~(l=getchar())?4<(4^l>>5)?l:46:0)?-~O&printf("%02x ",l)*5:!O;}
+// 109
+char O,o[];main(l){for(;~l;O||puts(o))O=(O[o]=~(l=getchar())?4<(4^l>>5)?l:46:0)?-~O&printf("%02x ",l)*5:!O;}// 102
+I;O(O){putchar(O+48+39*(9<O));}main(l){for(;~(l=getchar());O(++I&15?~15:~37))O(l>>4),O(l&15);O(-38);}
+// 80
+O;main(l){while(~(l=getchar()))printf("%02x%c",l,++O&15?32:10);O&15&&puts("");}
+// 78
+O;main(l){for(;~l;(O=~(l=getchar())?printf("%02x ",l),-~O&15:!O)||puts(""));}
+// 77
+O;main(l){for(;~l;(O=~(l=getchar())?-~O&printf("%02x ",l)*5:!O)||puts(""));}
+// 76
+O;main(l){for(;~l;O||puts(&O))O=~(l=getchar())?-~O&printf("%02x ",l)*5:!O;}$ tr -d '\012' < 109.c | wc -c
+108
+$ tr -d '\012' < 76.c | wc -c
+75
+$ tr -d '\012' < 109.c | cc -o 108 -xc -
+$ verify 108
+$BIGGER SPOILER:
+4<(4^l>>5)?l:46
+with 32>l|l>126?46:l. Both take the same number of
+characters, but the former is a bit more interesting. Bonus question:
+how does the first expression work?BIGGEST SPOILER (and some
+history):
+char o[0]; is illegal (SS 6.7.6.2)
+according to ISO (N1570). And char o[]; is a conditionally
+supported feature (SS 6.7.6.2, 6.10.8.3). However, it works in modern C
+implementations as an extension, including GCC, Clang and TCC, for X86
+and ARM, on multiple operating systems (Linux, OSX/macOS, FreeBSD), so
+it is functionally correct. MicroSoft Visual C++ does not allow
+char o[] or char o[0], and implements its
+close relative char o[1] such that writing more than a
+single char will cause a fault, which is technically
+correct.o[]
+allocates one(!) byte in a zero-filled data area (formerly BSS). The UNIX-derived
+systems this code was run upon all place the storage of O
+and o into a zero-filled VM page with nothing following:
+thus, there are plenty of available and unused zero bytes following
+O, addressed via o, and this code only needs
+17. This is undefined behavior, but as shown, it is widely
+available.sh(1) was a significant inspiration for this contest.
+There are two C compilers present: cc written by Dennis
+Ritchie, and pcc written by Steven Johnson. The nested
+conditional expressions in 116 and smaller are too complex for
+cc (“Illegal conditional”) but pcc handles
+them correctly, and neither compiler accepts char o[] or
+char o[0] and neither put the bytes in a zero-filled page
+(as a paged VM was not yet written for UNIX).printf(3) does not report
+the number of characters written, and therefore 111 compiles but does
+not work correctly; 113 is the shortest code that compiles and runs
+correctly in Ancient UNIX.printf (_doprnt)
+was written in PDP-11 assembly. It pre-dates varargs.h, and
+assembly was the only way to gain access to the variable argument types.
+The first edition The C Programming Language, 1978, page 71,
+remarks:
+
+
+printf, the most common C function with a variable number
+of arguments, … is also non-portable and must be modified for different
+environments.TL;DR:
+
+
+Coda:
+clang or gcc with
+-Wall -pedantic. Note that while this is larger than all
+but the original attempt, it will not work with the original
+Ritchie PDP-11 C compiler, since the expression within the ternary
+remains too complex.cat prog.c prog.alt.ccmp -b prog.c prog.alt.cdiff is not helpful on a
+one-liner).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/burton1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 burton2
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/burton2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dave Burton
+Location: USTo build:
+makeTo use:
+./prog [-tcksri] < file.cTry:
+./try.shman ./tac.1Judges’ remarks:
+Author’s remarks:
+tac -
+tokenize and count C and derivative languages:
+tac computes C program size
+(obfuscated / otherwise)
+by splitting code as tokens small,
+ignoring space, then counting all.
+
+as counting tool of I-OCCC fame.
+Some bugs were fixed, it’s faster too,
+and does more things, just add some glue!
+
+the token part’s a better prize!
+With each upon on a single line,
+how many things can you design?
+
+de-obfuscator, freq reporter.
+With code produced as little parts,
+just add your own creative arts.
+
+the braces part, without a doubt!
+And then the code - it isn’t easy:
+for as else? That’s rather cheesy!
+
+expressions strange, the globals bare,
+confusing symbols one and oh,
+and precedence you have to know.
+
+because of standards change eternal.
+Thus other languages can now,
+be counted just like C, somehow!
+
+enough to win, and thus procure
+a public place for all to see
+how badly I can butcher C!
+Said another way….
+tac is the inverse of cat(1): it
+un-concatenates its input into C tokens, writing the token stream to
+stdout. There are options to suppress the token ids,
+summarize the token counts, and several options to allow it to be
+compatible with iocccsize.iocccsize
+(see below); but this can be fixed by using the -c
+compatibility flag, restoring the following problems as in the official
+tool:
+
+{;}” is not counted within a double-quoted
+string.char-counted, unless
+the comment starts a line.-k processes the reserved words within //
+comments(!), but not /*, changing the counts.
+
+/*/ as a complete comment
+(/*/int if for/*/ has three keywords)-k enables //* or within a line comment
+/* to initiate a comment block until following
+*/-k processes double quote characters in //
+comments - thus a solitary quote consumes everything until the next
+quote'"' starts a
+double quote in iocccsize)#ifndef is omitted as a keyword (but
+#ifdef is allowed?)I is not a reserved word.tac correctly penetrates 23rd century
+cloaking technology. ;-)
+
+#
+and include (not as a reserved word):#/*this will not be counted*/include/*correctly*/<stdio.h>-k.Backwards Compatibility:
+tac was run over all 366 previous IOCCC winning
+entries:find ~/src/obc -type f -name \*.c | wcfind ~/src/obc -type f -a -name "*.c" | xargs ./spotcheck.sh ./prog | ./spotdiff.sh |
+ grep -v keep | diff -bw - discrep* | grep "[<>] cl "iocccsize, described in detail in the file discrepancies.md. There are only 40 files
+(40/366, ~11%, including originals and variations) that differ at all,
+31 only in word count; most word count differences appear related to
+comment block detection, weighted more towards recent entries (2011 and
+onward = 20/40 ~50%).a+=1;.
+
+iocccsize. This obfuscated
+entry is derived from (and compatible with) that code, but due to
+obfuscation, has had some significant, deep changes for the contest.
+Nevertheless, the more clearly written code remains a spoiler for this
+entry.iocccsize gets a different answer from
+tac on its own (iocccsize.c) source code; tac
+gets the correct answer. This is due to the aforementioned bugs within
+iocccsize, proved by fixing iocccsize.c with the included patch, so
+iocccsize reports the correct answer for itself.But wait… There’s More!
+tac features an accurate tokenizer; which presents each
+C token on a line by itself. This feature enables interesting analyses
+of C (and C++) code that’s hard to get any other way.#!/usr/bin/env bash
+cat $* | ./prog -t | sort | uniq -c | sort -k1nr#!/usr/bin/env bash
+function iskeyword {
+ awk 'BEGIN{f="c11";while(getline<f)k[$1]=0} {if($1 in k)k[$1]++}END{for(i in k)print k[i],i}'
+}
+cat $* | ./prog -t | iskeyword | sort -k1nr
+1980s 1990s 2000s 2010s
+----- ----- ----- -----
+94 if 532 char 375 if 254 int
+69 for 524 if 372 char 217 for
+59 while 417 int 332 int 198 if
+48 char 223 for 184 for 121 return
+43 int 223 void 165 return 104 chartac -t and a handful of simple rules (and another use of
+the external keyword file). A more refined version of this is included
+in the file unob.sh, but the simple code below is
+a serviceable obfuscated C de-obfuscator in a scripting
+language. It really is this easy with tac:#!/usr/bin/env bash
+script='
+BEGIN {
+ last=nl="\n";
+ f="c11"; while(getline <f > 0) kw[$0]++; close(f);
+}
+
+function iskw(a) { return a in kw }
+function indent(a) { return sprintf("%*s", n*3, " ") }
+function newline() { if (!infor && last != nl) printf last=nl; }
+function show(a) {
+ if (last==nl) printf "%s", indent()
+ printf "%s%s", space(), a
+ last=a
+}
+function space() {
+ return iskw(last) ||
+ (last ~ /[A-Za-z0-9_+-\/%^[&\]\)=:<>;]$/ && $0 !~ /[:;()\[\],]/) ? " " : ""
+}
+
+/^\(/ { ++paren }
+/^\)/ { --paren }
+
+/^for/ { newline(); infor=1 }
+infor && /^;/ { ++infor; show($0 " "); next }
+infor==1 && /^:/ { ++infor }
+infor>1 && paren==0 { infor=0 }
+
+/^\?/ { tern++; n++; newline(); show($0 " "); next }
+tern && /^:/ { newline(); show($0); --tern; --n; next }
+
+/^#/ { newline(); show($0); newline(); next }
+/^;/ { show($0); newline(); next }
+/^{/ { show($0); ++n; newline(); next }
+/^}/ { n--; newline(); show($0); newline(); next }
+
+{ show($0) }
+'
+cat $* | sed 's/#include/##include/' | cpp -E -trigraphs |
+sed 's/^# .*$//' | sed 's/^#//' |
+./prog -t | awk "$script"On the question of
+obfuscation:
+
+
+
+Every brace is great.
+If a brace is wasted,
+Clang gets quite irate.if,
+for interesting flow control.for can be an else - inconceivable!getopt(3). But “where’s the beef?”int constants, and
+one string (hint: which does not encode letters) – how does this code
+parse code?
+
+int
+constants”? ... | sort -k2nr | sed 5qO,0,l,1 are used to confusing effect, local names
+obscure global names.Rule 2:
+tac will correctly tokenize both of
+these; the tokens >>> and :: can be
+handled with a short post-filter (tokenfix.sh,
+included).tac is ready for the IOCCC++ contest. And the IOJCC trash
+can.
+
+#define, #ifndef,
+#undef are missing – yes, Virginia knows about
+#define omitted on purpose), nor correct (many more are
+added: I, true, bool,
+compl, …):(sed -n '1p' c11; sed -n '2,$p' ioccc.kw.freq | sort) | comm -3 - c11-DU=O to get a
+passible, if cryptic, usage message using no additional octets than
+without the define. This also allows the builder to configure the amount
+of help a utility should provide (you want
+a manpage? Because that’s how you get a manpage.) – a rather
+significant point of contention made moot.iocccsize: iocccsize does not
+Rule2 count {, } and ; when
+followed by whitespace – even within a string! Thus: Freecode, a simple,
+uncounted, highly obfuscated encoding of a central part of this program.
+(The reserved word list is not Freecoded, both because it is useful
+apart from the program, and because Freecode is not entirely free.)
+
+Compilation:
+-trigraphs -Wno-trigraphs (which is also humorous).-Wno-parentheses -Wno-empty-body -Wno-char-subscripts.unsigned chars, but C strings are
+signed. Thus -Wno-pointer-sign. NB: This is
+not a portability concern, the one string holds only printable
+ASCII characters.cc -ansi -Wall -trigraphs -Wno-trigraphs -Wno-parentheses -Wno-empty-body -Wno-char-subscripts -Wno-pointer-sign -DU=O -DW=\"keywords\" -o prog prog.cCoda:
+tac
+groks digraphs, tokenfix.sh corrects for
+missing digraphs in prog.c, and the program manpage.sh was added to the corpus.-r and -s
+arguments to tac are not recognised when written as -rs in
+prose)../manpage.sh tac
+
+./manpage.sh -h
+./manpage.sh -h | ./manpage.sh
+./manpage.sh -h | ./manpage.sh -R | less
+./manpage.sh -h | ./manpage.sh -P | lprtac.man was updated to proper man
+format and renamed tac.1.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/burton2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 ciura
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/ciura
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Marcin Ciura
+Location: PLTo build:
+makeTo use:
+./prog < textTry:
+./prog < Makefile
+./prog < README.mdAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+prog. You may get confused.
+We’re not really sure: prog.c wasn’t commented. Who
+has been thoroughly puzzled by prog? Also how obfuscated is
+prog? Having been written in C, how large of a vocabulary
+has it?Author’s remarks:
+The Program:
+
+
+-ed, they are not past participles.The Big String:
+c[]
+string:
+
+0-9: highlighting passive constructions in the
+output.10-50: classifying characters - called by
+V(4).52: outputting the newline character.51-187: tokenizing text and detecting passive
+constructions - two type A state machines, called by V(2)
+and V(3).186-2786: determining word categories (past
+participles, present simple and past simple forms of “to be”, other
+forms of “to be”, adverbs, wh-words, and other words) and recognizing
+abbreviations - two type B state machines, called by V(808)
+and V(205).The State Machines:
+transition_label, next_state,
+output).Type A:
+c[3 + 8*state + transition_label] contains
+(unsigned char)(30 + 5*next_state + output).transition_label is either one of character
+classes:
+
+nil = 0,space = 1,new_line = 2,uppercase = 3,lowercase = 4,period = 5,bang_question = 6,punctuation = 7,
+
+adverb = 0,other = 2,past_participle = 3,to_be = 4,are_were = 5,wh_word = 6 (cf. the output of type B
+state machines).output is either one of:
+
+end_of_text = 0,sentence_start = 1,sentence_end = 2,token_end = 3,ignore = 4,
+
+passive_construction_start = 1,ignore = 2,passive_construction_end = 3.k[2] and k[3].uppercase, lowercase,
+period, space, and uppercase.
+
+state = 7, transition_label = 3
+(uppercase), output =
+sentence_startstate = 14, transition_label = 4
+(lowercase), output = ignorestate = 15, transition_label = 5
+(period), output = token_endstate = 13, transition_label = 1
+(space), output = token_endstate = 18, transition_label = 3
+(uppercase), output =
+sentence_endto_be, adverb,
+past_participle.
+
+state = 8, transition_label = 4
+(to_be), output =
+passive_construction_startstate = 22, transition_label = 0
+(adverb), output = ignorestate = 22, transition_label = 3
+(past_participle), output =
+passive_construction_endType B:
+transition_label is one of:
+
+word_start = 0,period_or_apostrophe = 1,a_z_letter = 2..27.output is either one of word classes:
+
+adverb = 0,ignore = 1,other = 2,past_participle = 3,to_be = 4,are_were = 5,wh_word = 6,
+
+ignore = 1,abbreviation = 2.c[186 + (state + transition_label)] =
+(unsigned char)(2 + transition_label + 28 * output).c[836 + 2*(state + transition_label)] =
+
+' ' when next_state / 376 == 0,';' when next_state / 376 == 1.c[837 + 2*(state + transition_label)] =
+
+' ' when next_state / 94 % 4 == 0,';' when next_state / 94 % 4 == 1,'{' when next_state / 94 % 4 == 2,'}' when next_state / 94 % 4 == 3.c[2136 + (state + transition_label)] =
+(unsigned char)(32 + next_state % 94).state with
+output set to ignore. It scans a word
+backwards, converting character by character to
+transition_label. When it meets word_start, it
+returns, leaving the most recently stored output in
+v.c[186 + (state + transition_label)] != (unsigned char)(2 + transition_label + 28 * output),
+i.e. when the transition_label in the byte mismatches the
+transition_label used to compute the index. Otherwise, if
+the output in this byte differs from ignore,
+the state machine stores it in v. Regardless of the value
+of the output, it also assigns next_state to
+state and proceeds to scan the previous character. The
+state machine that determines the word class is set up so that it never
+returns ignore.
+
+state = 623, transition_label = 26
+('y'), output = otherstate = 602, transition_label = 13
+('l'), output = adverbstate = 594, transition_label = 7
+('f'), output = otherstate = 549, transition_label = 6
+('e'), output = ignorestate = 543, transition_label = 10
+('i'), output = adverbstate = 0, transition_label = 9
+('h') mismatches the value stored in the byte. Return
+adverb.
+
+state = 19, transition_label = 1
+('.'), output = ignorestate = 24, transition_label = 6
+('e'), output = ignorestate = 3, transition_label = 1
+('.'), output = ignorestate = 2, transition_label = 10
+('i'), output = ignorestate = 1, transition_label = 0
+('\0'), output = abbreviation.
+Return abbreviation.Remarks:
+for loop
+inside its main() function.C[] and the expression 9<<20 inside the
+call to read(2).
+
+-Woverlength-strings to CSILENCE.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/ciura
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 endoh1
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/endoh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./prog < textfile > output.gifTry:
+./try.shJudges’ remarks:
+open -a Safari smily.gif.Author’s remarks:
+cc -o prog prog.c
+./prog < invisible.txt > invisible.gifinvisible.gif with a GIF viewer that can show
+animated GIFs and then wait a minute. You will see a hidden message. Can
+you tell the difference between letters that leave the mark and ones
+that do not?./prog < golem.txt > golem.gif
+./prog < smily.txt > smily.gif./prog < prog.c > prog.gifCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/endoh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 endoh2
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/endoh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./progTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+
+ ___-----__
+ _-- --__
+ _- _--_ \
+ _- /\ +-.:.:-+ /\ \
+ / \/ |.:.:.:| \/ |
+ / |:.:.:.| |
+ / |.:.:.:| | ___-----___
+ | |.:.:| | / \
+ | |:.:.| | < It's ... |
+ \ |:.| | \ /
+ \ || | ---_____---
+ _--\ |
+ _- -__ |
+ __- --___ |
+ _- |
+ / |
+ | |Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/endoh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 ferguson
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/ferguson
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Cody Boone
+Ferguson
Location: USTo build:
+makeTo use:
+./weaselTry:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+weasel.alt as you would weasel
+above.Alternate try:
+./try.alt.shJudges’ remarks:
+man ./weasel.1Author’s remarks:
+
+
+0. Preface
+make test before you get into the document or the man page,
+unless you don’t mind any spoilers. I don’t reveal much in the way of
+obfuscation however so if you just want documentation on the program,
+how to compile, etc. then there isn’t need to heed this
+note.man ./weasel.man-m option enables it specially (I discuss this
+thoroughly in Hints).S and N: the maximum size of the chromosome
+(target string; the maximum length is S - 1 but it must be
+>= the default 38) and the number of offspring, respectively. I also
+give example compiler invocations, portability notes, an more
+portability notes and a note on rpm.md.S and N: As the judges’
+suggested runs imply you can change the target string at runtime;
+make test runs a script test.sh which reads
+from the file test-strings.txt, running the program for
+each string in the file, waiting approximately two seconds before
+continuing. I explain how to pass options to the script in part of
+Hints.1. What it
+is
+
+
+0<=126 that isprint() returns non-zero
+except that only capital letters are included; the file prog.alt.c has a slightly smaller keyboard. There
+are some additional features I have added (including two Easter eggs);
+amongst others: ability to change the target string and maximum length.
+See
+How it works, Hints and How to
+build for more details.METHINKS IT IS LIKE A WEASEL (note that I use
+toupper() so it doesn’t matter what case the input is the
+comparison and output will always be capitalised).2. How it
+works
+
+
+N
+offspring; generation 0 is the pseudo-randomly initialised
+array without parents. Each offspring has its own
+chromosome to be compared to the target string and a
+fitness score; the higher the fitness score the more likely it
+will be a parent of the next generation (randomised mode
+notwithstanding) as part of the selection process (As the
+generations go by the fitness of the offspring should be higher; when
+the fitness matches that of the target it will be printed and the loop
+will be broken out of).SIZE_MAX - 1 is
+reached or the target chromosome has been found.SIZE_MAX - 1 the fitness test loop will not be entered;
+instead the outer loop will end after printing:
+
+
+
+
+
+N == 97 is
+2305567963945518424753102147331756070. There is no
+reference to this number in my entry but it’s nonetheless possible to
+change the default target to it without modifying the source
+code**; there are two hints in this very paragraph; the first sentence
+in fact: the answer to the judges’ question and the definition. Can you
+get the program to search the primorial prime of 97 without passing in
+specially?On
+user monkey errorsSIZE_MAX - 1 I consider it a
+monkey (or if you insist: user) error; if the user insists on being so
+petulant enough as to try such a ridiculous set of parameters in an
+attempt to make it be no more successful than a monkey typing then
+it shouldn’t be any more successful than a monkey; if it by chance
+reaches the target it’s because a monkey could too! Either way
+unless the number reaches SIZE_MAX - 1 the monkey Eric
+won’t be blamed. It should be noted that depending on the parameters
+(size of chromosome, number of offspring, the string itself) the program
+could take quite a lot of system resources; and whether the OS kills it,
+Eric the monkey falls asleep or the typewriter is taken from him the
+result could very well be not found without blaming him. Of course the
+judges were talking about fish not monkeys. But since this program is
+inspired by the Weasel program which was inspired by the Infinite
+Monkey Theorem I opted instead to target the monkey Eric even
+if such a monkey isn’t typing or even doesn’t exist (because it’s not
+the Infinite Fish Theorem). So although the user might not be a
+monkey the program makes the assumption that the user could in
+fact be a monkey called Eric although it isn’t insolent
+enough to say the user is a monkey for certain!3. Hints
+Keyboards
+' ' but it doesn’t
+include other isspace() characters) and this is why some of
+the characters are escaped:
+ const char keyboard[]=" !\"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~";
+ const char keyboard[]=" !\"&'(),.0123456789;?ABCDEFGHIJKLMNOPQRSTUVWXYZ";Options
+-r option as well as the target string (see below).
+ -q<rate>:
+ -r<num>-r
+and the number. This is to simplify the parsing of options. As for
+combining options you can do any of the following (amongst others):
+ -r5q
+ -qr5
+ -qr
+ -q -r5strtol() in this case
+returns 0. strtol() can legitimately return 0 but in no
+instance is it valid input in this program: the valid mutation rate is
+>= 1 && <= 100.
+
+-qr101
+-qr5
+- passed
+into the program will become the target string. The same rule applies to
+the number for -r: it must be a single parameter which
+means you’ll need to quote the string if it has more than one word (that
+is it contains spaces) or anything else interpreted specially by your
+shell e.g. parentheses. For instance if you just want to find
+METHINKS you could do one of:./weasel METHINKS
+./weasel "METHINKS"
+./weasel 'METHINKS'YOU ARE A MONKEY:./weasel "YOU ARE A MONKEY"
+./weasel 'YOU ARE A MONKEY'./weasel "METHINKS IT IS A" "MONKEY"
+./weasel METHINKS IT IS A MONKEY
+It will search for MONKEY in both cases; in other words
+it’s the last one. If the string is too long given the value of
+S (see
+How to build) it will be
+truncated.- you must disable further parsing of options by using the
+- option itself; for example if you were to do any of:./weasel -q- -- -test
+./weasel -q- -test
+./weasel -q -- -test-TEST. This means though that
+here:./weasel -q -- -test -r5-r5 and the
+mutation rate will remain the default because after the -
+option is seen it will no longer parse additional options: only target
+strings if anything left on the command line. Because of the joining of
+arguments this means that the first two examples of the last set of
+three above are equivalent i.e. the following two are equivalent:
+ -q-\
+ -q --
+As for the caveat I referenced what does the following do?./weasel -qr 5-
+option; if the program is currently parsing argv[N], for
+example, and it encounters a -- then depending on where the
+other options are in the command line it might still parse the options.
+Thus you have:$ ./weasel -qr-r5
+quiet output
+mutation rate out of range
+target 'METHINKS IT IS LIKE A WEASEL'
+mutation rate 5
+Generation 440 Offspring 20: METHINKS IT IS LIKE A WEASEL./weasel --qrr5./weasel -q -- -r
+./weasel -q -q- -r--
+(the - option itself) and then the target string would
+literally be set to -r because it no longer cares
+about the - for option parsing. In other words options are
+only parsed if the first character is - and if the parser
+hasn’t seen the - - in an earlier element of
+argv. This is not a bug!Spoilers
+-m
+option (-m for monkey).Example
+Invocations
+-m option because if the mutation rate is out of range
+monkey mode is activated (that’s the first Easter egg). But what happens
+if you later set a valid mutation rate? Should monkey mode be disabled?
+If yes how do we know if monkey mode was specially requested? There are
+at least two ways to go about it: I took the monkey safe (‘fool safe’)
+method; *if you explicitly request monkey mode you cannot disable it in
+the same invocation of weasel!$ ./weasel -qr101r5r101r1r test
+quiet output
+mutation rate out of range
+mutation rate out of range
+mutation rate out of range
+target 'test'
+mutation rate 0
+monkey at typewriter
+Generation 16844 Offspring 22: TEST
+
+-q-r101-r5-r101). This means here the typewriter was taken from
+Eric the monkey.-r101-r1-rstrtol() it should return 0: this is the third message
+about being out of range. Note here that rand() returns an
+int and strtol() returns a long
+but I compare the return value of rand() to the mutation
+rate; if there are any systems where the widths differ this
+shouldn’t matter because of truncation but I do in any case
+specifically check for R < 0 || R > 100. Either way
+the invalid range returns the typewriter to Eric.testtest (will search
+for TEST).$ ./weasel -q -r101 test -r5
+quiet output
+mutation rate out of range
+target 'test'
+mutation rate 5
+Generation 109 Offspring 13: TEST-r101 reports that it’s out of range and sets monkey
+mode. I then specify the target string and then set a valid mutation
+rate. This disabled monkey mode which means that it’ll use the genetic
+algorithm.$ ./weasel -q -mr101 test -r5
+quiet output
+mutation rate out of range
+target 'test'
+mutation rate 5
+monkey at typewriter
+Generation 465298 Offspring 10: TESTtest and then set a valid mutation rate of 5. Now note that
+it is actually set to 5 but also note that monkey mode remains active:
+it also took a lot longer to come to a conclusion for even four
+characters. This example does demonstrate one other thing in a subtle
+way though.
+ real 0m17.065s
+ user 0m1.245s
+ sys 0m2.402s
+ real 0m0.127s
+ user 0m0.125s
+ sys 0m0.001siocccsize -i reports 2052!).time bash shell built-in utility: that
+isn’t output from my entry.
+ target 'METHINKS IT IS LIKE A WEASEL'
+ mutation rate 1
+ Generation 0 Offspring 1: 4V YGY.GH/}_|>Q1M.R8;KD[=(05
+ Generation 0 Offspring 2: Y_^S0_HZ399^/|9,MP%^{817"XX#
+ Generation 0 Offspring 3: F%88H1&[V1P>QOI}- U]0[V-Y%*[
+ [...]
+ Generation 1 Offspring 23: AHA#.\=ZT'0>?~-S.;1A L|1<S:^ -> AHA#.\=ZT'0>?~-S.;1A L|1<S:| (mutation)
+ Generation 1 Offspring 24: AHA#.\=ZT'0>?~-S.;1A L|1<S:^ -> AHA#.\=ZT'0>?~-S.;1A L|1<S:^ (mutation)
+ Generation 1 Offspring 25: AHA#.\=ZT'0>?~-S.;1A L|1<S:^ -> AHA#1\=ZT'0>?~-S.;1A L|1<S:^ (mutation)
+ **
+ Generation 2 Offspring 1: AHA#.\=ZT'0>?~-S.;1A L|1<S:^ -> AHA#.\=ZT'0>?~-S.;1A L|1<S:^ (mutation)
+ Generation 2 Offspring 2: AHA#.\=ZT'0>?~-S.;1A L|1<S:^ -> AHA#.\=ZT'O>?~-S.;1A L|1<S:^ (mutation)
+ [...]
+ Generation 979 Offspring 1: METHINKS ITZIS LIKE A WEASEL -> METHINKS IT IS LIKE A WEASEL (mutation)
+ [...]
+ **
+ Generation 979 Offspring 1: METHINKS IT IS LIKE A WEASEL
+
+ real 0m0.074s
+ user 0m0.040s
+ sys 0m0.001sare separators: you won't see this between generation 0 and 1 but you will between future generations - as well as the final answer (if the answer is in generation 0 you won't see the).
+ (1) $ echo test > test
+ (2) $ ./weasel test
+ (3) $ ./weasel < test
+ (4) $ cat test | ./weasel\
+ (5) $ < test-strings.txt ./weasel
+ (6) $ cat | ./weasel./weasel will search for
+TEST because the string test was explicitly
+passed to the program (If the file test wasn’t found by
+that path it would still have searched for TEST).test; else you will get an error
+about no such file or directory (unless your shell for some reason
+doesn’t consider it an error; bash most certainly does consider it an
+error and halts).test
+cat that file and pipe the output to ./weasel; however
+it will search for the default string. If there is no such file to
+cat then an error will be reported but without quiet mode you’d probably
+not even see the error.test-strings.txt existing. As far as I am
+aware it’s equivalent to the third invocation except that the file
+exists in this case.stdin; it won’t do anything with it however.test.sh and a file of sample input
+test-strings.txt that you can play with.make testchmod +x test.sh
+./test.shtest-strings.txt (if the file doesn’t exist or can’t
+be read the script will exit with return status of 1) and pass it to the
+program. After finding the string it’ll sleep approximately 2 seconds
+and then read the next string (passing it to the program, continuing
+until all the strings have been read and processed)../test.sh -q testtest won’t be searched for; it will
+however run the program in all invocations with quiet output enabled.
+The following are some notes about how the shell and the program
+interact with each other:-q STRING quiet mode would be
+enabled; however the default string would be searched for. If the quotes
+were removed from the script it would print the final word specified. To
+be specific with the quotes: if in the file you had the line
+-q STRING -m TEST it would enable quiet output and monkey
+typewriter mode; but it would search for the default string. Without the
+quotes on the other hand it would enable quiet output, monkey typewriter
+and search for TEST. In other words if you want to
+pass options to the script you will have to directly pass the options to
+the script like the above example shows (but the strings will
+still only be read from the test-strings.txt file).Input Error
+Example
+
+; when a character in the string to be found isn’t in the
+keyboard the program prints an error message and then exits (returning
+1). But since the keyboard doesn’t have '\n' if you were to
+type a ' and send a '\n' before the closing
+' you might see something like:$ ./weasel '!!
+> '
+
+'
+' not in keyboard " !"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~"' is in the keyboard already; however the
+user sent a \n (hence the secondary prompt
+> on line two) before literally typing the closing
+' (also line two). But in order to make it clear what
+character is invalid I surround the character with 's so
+what you actually see after typing the closing ' and
+hitting Enter (or however you send the '\n') there is the
+third blank line; but then the program prints '
+followed by the invalid character ('\n' itself which means
+another line break) and then finally the closing '.
+Specifically isspace() characters aren’t distinctly seen
+like a letter, digit or symbol is:
+isprint('\n') == 0 && isspace('\n') == 1. You can
+add these characters but the output will be rather confusing and hard to
+read.4.
+Obfuscation
+Techniques
+
+
+S) as well as some C keywords.main() is declared is:/* Special C main() handler (encapsulation): */
+#define r(main) main
+r(k main(k a, E **V)) {
+It appears to be recursively defined but is it? And is it truly
+
+H(). It might help to
+observe that there might be recursive calls and much of the program
+might use it. Or so it seems. Then again it might not help to not notice
+it.splint, which completely baulks). There
+also is a trick; if you try translating them then depending upon how you
+do it there can be functional changes in the program!Beauty
+
+
+
+
+
+
+5. How to
+build
+S and N
+Constants
+#defined constants can be redefined at
+compilation to modify the behaviour of the program in a number of ways
+(see the Compilation
+subsection for example invocations). Both are capped to be no greater
+than SIZE_MAX - 1. This is handled by the C
+preprocessor.S38 >= 29 and because
+strlen("METHINKS IT IS LIKE A WEASEL") == 28 (which is the
+default target string - it would hardly be an implementation of the
+Weasel program otherwise).38 is the chosen size but
+the only hints I provide are those in How it
+works and specifically an Easter egg I referenced there
+(it’s not the only Easter egg but it’s the only Easter egg I
+won’t spoil; yes this ironically and amusingly means I’ve left a rotten
+egg somewhere!).NS and
+N (individually and together) the program will use varying
+amounts of memory and the larger the values the more memory it’ll
+require.Compilation
+-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)'50
+and the size of the chromosome to 75 you would pass to the
+compiler:-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)' -DN=50 -DS=75N to 3:-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)' -DN=33; more
+correctly if it’s less than 4 it’s redefined to 3 so you could have
+passed in -DN=2 and have the same result. Remember too that
+S cannot be less than 38. Both S
+and N are capped at SIZE_MAX - 1.Portability
+SIZE_MAX). I don’t think Windows gcc ports would have many
+issues (if any) either but I have no way to test this. Originally I
+tested it on the below systems.Fedora 26:
+$ clang --version|head -n1
+clang version 4.0.1 (tags/RELEASE_401/final)
+$ gcc --version|head -n1
+gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
+$ /lib64/libc-2.25.so |head -n1|cut -d',' -f1-1
+GNU C Library (GNU libc) stable release version 2.25
+$ lscpu |grep Endian
+Byte Order: Little EndianCentOS Linux release
+7.4.1708 (Core)
+$ clang --version|head -n1
+clang version 3.4.2 (tags/RELEASE_34/dot2-final)
+$ gcc --version|head -n1
+gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
+$ /lib64/libc-2.17.so |head -n1 |cut -d, -f1-1
+GNU C Library (GNU libc) stable release version 2.17
+$ lscpu |grep Endian
+Byte Order: Little EndianFedora 27:
+$ clang --version|head -n1
+clang version 5.0.1 (tags/RELEASE_501/final)
+$ gcc --version|head -n1
+gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
+$ /lib64/libc-2.26.so |head -n1|cut -d, -f1-1
+GNU C Library (GNU libc) stable release version 2.26
+$ lscpu |grep Endian
+Byte Order: Little EndianmacOS:
+$ gcc -v
+Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
+Apple LLVM version 9.1.0 (clang-902.0.39.1)
+Target: x86_64-apple-darwin17.5.0
+Thread model: posix
+InstalledDir: /Library/Developer/CommandLineTools/usr/bin
+$ uname -srmv
+Darwin 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64An aside
+S or N too much, changing the references to
+SIZE_MAX to be larger than SIZE_MAX or a
+signed value (size_t is unsigned) or too small of a value;
+changing data types or variables; expecting really long strings -
+including but not limited to the complete works of Shakespeare (hint:
+isprint('\n') == 0 so it won’t ever find any string with
+'\n') - to be found by the program in a quick and easy
+fashion if ever; or any other meddling including being petulant and/or
+unreasonable monkeys. I will say though that there is at least one place
+I see after having won that could be slightly more efficient (can you
+find it?); I am however leaving it as it is because this is what
+won.Installing
+6. Final
+thoughts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/
+8)%2))P("|"+(*u/4)%2);
+
+
+
+
+
+for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/
+8)%2))P("|"+(*u/4)%2);
+How is R=; valid? Since I don’t have the context maybe
+there is something I’m missing but either way it’s a funny piece. It
+could also be for irony itself (actually I had previously thought of
+somehow implementing something like that for the contest but decided for
+the message by itself in the end). I would prefer believing that whether
+true or not.7.
+Winning comments, thanks, dedications, links,
+etc.
+#including C); if it
+wasn’t for you Martijn I wouldn’t have been able to win so consider this
+a recursive thank you thank you! :)Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2018/ferguson
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 giles
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/giles
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Edward Giles
+Location: AUTo build:
+makeTo use:
+./progTry:
+./prog ioccc.txt
+./prog prog.c
+./prog sand.txt
+./prog sand.alt.txtJudges’ remarks:
+Author’s remarks:
+Remarks
+
+
+double is an IEEE 754 floating-point type and
+sizeof(double)==8.V[] array, and they are reinterpreted as
+doubles when used. This allows more numeric precision in
+fewer characters (base 16 > base 10), and makes the purpose of the
+array less clear.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/giles
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 hou
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/hou
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Qiming HOU
+Location: CNTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog < input.json > output.htmloutput.html in a browser.Try:
+./try.shoutput.html in a browser.Judges’ remarks:
+rulez of programming in an imperative language
+are violated, aren’t they?Author’s remarks:
+returns. In
+compliance to production coding standards, the code is littered with
+fashionable jargon, doxygen comment, and license text.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/hou
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 mills
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/mills
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Mills
Location: USTo build:
+makemullender.c again) you can compile it like:make clobber SAVE=1 allsync! Otherwise
+the file might not exist or it will be corrupt if it does.Bugs and (Mis)features:
+
+STATUS: known bug - please help us fix
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./progTry:
+./prog>boot prompt, type return.: prompt, type rk(0,0)rkunix and
+wait for it to initialise itself. Now try typing:cat > prog.c
+main(){ printf("Hello, world!\n"); }
+^D
+cc prog.c
+a.out^D is EOF.cc mullender.c
+a.outJudges’ remarks:
+./v0@ ln dd dmr .ls will reveal that C hasn’t been invented yet! IOBCC
+anyone? The compiler is bc. It produces assembly, which
+will then need to be assembled together like
+ops.s bl.s hello.s bi.s (in that order) to produce
+a.out!./prog>boot prompt, type return.rk(0,0)rkunix../v6@ prompt, type rkunix. You might
+want to type stty -lcase as otherwise the output will be in
+all caps.Author’s remarks:
+This
+IOCCC entry is dedicated to the late Dennis M. Ritchie
+The Program:
+Makefile can build versions that can run each of the
+following:
+
+Building and Running BSD 2.9:
+make to build prog and
+then ./prog to run it.
+>boot
+40Boot
+:rk(0,0)rkunix – this tells the system to look at the first
+partition on the first RK05 fixed disk, find the
+rkunix file and load it. You should eventually see the
+following:
+>boot
+
+40Boot
+: rk(0,0)rkunix
+
+Berkeley UNIX (Rev. 2.9.1) Sun Nov 20 14:55:50 PST 1983
+mem = 135872
+
+CONFIGURE SYSTEM:
+xp ? csr 176700 vector 254 skipped: No CSR
+rk 0 csr 177400 vector 220 attached
+hk ? csr 177440 vector 210 skipped: No CSR
+rl ? csr 174400 vector 160 skipped: No CSR
+rp ? csr 176700 vector 254 skipped: No CSR
+ht 0 csr 172440 vector 224 skipped: No CSR
+tm 0 csr 172520 vector 224 skipped: No CSR
+ts 0 csr 172520 vector 224 skipped: No CSR
+dh ? csr 160020 vector 370 skipped: No CSR
+dm ? csr 170500 vector 360 skipped: No autoconfig routines
+dz ? csr 160110 vector 320 skipped: No CSR
+dz ? csr 160110 vector 320 skipped: No CSR
+dn 0 csr 175200 vector 300 skipped: No autoconfig routines
+vp ? csr 177500 vector 174 skipped: No autoconfig routines
+lp ? csr 177514 vector 200 skipped: No CSR
+Erase=^?, kill=^U, intr=^C
+#make clean to start from
+scratch.# ls
+.cshrc .profile boot hkunix mnt tmp
+.login 2.9stamp dev lib mullender.c unix
+.msgsrc bin etc lost+found rkunix usr
+# df
+Filesystem Mounted on kbytes used free % used
+/dev/rk0 / 1958 1688 270 86%
+# bin/cc mullender.c
+# ./a.out:login: prompt. Here you can log in as
+root and get a full time-sharing session. Feel free to try
+things like vi. I’ve taken the liberty of editing the
+.login and .profile files to set the console
+to a less traditional setup so that you don’t have to wait for the Model
+33 KSR teletype to move its carriage. I’ve also predefined
+TERM to vt100, which will probably work well
+enough with whatever sort of ANSI terminal emulation you are using./usr disk here, so some
+commands from /usr/bin will be missing, along with all of
+the man pages. They are [available online] 2 if you need them. Adding a second RK05 disk was
+possible, but I didn’t get around to it… As the Judges can no doubt
+attest, “Mid 2017” creeps up on you quicker than you expect. :)Building and Running
+Research UNIX v6:
+make v6 to build it, then type
+./prog to run it.@:
+@rkunix. After that you should see:
+@rkunix
+mem = 1035
+RESTRICTED RIGHTS
+
+Use, duplication or disclosure is subject to
+restrictions stated in Contract with Western
+Electric Company, Inc.
+#stty -lcase because otherwise everything will
+be IN ALL CAPS.
+@rkunix
+mem = 1035
+RESTRICTED RIGHTS
+
+Use, duplication or disclosure is subject to
+restrictions stated in Contract with Western
+Electric Company, Inc.
+# STTY -LCASE
+# ls
+bin
+dev
+etc
+hpunix
+lib
+mnt
+rkunix
+rpunix
+tmp
+unix
+usr
+# cat > foo.c
+main()
+{
+ printf("Hello, World!\n");
+}
+^D
+# cc foo.c
+# ./a.out
+Hello, World!mullender.c (as
+simple as it is), because the following syntax features don’t exist
+yet:
+
+short data type doesn’t exist yet. Only
+int (short will show up when long
+comes, and the port to the Interdata 7/32 starts to make the idea of
+portability become important).=. It still uses the older form taken from B, which looks
+like array[] { 1, 2, 3 };cat
+see an end-of-file).rk05.fs), if you want to go back to the BSD emulation, you
+should either delete rk05.fs or do a
+make clean before you do a make.Building and Running UNIX v0:
+make v0. Since
+this version is a native PDP-7 emulation, it gets its own binary. Type
+./v0 to run it. You should see the login prompt.
+login:ken and dmr,
+with the passwords ken and dmr respectively.
+Let’s try the Dennis Richie’s dmr account:
+login: dmr
+password: dmr
+@ ls
+. ?fortune program:
+
+/bin/ls yet, and the shell can’t store that
+path in $PATH to search for it. We also haven’t invented
+. or .. yet. In fact, the filesystem isn’t
+even the traditional UNIX tree structure, it’s a directed graph of hard
+links…ls needs to be able to read ., the current
+directory. dmr’s home directory doesn’t have that yet, but
+we can make it, because the home directory has a hard link to
+dd, which is the directory that holds all of the user home
+directories (this will eventually become /, the root path).
+We can do
+@ ln dd dmr .ln doesn’t support paths
+either, so you have to give it three arguments – a directory in the
+current dir, a file in that directory, and the new name).ls will work, and we can try some other things while
+we are here:
+login: dmr
+password: dmr
+@ ln dd dmr .
+@ ls
+dd
+system
+as.s
+b_readme
+bi.s
+bl.s
+db.s
+hello.b
+ops.s
+.
+@ cat b_readme
+Here is how to compile and run hello.b:
+
+@ bc hello.b hello.s
+@ as ops.s bl.s hello.s bi.s
+I
+II
+ops.s
+bl.s
+hello.s
+bi.s
+@ a.out
+Hello, World!
+
+
+@ bc hello.b hello.s
+@ as ops.s bl.s hello.s bi.s
+I
+II
+ops.s
+bl.s
+hello.s
+bi.s
+@ a.out
+Hello, World!
+@
+
+a.out (assembler output)
+file. Even after UNIX got a linker, a.out remained the
+default name of the binary generated by the linker (and hence also by
+cc).read(2), write(2),
+open(2), close(2), creat(2),
+fork(2), etc.). There are a number of differences
+still:
+
+read(2) and write(2) do I/O on (18-bit)
+words. Character I/O on files need to unpack those bytes, and of course
+deal with NUL characters.exec(2) was performed by the shell directly. Arguments
+are passed as four words (eight bytes), and space padded. This matches
+the format for file names for open(2) and
+creat(2).wait(2) does not yet exist. A more complicated
+mechanism for sending and receiving messages (smes and
+rmes) are used instead.About the Program:
+
+
+
+
+ADD for
+one’s complement and TAD for two’s complement). The EAE is
+entirely one’s-complement.XCT instruction, that executes the word loaded from
+memory as an instruction.LAW that loads the instruction opcode
+into the accumulator.inline operands. For instance the
+MUL instruction expects the second operand to be stored in
+memory after the instruction. This pretty much requires the use of
+self-modifying code.JMP or HLT
+instruction). The load address comes from the console address switches.
+Both of these are controlled by compile-time flags.HLT instruction which will cause it to exit. Console I/O is
+emulated by setting the terminal into raw mode and polling via
+read(2). Line-clock ticks (at 60 Hz) are done by polling
+gettimeofday(2). Dynamic frequency code arranges to reduce
+the polling interval to a few polls per tick, so that emulation remains
+responsive. Since we use the real wall-clock time, this means that the
+emulated system will see time advance at the correct rate.Licencing Fun
+Makefile that
+can issue a curl command to fetch a pre-built v0 disk image
+from the GitHub repository. I am hoping this is considered part of
+“Legal abuse of the rules” which is supposed to be “somewhat
+encouraged”. As per RULE 12, I am justifying said abuse here, in the
+remarks file.Makefile and sleep well. You still have two other
+UNICES to play with.PDP-11/40
+
+
+v0 build commands set it to the correct value).ints), a conversion program is
+needed to unpack the binary disk images from 16 bits per word to 32.
+This in turn needs to be done in the Makefile using standard POSIX
+tools, which aren’t exactly good with binary. I had a weirdly clever way
+to do this with od(1), awk(1) and
+uudecode(1) that I will leave as an exercise for the
+curious, but I decided it would be easier to do it with the PDP-7
+emulator itself, feeding a simple program in on its boot tape. This
+required an additional tweak to the emulator, since by default its
+console TTY is not eight-bit clean (in fact, UNIX v0 expects to see the
+MSB set on the terminal reads, and sets it on writes, what is called
+“mark” parity). This is also enabled by a compile-time setting (used
+only for the builddisk program).Compile-time Options:
+
+
+-DI="image.fs": Name of the disk image file. This must
+be created offline, and be of the correct size to avoid segmentation
+violations.-DA=4096: Setting of the console address switches. This
+tells the RIM bootloader where to load the boot image.-DS=0: Setting of the console data switches. The PDP-7
+emulation can read these with the microcoded OAS (OR
+switches into AC) instruction. By proxy, the PDP-11 emulation can read
+them via the CSW device.-DW=MAP_PRIVATE: This sets the memory mapping for
+mmap(2). Setting to MAP_PRIVATE makes the disk
+image be copy-on-write. Setting it to MAP_SHARED makes the
+disk image be shareable. Do the latter if you want to preserve the disk
+contents between sessions.-DT=: List of initializers for the termios
+structure. The v0 UNIX expects the terminal to be in half-duplex mode,
+echoing its input, with swapped CR and NL. The PDP-11 UNICES don’t.-DX=5: The ASCII code of the control character that
+causes the emulation to abort. If set to 0, there is no abort code.-DY=128: Controls console I/O parity. If set to zero,
+the console is eight-bit clean. If set to 128, the high bit is set on
+keyboard reads and masked off on printer output (“mark” parity). UNIX v0
+expects the latter.-DV=270: The size of the disk, in tracks. The UNIX v0
+disk has 200 tracks (each has 80 sectors of 64 18-bit words). The PDP-11
+UNICES increase this to 270, to allow for the larger RK05 disk emulation
+(406 tracks of twelve 256-word sectors), plus the space for the 124K
+words of virtualized memory and the 8K words of emulator code.-DP="xxx": RIM bootstrap program paper tape image. Be
+careful with the quoting here – there are at least three levels going
+on. In particular, you will need to escape $ as
+$$ to protect it from make.What is the ASCII art
+supposed to be?
+Acknowledgements
+
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/mills
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 poikola
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/poikola
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Timo Poikola
+Location: FITo build:
+makeTo use:
+./progTry:
+./try.shJudges’ remarks:
+
+Oh, Be A Fine Gal, Kiss Me!
+Oh, Be A Fine Gentleman, Kiss Me!Author’s remarks:
+How to build:
+cc -o prog -std=gnu11 -O3 prog.cmakePoster:
+Introduction:
+Little spoilers:
+Technical jargon
+Terminal.app does not work
+as expected; you might need xterm from XQuartz (see FAQ 3.7: How do I compile and use on macOS, an
+IOCCC winner that requires X11?) or some other working terminal.
+Thanks to Dave Burton for
+spotting this problem.unistd.h is
+getdelim(3) but once I included it I also abused other
+functions and #defines. This header is mutually exclusive
+with -std=c11.
+
+Extra
+notes from the judges on the macOS Terminal.app problems:
+Warnings and
+restrictions required by law:
+Major spoilers:
+#define p return is necessary.Some obfuscation techniques
+used:
+
+
+o, b, and a are
+used in totally unrelated tasks.__ATOMIC_SEQ_CST.begin; and end;
+instead of curly brackets. They are used also in my code, but I had to
+shorten them to meet size requirements.$, but then I rejected it.
+
+aI_ after line 21?Rot18 part
+
+Lzw xajkl tsffwj ak wfugvwv mkafy AWWW 754 xdgslk gf dafw 47. Al ak hjaflwv
+gfdq gf dalldw-wfvasf esuzafwk.
+Manual decryption and parameters
+Shift/Key (number)DECRYPT (BRUTEFORCE).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/poikola
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 vokes
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/vokes
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Scott Vokes
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog < file.txtTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Introduction:
+
+0 4 8
+1 0
+2 1 3
+3 2
+4 1
+5 4 6
+6 5 2
+7 3 6 7
+0 -> 4, 8
+1 -> 0
+2 -> 1, 3
+3 -> 2
+4 -> 1
+5 -> 4, 6
+6 -> 5, 2
+7 -> 3, 6, 7
+0: 8
+1: 0 1 4
+2: 2 3
+3: 5 6
+4: 7Building:
+
+ ${CC} -o prog prog.c -std=c11 -O3 \
+ -Wall -Wextra -pedantic -Wno-missing-prototypes-Wno-missing-prototypes is necessary because there
+aren’t any prototypes. (They would put the program well over the size
+limit.)-std=c99 or
+-std=c89.-Weverything, then
+-Wno-strict-prototypes may also be necessary – the function
+pointer declarations for _ and B may get
+warnings otherwise, for reasons described next in Obfuscations.Obfuscations:
+
+
+va_list implementation differences. :) .
+There are several references to a function pointer, _, but
+it’s called with different numbers of arguments in different places. (In
+particular, look at spell.) Because the function pointer
+declaration has an empty list of parameters, the argument count and
+types are unconstrained. _ is set to different functions in
+several places, but it is always called with appropriate argument(s) for
+its possible current functions. This is allowed by the standard – The
+section on
+F,I,N,D,M,Y,C,L,U,E
+has further details._ in three different scopes: as a
+goto label (function scope), as an enum name,
+and a _ function pointer (which is required to have file
+scope, since it starts with _). There are also other
+_s: it appears in a string, obscured by a hexadecimal
+escape sequence (\x5f), and the cauldron is supported by a
+giant underscore. (Does this program qualify for Best One
+Liner?)F,I,N,D,M,Y,C,L,U,E.
+These are used for array offsets, both individually and in combination.
+The first several values are also a clue: ISO/IEC 9899:1999 chapter
+6.7.5.3 verse 14 describes how function declarators with an empty
+parameter list behave. (As does 3.5.4.3 for ANSI C, which explains the
+0x3543 that appears soon after.)I[p] (where
+I == 7) as well as p[F+L] (6+1), or
+b[M-N] (14-5) and U[b] (where
+U == 9).spectre does not exploit CVE-2017-5753 or CVE-2017-5715,
+for example – it just fits the witch theme. cast doesn’t
+cast, hex has nothing to do with hexadecimal,
+bubble is not bubble sort, there is no undefined behavior
+in nasal_demons, and main() has absolutely
+nothing to do with a hand.main() ends with a goto leading
+back to an earlier _ label, so it just loops forever, and
+exit only appears in code paths related to error-handling.
+It looks like cast calls meltdown with its
+second argument set to 0, which would call exit, but
+running in gdb(1) with a breakpoint on cast
+reveals that it isn’t being called…isdigit(3), the program checks the
+numeric value of each char, and literals that would suggest
+comparing against e.g. '0' are specified in octal in one
+place, and produced by arithmetic using the enum
+elsewhere.i is not a loop
+index, argv and argc’s names are
+swapped.NULL does not appear in the program. Instead,
+argc[argv] (which is required to be a NULL pointer) is
+saved and passed to where its value is needed.Issues and Limitations:
+
+
+curses(3)-based interface.0x3543 - 1
+bytes will be split and processed as if they were multiple lines of
+input, which can produce incorrect results. This magic number’s
+significance is described earlier.'0',
+'1', … '9' having the values 48
+through 57, rather than using isdigit(3). As
+noted above, this program has nothing to do with a hand.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/vokes
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2018 yang
+
+
-
+ The International Obfuscated C Code Contest
+ 2018/yang
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeTo use:
+less generated1.c
+less generated2.c
+less generated3.cTry:
+./try.shJudges’ remarks:
+./left, ./right
+and ./shift and the additionally generated programs../msg9 < prog.c./msg3,
+./msg4, ./msg5, ./msg6,
+./msg7, ./msg8 and finally
+./msg9?Author’s remarks:
+Tools’ usage:
+Nuko is a text rotator: given some text in
+stdin, Nuko will write the same text to
+stdout, but rotated 90 degrees counterclockwise.cc prog.c -o left
+./left < input.txt > rotated_counterclockwise.txt./left < prog.c > r1.c
+cc r1.c -o right
+./right < input.txt > rotated_clockwise.txtstdout, which is the name of
+the series that Nuko came from../left < prog.c | ./left > r2.c
+cc r2.c -o msg0
+./msg0./left < prog.c | ./left | ./left > r3.c
+cc r3.c -o shift
+./shift < input.txt > no_leading_space.txtPuzzle box:
+./shift < prog.c | ./right > msg1.c && gcc msg1.c -o msg1 && ./msg1
+./shift < prog.c | ./left > msg2.c && gcc msg2.c -o msg2 && ./msg2Features
+
+
+-Waggresive-loop-optimizations.Compatibility:
+Nuko and the rotated tools accept only ASCII files where
+each character maps to exactly one byte. Also, end-of-line sequence is
+assumed to be LF only, as opposed to CR-LF. All control characters are
+treated like normal printable characters, so files containing tabs will
+look weird after rotation, for example.Nuko has been verified to work with these compiler / OS
+combinations:
+
+Nuko compiles without warnings with all compilers above,
+even with -Wall -Wextra -pedantic for gcc and clang.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2018/yang
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 adamovsky
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/adamovsky
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ondřej
+Adamovský
Location: CZTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog file.unlTry:
+./try.shJudges’ remarks:
+
+````.0`.0`.0`c.0``sssss./prog crash.unlAuthor’s remarks:
+A highly structured
+state state machine
+Purpose:
+Aesthetics:
+./iocccsize -i <prog.c, using the 2019 version of iocccsize, iocccsize
+returns 955, which is the Unicode codepoint of the
+λ character.one-liner. It certainly was for
+me. I like to think the tool is overwhelmed by the sheer length of the
+dividing line and totally overlooks the rest of the program.Usage:
+makeprog) accepts a single parameter with the
+name of an Unlambda program. You can download the Colossal Cave Adventure (the advent.unl file) and run it like this:./prog advent.unl
+
+make identifyprog2, which in turn will produce an Unlambda program
+identify.unl. make identify runs this program
+to identify itself.prog) implements an interpreter of
+Unlambda 2.0. It recognises all its builtins (k,
+s, i, v, c,
+d, .x, e, @,
+?x and |) including the syntactic sugar
+function r and formatting properties in the form of
+ignoring whitespace and comments to the end of line introduced by the
+# character.fseek(3)) Unlambda
+program source if it uses the c function, the program
+returns the message fail. It also informs you about
+syntactic errors in the Unlambda program should there be any (but only
+when the execution reaches them).Unlambda
+Hints:
+
+
+e work?fD0 function be called?Obfuscation sources
+
+
+d and the call with
+current continuation c.Build notes:
+-Wall -Wextra -pedantic. Those were produced because of the
+formatting of the source code, not any programming technique.
+Compilation with clang -Weverything produced many more
+warnings, but those are only relevant for multi-source-file projects and
+some are really questionable
+(e.g. -Wdisabled-macro-expansion).Portability:
+
+
+trivial.unl example from the reference Unlambda
+distribution produces segfault). Clang with -O3 option
+does this optimization well and said example does not segfault with it.
+I was not able to force GCC to optimize it out (probably an operator
+fault).union) had
+much more members originally. I joined all integers to a single
+long long member in the name of obfuscation. It is used for
+reference counting (only 1 for every reference) among other uses.
+size_t should be used for that, but practically, I think
+the memory would run out sooner than the reference counter in any real
+world situation even when size_t is bigger than
+long long. It is also used for storing chars
+for later printing. This might produce some warnings, but since it was
+developed using chars it should be always used safely.Spoilers:
+
+
+stderr is used.T.s combinator and the
+` application operation had to be broken down to pieces,
+one for each application/evaluation and corresponding helper functions
+for stack rebuilding. (the helper functions are named beginning with
+r instead of f)` application operation does the reading of the
+Unlambda source when needed. It also implements the promise function.
+Whenever it would apply it, it overwrites the Apply constructor in
+translation array T, changing its function to build an
+unevaluated sub-tree that is later evaluated whenever the promise is
+applied.Y to possibly confuse with
+Y combinator). Simple functions retained their names to
+misguide the reader to believe to know what is what. The names of
+continuation and exit functions were swapped. The names of
+S and Apply functions were shuffled both for S
+functions and Apply functions in the same way to hide the meaning of
+f and r prefixes.Identification spoiler:
+make identify output
+commemorates a previous IOCCC winner which uses
+similar methods to mess with the size tool.Judges’ spoilers:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2019/adamovsky
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 burton
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/burton
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dave Burton
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog < file
+
+./cow fileTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Synopsis:
+stdin. The output should look
+familiar.WARN="-Wno-implicit-int -Wno-missing-variable-declarations -Wno-parentheses"
+cc -Wall -Wextra -Weverything -pedantic $WARN -include stdio.h -o prog prog.cDescription:
+out=cat ./check.sh ./prog\a and \b are
+both counted whitespace(!), even though the relevant man pages on these
+systems omit these characters from the description.Limits:
+See Also:
+Bonus
+cc -Wall -Wextra -Weverything -pedantic -include stdio.h -o prog.clean prog.clean.cBugs
+cow.sh. This exercise left to the reader.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/burton
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 ciura
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/ciura
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Marcin Ciura
+Location: PLTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./getwords.sh en | grep .. | ./prog stringTry:
+./try.shAlternate code:
+stdout after writing a newline. See the Author’s remarks
+for more information.Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Alternate try:
+./try.alt.shJudges’ remarks:
+Author’s remarks:
+What is this?
+Example execution:
+$ grep .. /usr/share/dict/words | ./prog abcdefghijklmnopqrstuvwxyz
+qualm fjord wiz pyx vs beg kc nth
+quartz jinx vs fed kc womb glyph
+quid jamb fez vs pyx kc growl nth
+quiz fjord pyx vs bag kc mewl nth
+quiz fjord pyx vs gab kc mewl nth
+quiz fjord pyx vs gem bawl kc nth
+quiz fjord pyx vs meg bawl kc nth
+quiz fjord vex bawl kc gyp ms nth
+quiz jamb flex vs kc gyp word nth
+quiz jamb pyx vs kc flog drew nth
+quiz jamb pyx vs kc frog lewd nth
+quiz jamb pyx vs kc frog weld nth
+quiz jamb pyx vs kc golf drew nth
+quiz jamb pyx vs kc grew fold nth
+quiz jamb pyx vs kc grow nth fled
+quiz jamb pyx vs kc growl fed nthUsage:
+./prog LETTERS [N]N words composed of LETTERS to
+standard output, one per line. If N is not given, the
+number of words in the pangrams is unlimited. The characters in
+LETTERS must not repeat. The length of LETTERS
+must not exceed 97 characters.Helper scripts:
+
+
+./getwords.sh LANGUAGE_CODEaspell with a dictionary for
+LANGUAGE_CODE../wrapprog.py LETTERS [N]./prog LETTERS [N] except that it
+merges pangrams before passing them to prog and expands
+them in prog’s output. This way, it finishes the job faster
+than prog when there are millions of perfect pangrams. It
+requires a UTF-8 locale.Miscellaneous remarks:
+<wchar.h> among the programs that won IOCCC in the
+past), and obscure bugs (see the questions about Linux core
+dumps below).prog is internationalized and way faster. On my machine,
+./klausler abcdefghijklmnopqrstuvwxyz printed only 3,965
+perfect pangrams until I killed it after 144 hours running, while the
+equivalent
+tr A-Z a-z < /usr/share/dict/words | egrep -v '^[^ais]$' | ./prog abcdefghijklmnopqrstuvwxyz | wc -l
+finished in 62 minutes, reporting 1,640,569,315 perfect pangrams, and
+the example from section What is this? finished in
+1.35 seconds. On the other hand, prog can only output
+series of words with non-repeating characters, unlike
+klausler.fflush(stdout) after
+outputting each line, thus running faster. I am grateful to Witold
+Jarnicki for suggesting this change. The original prog
+finished the example above in 100 minutes instead of 62 minutes.grep .. [FILE] through prog to eliminate the
+pangrams that contain them.prog and aspell, some
+languages, e.g. Spanish, have no perfect pangrams.yes | ./prog y hang on Linux? Change
+static int to int and
+static wchar_t to wchar_t, and recompile
+prog. Why does yes | ./prog y dump core now?
+Change the line #define P 9<<23^1 to
+#define P 9<<23 and recompile prog. Why
+does yes | ./prog y exit gracefully?glibc
+2.22–2.29: 1 naq
+2.goto three times. While it could
+easily get by without goto M and goto H, I
+challenge the adherents of structured programming to refactor
+goto T, which jumps back into a nested if
+block.gcc and clang compile prog.c without warnings in C11 and C99 mode. For a
+clean compilation with gcc -std=c90, add
+-Wno-format to CSILENCE in
+Makefile.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/ciura
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 diels-grabsch1
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/diels-grabsch1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Volker
+Diels-Grabsch
Location: DETo build:
+makeTo use:
+./prog < file > file.ZTry:
+./try.shJudges’ remarks:
+/dev/zero file compresses
+identically by the entry and the standard compress(1) tool
+(see try.sh), but the text file compresses
+differently? The judges know. :)Author’s remarks:
+A tiny “compress” tool:
+Usage:
+./prog < input.txt > input.txt.ZExample:
+./prog < guidelines.txt > guidelines.txt.ZCheck for correctness:
+zcat guidelines.txt.Z > guidelines2.txt
+diff -s guidelines.txt guidelines2.txtzcat to verify the output file. The achieved compression
+ratio roughly matches that of the classic Unix compress(1)
+tool. And the source code is very compressed, too: It has exactly the
+same size as the paragraph you are reading right now. And exactly the
+same shape. Nevertheless, it is portable C99 code that runs on 32-bit
+and 64-bit platforms. It compiles without warnings on both GCC and Clang
+even with -Wextra and -Weverything.
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2019/diels-grabsch1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 diels-grabsch2
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/diels-grabsch2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Volker
+Diels-Grabsch
Location: DETo build:
+makeTo use:
+./progTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Almost a hash collision:
+$ sha512sum prog.c; ./prog
+43bd0c4381a5078d2850fca9ae5e0647596bcc03cd67d8d973ad02ff35c316c728e7b347ca70abe6c74e745e63646cc7643cb0cffcd3d9a969cbf31a7ce5bf68 prog.c
+43bd0c4381a5078d2850fca9ae5e0647596bcc03cd67d8d973ad02ff35c316c728e7b347ca70abe6c74e745e63646cc7643cb0cffcd3d9a969cbf31a7ce5bf68
+
+-Wextra -Weverything. The program is composed of mostly
+pure functions, and the #defines are only used to shorten
+redundant parts of the code, they are not meant to obfuscate much.
+Having that out of the way, how are step 1 and step 2 achieved then?
+"`x{bh}ndbq..."" character has already been run through the SHA-512
+computation by an external script. The internal state of the SHA-512
+computation at that point has been extracted and encoded into the
+string. This works because the preceding code is exactly 1280 bytes,
+which is a multiple of 1024 bits, the block size of SHA-512. The program
+itself then just continues the SHA-512 computation from that point,
+adding the last 1024-bit block, finalizing the hash and printing it. The
+last block is taken directly from the string literal at runtime, plus
+the subsequent code which consists of just ",
+; and \n. Those 3 characters are short enough
+to be hidden in … well, let’s leave this as an exercise for the
+reader.0x428a2f98d728ae22) would tell the reader immediately
+what’s going on. Because of the pre-computation, the 8 initial hash
+values are not needed, but the 80 round constants are.pow(3), this turned out to be harder than expected. If we
+were computing SHA-256, it would have been as simple as that, because
+the round constants would have been 32-bit values. However, SHA-512
+needs the cube roots at 64-bit precision, while double has
+only 53-bit mantissa precision.
+
+3*67=201 bits, but fortunately we only need to check if it
+is close enough to the actual prime. It won’t be exactly
+409.0000... anyway, but must be accurate enough to
+distinguish the correct cube root from its neighbours, e.g. the same
+number with the 64th fractional digit increased.2^24 each. During that calculation,
+at most two values are multiplied at once, and the accuracy of
+intermediate values is reduced using right-shifts as far as allowable
+for the computation. Finding working right-shift values was mostly
+trial-and-error, producing correct results for the first 80 primes, but
+not much more. Moreover, for some terms it was possible to leave them
+out entirely, especially higher-order terms of the last digits. Luckily,
+in the end, all intermediate results did fit into 64-bit integer
+addition and multiplication, but that was not obvious at the
+beginning.if(), where the final "\";\n" is stored, how
+to eliminate intermediate values and arrays by reordering of operations,
+and so on. But those were all minor issues compared to the challenges
+described above. What’s documented here is all you need to know to write
+your own version of that program.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory
+for 2019/diels-grabsch2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 dogon
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/dogon
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Gil Dogon
+Location: ILTo build:
+makeBugs and (Mis)features:
+
+STATUS: uses gets() - change to fgets() if possibleTo use:
+./prog < pattern.mcTry:
+./try.shJudges’ remarks:
+.mc extension stands for
+Golly macrocell format.
+
+0x10000000, otherwise the entry will
+promptly crash. To do this you can do:Author’s remarks:
+What is it?
+.mc files as standard input. Press
+- several time to zoom out if necessary, then press space.
+For acceleration press ] several times. That’s rather quick
+don’t you think?Historical Timeline
+
+
+Full documentation and keys
+UI
+
+
++/- keys (without pressing the shift on the
++)]: Increase speed (time step) by a factor of 2.[: Decrease speed (time step) by a factor of 2.G:), Internal memory allocated till
+now (M:), and then which Level is the current macrocell
+(L) and which zoom Scale you are watching
+(S).Portability issues
+Z=0x20000000) will need a
+system with 4GB DRAM to run nicely. There are several other salient
+assumptions though:
+
+sizeof(long)==8. However it actually
+almost avoids using any pointers which are 64 bits these days, in order
+to save space. On machines with sizeof(long)==4 try adding
+#define long long long …longs
+are supported, i.e. it assumes that a long can be loaded
+from any address that could hold an int otherwise. On non
+antiquated X86 you’ll be fine.Limitations:
+-DZ=... argument. With the default Z,
+the program will support in total about 240 million 64bit
+longs for the internal memory, which should be sufficient
+for about 100 million nodes+leafs, as each node is 3 longs
+and each leaf is 2.Z define must be a power of
+two!long integers are used in the drawing code. Reverting
+to doubles could have remedied that, but then I’d need to
+use a lot of ldexp()s which would take the program over the
+size limit. Also the program will crash once the universe goes past
+level 64, though this is simply fixed by modifying a single constant in
+the program, can you find it ? Anyway 2^58 squared is quite
+a big enough universe for such a tiny program to simulate, no ?33333
+steps.^C/intr to exit
+….Warnings
+-Wall! Does it think I have not memorized by
+heart C’s precious operator precedence table (or at least have a cheat
+sheet nearby) that it dares suggest extra parentheses that would take
+the program over the limit ? And what if I do not use a variable here or
+there, do I have to pay extra tax for every orphaned variable?longs printed
+as ints but its OK too, trust me.gets(3) being unsafe,
+which is indeed the only one that appears by default in some versions of
+gcc linker. Yes Virginia, I know it is unsafe, and I would not recommend
+anyone using this entry as part of a web daemon, or a spaceship, no,
+seriously don’ do that.Obfuscations:
+main() function
+there’s even a nice little identifier first used as a global and then
+reused (shadowed) in the same scope, and this did not produce
+even a little squeak of a warning from the compiler! Macro compression
+is rather sparingly used, however magic numbers abound everywhere, and
+bit twiddling is magical too. Do you know for example why we have
+unsigned F=-1 ? (No warning there of course :) Hint: Later
+in the program you have F/=17. Did that make any sense?
+Further hint: print the resulting F in hexadecimal…Further
+spoilers, engineering, and obfuscation galore:
+ldexp()s in the draw routine and has bigger constants, so
+it can zoom up to level 1024 if memory allows, and it tries its best to
+avoid dumping core on the poor user when its memory runs out, rather it
+enters freeze mode where you can still travel in calculated frozen
+space-time. Well, it’s not nice and tame, it even has an escape key,
+usage message, and to top it all it even avoids
+gets(3)!Special thanks:
+8*8 leaf:unsigned long life8x8(long a) { unsigned long aw = a << 1, ae = a >> 1, s0 = aw
+^ ae, s1 = aw & ae, hs0 = s0 ^ a, hs1 = (s0 & a) | s1, hs0w8 = hs0 >> 8, hs0e8 =
+hs0 << 8, hs1w8 = hs1 >> 8, hs1e8 = hs1 << 8, ts0 = hs0w8 ^ hs0e8, ts1 = (hs0w8
+& hs0e8) | (ts0 & s0); return (hs1w8 ^ hs1e8 ^ ts1 ^ s1) & ((hs1w8 | hs1e8) ^
+(ts1 | s1)) & ((ts0 ^ s0) | a); }Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/dogon
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 duble
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/duble
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Etienne Duble
+Location: FRTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog fileTry:
+./prog /tmp/drawing./prog /tmp/drawingmake clobber fullscreenmake clobber LINES=20 COLUMNS=20 all
+
+
+p key: enter pen mode (type p
+again to return to the default move mode).l key: enter line mode (type
+l again to validate the line and return to the
+move mode).c key: cycle through a small set of different
+colors.q key: quit the editor. The drawing is automatically
+saved./tmp/drawing
+Alternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+p or l (they toggle).Author’s remarks:
+Introduction:
+Getting started:
+make (assuming gcc) or
+make CC=clang../prog /tmp/drawingprog will refuse
+to start.)Edit features:
+
+
+p key: enter pen mode (type p
+again to return to the default move mode).l key: enter line mode (type
+l again to validate the line and return to the
+move mode).c key: cycle through a small set of different
+colors.q key: quit the editor. The drawing is automatically
+saved.Bonus features:
+
+
+./<the-file>. (This will fail if
+someone is still editing the file, though.)ls --color <drawing-files...> will probably
+select different colors to indicate whether a drawing file is being
+edited or not. :-)Obfuscation:
+
+
+stdlib.h call results are
+inferred.A few more things:
+enum declaration? Could it be just an
+int or const int variable, instead? (spoiler:
+http://c-faq.com/ansi/constasconst.html)Limits, Portability:
+xterm,
+gnome-terminal, terminator, etc.prog generates are probably even
+more portable than prog itself!Drawing area size:
+The drawing
+area size is set at compilation time:
+make clobber fullscreen
+
+prog.c vs prog.alt.c
+FD_SET inside an expression, which breaks compilation on
+macOS. Wrapping this macro into a function was enough to fix this
+compilation issue.sysctl parameters to make it work on
+FreeBSD (this was the purpose of file check-os.sh). I tried hard to tune macOS the
+same, but failed.sysctl parameters, and
+it works on macOS too! I must confess it was challenging to remain below
+the size limit with this little change.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/duble
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 endoh
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/endoh
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+make-g was enabled for this entry because it is SUPPOSED to
+crash and it needs debugging symbols.Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./progTry:
+gdb(1) installed:./try.shgdb(1) takes multiple
+steps - it’s not just a matter of installing gdb(1) and
+that’s that. The try.sh script has only been tested
+with linux.gdb ./prog || lldb ./progr (to run program) and then
+bt (for backtrace).Judges’ remarks:
+man 7 ascii when debugging it to reveal its
+purpose.Author’s remarks:
+backtrace quine:
+cc -g -O0 -o prog prog.c$ ./prog
+Segmentation fault (core dumped)$ gdb ./prog
+(gdb) run
+Starting program: /home/.../prog
+
+Program received signal SIGSEGV, Segmentation fault.
+0x0000000000000000 in ?? ()
+(gdb) backtrace
+#0 0x0000000000000000 in ?? ()
+#1 0x0000555555555201 in x23 () at prog.c:35
+#2 0x000055555555571a in x64 () at prog.c:100
+#3 0x0000555555555747 in x65 () at prog.c:101
+#4 0x0000555555555774 in x66 () at prog.c:102
+#5 0x00005555555557ce in x69 () at prog.c:105
+#6 0x0000555555555828 in x6e () at prog.c:110
+#7 0x0000555555555747 in x65 () at prog.c:101
+ ...
+ 35 = '#'
+100 = 'd'
+101 = 'e'
+102 = 'f'
+105 = 'i'
+110 = 'n'
+101 = 'e'
+...One more thing:
+
+gdb -q -x prog.c ./prog | cat
+Reading symbols from ./prog...done.
+
+Program received signal SIGSEGV, Segmentation fault.
+0x0000000000000000 in ?? ()
+#0 0x0000000000000000 in ?? ()
+#1 0x0000555555555201 in x23 () at prog.c:35
+#2 0x000055555555571a in x64 () at prog.c:100
+#3 0x0000555555555747 in x65 () at prog.c:101
+#4 0x0000555555555774 in x66 () at prog.c:102
+#5 0x00005555555557ce in x69 () at prog.c:105
+#6 0x0000555555555828 in x6e () at prog.c:110
+#7 0x0000555555555747 in x65 () at prog.c:101
+...gdb -q -x prog.c ./prog | sed -n -r 's/#.*:([0-9]+)/\1/p' | awk '{printf "%c",$1}' > prog2.c
+diff prog.c prog2.cCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/endoh
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 giles
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/giles
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Edward Giles
+Location: AUTo build:
+makeTo use:
+./prog infile.wav outfile.wavTry:
+play MonodyVocals.wav
+./prog MonodyVocals.wav
+play out.wavplay comes from SoX, the Swiss Army Knife of sound
+processing programs. If you don’t have this installed, see FAQ 3.10: How do I compile and use an IOCCC
+winner that requires sound.Judges’ remarks:
+Author’s remarks:
+Description:
+floats, and that
+void (*)() and void (*)(void) are not the same
+thing../iocccsize -i is 2019.How to use:
+./prog input [output [size [dry [wet [damping]]]]]
+prog.exe input [output [size [dry [wet [damping]]]]]
+
+input: The path to the input file. Required.output: The path to the output file. Optional, defaults
+to out.wav.size: The perceived size of the room, i.e. the
+approximate amount of time taken for the echo to fade away. Optional,
+default 1.6 seconds.dry: The amount of unprocessed signal (“dry” in audio
+terminology) to add to the output. Optional, default 0.3 or 30%.wet: The amount of processed (“wet”) signal to add to
+the output. Optional, default 0.5 or 50%.damping: The amount by which high frequencies are
+damped out as the echo continues. This models the tendency for higher
+frequencies to be absorbed more than lower ones. Increasing this value
+causes the echo to be less “harsh” and more “muffled”. Optional, default
+0.06 or 6%.size, dry, wet, and
+damping can be specified either as decimal numbers
+(e.g. 0.35) or as percentages (e.g. 35%)../prog in.wav out.wav 1.8 80% 15%ffmpeg that can
+perform the conversion. Some of the advanced features of the WAV file
+format are also not supported, such as metadata, 3 or more channels, or
+a bit depth other than 16 bits. Fortunately, WAV files that don’t use
+these features are very common. The program validates the input file, so
+passing it a file it can’t process will cause the program to print
+Bad input file or
+Wave file must be 16 bits,1-2 channels. depending on what
+it thinks the problem is. If the output file cannot be opened, the
+program will print Can't open output file.Assumptions:
+
+
+float is a floating-point type of any size, such that
+all zero bits represents the number zero.int16_t and int32_t are 2’s-complement,
+sizeof(int16_t) == 2 and
+sizeof(int32_t) == 4.Obfuscations
+
+
+size parameter.#defines are used to abbreviate the code, which has a
+side effect of making it very slightly harder to read.
+
+k is just a general-purpose replacement for
+16.i is the number of delay-lines to allocate and use
+(currently 24).q is an abbreviation for multiplying two elements of
+w[] together.u() is used to display percentages with proper
+rounding.j() imposes an upper limit on a floating-point value,
+and then negates it. This operation is used eight times.D() abbreviates a call to setvbuf, used to
+speed up file I/O.l() is used to clip audio samples to the acceptable
+range, and convert them to 16-bit integers for output.g() handles errors.C() contains the bulk of the signal-processing code, as
+well as a preprocessor obfuscation trick: If you were to read the body
+of the macro out of context, it will appear to have multiple mismatched
+square brackets, since [ occurs more than ].
+However, this macro is always invoked with arguments such as
+C(v],+10) which contain an unmatched ]
+character. When the macro is used in this manner, the extra
+[s in the macro’s body are matched with the ]s
+added through the first argument.t that it contains pointers to the
+delay-line arrays.float w[] contains:
+
+w[0] to w[3])w[4]
+to w[9])w[10] to w[20])int32_t f[] is even more multi-purpose. It contains:
+
+f[0] to
+f[11])f[12])f[13])f[14])f[15])f[16] to f[39])f[40]
+to f[63])f[64] to
+f[87])int32_t*), and then XORing the sequence of
+ints with a known numeric sequence. The “decryption” is not
+done in-place, to avoid writing over the string constant.int32_t *c is a pointer that points into
+f[], except that it is often incremented or decremented
+when it is accessed. In order to determine which indices of
+f[] are being accessed through c at any given
+point in the code, you would have to locate the places where
+c is modified.f[] are being accessed, it takes extra effort to look up
+the WAV file format and determine which field that corresponds to.
+
+X[1] -> 1[X]f[14] -> 10[f+4]X[0] -> *X10[f]=f[13]<<2; f[1]=20+10[f]+k; is replaced with
+f[1]=20+(10[f]=f[13]<<2)+k;.
+
+12[f]=4[++c]>>k; was incorporated into
+w[0]*=6[f]; to yield
+w[0]*=(12[f]=4[++c]>>k,6[f]);w[15]=w[k]=e[12[f]]; w[11]=w[10]=e[1]; becomes
+w[11]=(w[15]=w[k]=e[12[f]],w[10]=e[1]);
+
+while(++f[15]<12); is used instead of
+f[15]=12;for(s=14[f]=0;s<f[13];s++) is used instead of
+f[14]=0; for(s=0;s<f[13];s++)printf("Hello, world!"); is
+mostly commented out.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/giles
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 karns
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/karns
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Joshua Karns
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog < textfile_that_fits_on_the_screenresetTry:
+./try.sh./prog < README.mdJudges’ remarks:
+make test, make it about 120x40
+to be safe, ensuring that you see the @ sign as well as the
+exclamation mark.M in YMMV stands for “mazing”.Author’s remarks:
+The Program:
+@) character, which is going to be the
+starting location, and a ! character which will be the
+destination.Compiling and Running:
+$(CC) -std=c99 -o tbfs prog.c$(CC) is cc, gcc, clang, or some other C
+compiler.cat <input file> | ./tbfs./tbfs < maze
+./tbfs < prog.cIssues
+
+
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/karns
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 lynn
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/lynn
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Ben Lynn
Location:
+USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./progTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Remarks:
+
+
+WeDontServeYourType: Compilation failing because of
+inscrutable type checking rules? Confused by the ever-growing mire of
+extensions to the type system? The solution is simple: no type checking.
+It also means no typeclasses. Just pass dictionaries
+explicitly.ZeroPauseGarbageCollection: Instead of disruptive
+stop-the-world garbage collection, we only tidy up when the world stops
+on its own accord, that is, on program termination.OneHundredPercentPure: Gone is the catch-all lawless
+IO monad. And no trace of those scary unsafeThisAndThat
+functions. All functions must be pure.SyntaxForTheMasses: See below.Building:
+cc -o prog prog.cDemos:
+Fibonacci numbers:
+(./prog < fib.hs ; cat prog.c) > fib.cghc ghcfib.hsSelf-hosting compiler:
+(./prog < hint.hs ; cat prog.c) > hint.c
+make hint
+./hintequirecursive types for it to work.Regexes:
+a and
+b that contain an even number of as.(./prog < lol.hs ; cat prog.c) > lol.c
+make lol
+./lolghc ghclol.hsStrongly-connected
+components:
+(./prog < scc.hs ; cat prog.c) > scc.cmake scc
+./scc < example-1.txt
+./scc < example-2.txtSyntax
+
+: + - * / <=unsigned ints, and (:) is Haskell’s
+cons function. Like Haskell and unlike C,
+(<=) returns a Bool (which are Church
+booleans behind the scenes) and not an Int.Caveats
+Int. In particular, they
+represent characters. To interoperate with GHC, our compiler treats any
+undefined functions as the identity function, so that we
+may freely use ord and chr (or
+fromEnum and toEnum) to make our code
+acceptable to both compilers.[Int] -> [Int], and our compiler treats
+this like the function passed into Prelude.interact, that
+is, the entire standard input is passed to this function, and the result
+is printed to standard output.Bool must be defined as:
+data Bool = True | False;(<=).case expressions must list every
+data constructor in the order they are defined. For example, if we
+have:
+data Foo a b = Bar a | Baz | Qux Int [b]case expression that examines a term of this type
+must have the form:
+case x of
+ { Bar a -> ...
+ ; Baz -> ...
+ ; Qux n bs -> ...
+ }case alternatives.Why?
+Obfuscation techniques:
+
+
+ints (and header and footer) in C.n with a term equivalent to
+Y(BT)n; it works because
+Y(BT)ne = e(Y(BT)n).
+
+unions may have extra fields, and they’re ordered in such a
+way so we can reuse code to access certain fields.)undefined function compiles to the (.)
+function.(&&) with (||)
+and not using De Morgan’s law, which makes some comparisons
+less comprehensible.Y) combinator, which is
+represented by the variable "" during one stage of
+compilation.Warnings:
+-Wall with older
+standards, e.g. -std=c89, but less cleanly if
+-pedantic is also supplied.-Wall triggers a
+warning about a strange-looking comment.Behind-the-scenes commentary:
+Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/lynn
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 mills
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/mills
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Christopher
+Mills
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+make cpclean
+# Let this run for about about an hour and then kill it:
+./prog Shakespeare.txtTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Welcome to OMLET! 🍳:
+
+
+Getting started with OMLET
+
+
+make./prog Shakespere.txt./prog Shakespere.txt
+sins ohennAu
+T-teooclelp tiThoWy
+
+g
+nlakuafy
+e
+sselW usnsofueB Aoee pasfUsuslhe ooM ot Wou moy
+me neltAl -no IoyI mhuyakse inT-l chu ghenn ffo? fnsoe yhyye
+ue nnfrlass heUthole saounlcesyee pee
+t,
+T0:0% 3.210888
+o',,vU
+ An ,hTf lnm Far rur:s moilt WoEgrv wonds mith Aog thernw
+Rni So
+co Nnd :
+For an bImy pgafoun:
+Wf'r hom wortiverita
+int fod mous Eheledet,
+Tho he theket nonS wnu-ang dorlaMSp
+nrocWiSe tflg 'o.
+T0:0% 2.995950
+d whecedhencrysesil yr bn,
+we hh y thiwt
+
+
+hut fithlot,
+Fmdy s he alt
+Vh th no dh foud bobt werw:s Aotnf Fhwi't whe, eusu
+
+lhh thele wewcond ary soupfy wind tDont couc ths:
+er fucwald oncli hen bos, f
+T0:1% 2.878945
+T0:1% 2.878945
+ses, kuth
+LAs of the wish,
+As, I nos you,
+Yov not to nalll,
+Tr tot wonds.
+
+First Sondy, llt lrte, our, tw.
+
+First.
+
+BRUTUS:
+Helsting the kith gops of hoch Whay, fars surd what to,
+The cownens golt te.
+T0:12% 2.259114
+eplerrotrur tandans one wiok thy or thach and cullice ded yourssting
+And wours:
+Whed ur surt.
+
+SINENIUS:
+On we lain bith
+rerytund: tich lon hyivetetgor.
+
+VOLUONIA:
+He brich nom dove worthan then wise,
+T0:13% 2.254926
+y fath onother,
+I sucess,
+For I me the west crare.
+
+TRANIO:
+Whow and'd have not to had you you one in my lapteny she very ame come me a gut and shourd aghir you as ignested; shend to make I strem
+To h
+T0:99% 1.924063
+ notnce gaud and is nicked thou day, ha the dusing you disaid: in thim, you things in ere thee thus erile Iht that tare theme my hast thesp thou shay: thou not eaten-or-ho-bess resing: I the but had d
+T0:99% 1.923128
+V0:0% 1.678907
+V0:9% 1.700527
+V0:18% 1.733179
+V0:27% 1.714891
+V0:36% 1.716672
+V0:45% 1.782946
+V0:54% 1.835629
+V0:63% 1.876108
+V0:72% 1.906814
+V0:81% 1.924096
+V0:90% 1.954492
+V0:99% 1.969287
+serfs you'll alliencseard:
+We
+got you? before
+I say.
+
+Farstred dentlentecaly, sir, I it one bosticield
+All me the backnour mino,
+Whith capitaned mid! but stell the ifvemion
+Willerity.
+
+First Cumfol of
+T1:0% 1.885619
+V0:36% 1.716672cp01_1.970. This saves the state of the
+run at the start of the epoch 1, after computing a validation loss of
+1.970. The checkpoint is helpful if you need to stop and restart
+training. You can stop training by doing Control-C../prog Shakespeare.txt cp01_1.970Control-C. You
+should monitor the checkpoints to see that the validation loss continues
+to drop. If it rises, the network has probably started to overfit on the
+training data../prog < cp55_1.807Control-C to stop it.Experimenting with
+different networks
+make with the executable name prog) is the
+simplest recurrent neural network. It looks likeh = tanh(Wxh * x + Whh * h' + Bh)
+y = Why * h + By
+
+x is the input vectory is the output vectorh is the hidden state vectorh' is the previous value of hWxh, Whh, and Why are
+weight matricesBh and By are bias vectors.tanh(3) is the hyperbolic
+tangent functionW’s and B’s are the trainable
+parameters of the network, and the process of training is optimizing the
+values of these parameters to minimize the loss of the network across
+the training set.make lin1y = Wxy * x + By./lin1 Shakespeare.txt./lin1 Shakespeare.txt
+UERond w,
+
+
+Gir:
+KINof s, mesther s thouth.
+E:
+KINTret, at fu,
+GOMy t, as sth kesewit sooos atse ang k, ck,
+Sotheouserivesthecowhet been's, t he, h nre; t and, har wiread of pincer cedst sur has, ut:
+
+T14:67% 2.465115
+UKESpan,
+NGaromy soreate e m esewfoure pamitherarjulthengeoly tl.
+NG s at e! w.
+
+WAllinoully?
+Wamisw ofilem:
+I'delandinarrstath har aksubly s cath Whern t Is, weciss:
+
+GLat s; llde.
+Y aterit dsthence
+T14:67% 2.465404tanh(3)
+function in the RNN. tanh(3) acts as an activation
+function which adds nonlinearity
+to the network and allows it to solve complicated problems. Without
+nonlinearity, all of the linear functions would fold together into a
+single matrix-vector multiply and you’d effectively regress to the
+linear network above. Alas, even adding a nonlinearity to the
+feed-forward network (creating a perceptron) does not
+improve the performance because we still lack the history provided by
+the hidden state vector (although if you want to try it yourself, you
+can do so with make per1 - note that’s not
+perl the language but per with the digit
+1).Going deeper:
+h1 = RNN(h1', x)
+h2 = RNN(h2', h1)
+y = Why * h2 + ByRNN(h, x) defined as above. Each RNN module has its
+own set of parameters and its own hidden state vector. This will improve
+the network’s performance, at the cost of a much larger parameter
+space.
+Segmentation fault) unless the system
+stack size is first increased. The exact command for doing so depends on
+your shell and your system’s hard limits. On
+sh/ksh/bash shells, you can view
+the hard limit with ulimit -Hs and set it with
+ulimit -s 65532 (replacing 65532 with the
+actual hard limit). On csh/tcsh shells, you
+can view the hard limit with limit -h stacksize and set it
+with limit stacksize 65532 (replacing 65532
+with the actual hard limit).
+make rnn2make rnn3 if you want a three-layer RNN) and
+train it with./rnn2 Shakespeare.txtLSTMs and GRUs
+make lstm2./lstm2 Shakespeare.txt
+
+f = sigmoid(Wxf * x + Whf * h' + Bf)
+i = sigmoid(Wxi * x + Whi * h' + Bi)
+o = sigmoid(Wxo * x + Who * h' + Bo)
+c = f * c' + i * tanh(Wxc * x + Whc * h' + Bc)
+h = o * tanh(c)
+
+x is the input vectorh is the hidden state (and the output to the next
+layer)c is the cell state which represents the
+“memory” of the LSTMh' and c' are the previous values of
+h and c respectivelyf is the forget gate that tells the LSTM what
+portion of the hidden state to forgeti is the input gate that tells the LSTM what
+portion of the input vector to pay attention too is the output gate that tells the LSTM what
+portion of the cell state to use to generate the hidden stateWxf, Whf, Wxi,
+Whi, Wxo, Who, Wxc,
+and Whc are trainable parameter matricesBf, Bi, Bo, and
+Bc are trainable bias vectorstanh(3) is the hyperbolic tangent functionsigmoid is the logistic
+functionmake gru2Building your own networks
+Makefile comes with one-, two- and three-layer
+RNNs, LSTMs and GRUs, along with simpler feed-forward networks like
+multi-layer perceptrons and a linear network. This isn’t the limit of
+OMLET’s power – you can create your own networks by modifying the
+Makefile. Networks are passed in on the compiler’s
+command-line by using -D directives. The network is defined
+by a -DNW='...' command which consists of a series of
+comma-separated assignments. For example, the simple one-layer RNN could
+be defined like
+-DNW=' x = I(n), hp = I(128), \
+ h = C(hp, T(A(L(128, x), L(128, hp)))), \
+ y = L(n, h)'x as an input vector (there must be
+a declaration for x). It is declared as I(n),
+which is an input vector of size n, which is the number of
+characters of the input alphabet (OMLET computes this from the input
+file at the start of training). OMLET will arrange to present the input
+character as a one-hot vector based on
+the current input character.hp, declares the previous hidden
+state vector (what we called h' above). We declare this to
+be of size 128 – an arbitrary choice. A larger state vector can
+(theoretically) carry more state, but at a cost of larger parameter
+matrices and longer training time. You can experiment with increasing
+the hidden vector size and see.h, the
+hidden vector output to be the sum of two linear elements specified by
+L. The L function takes two parameters – the
+output vector size (which must match the size of h) and the
+input vector. L will compute y = W * x + B
+where each L has its own W (weight) and
+B (bias) training parameters. Both x and
+hp are sent through L and the result passed
+through the A function, which does vector addition. That
+result is passed through T which does element-wise
+tanh(3) activation.C function.
+C connects hp with h, causing the
+new value of h to be passed to the hp vector
+on the next iteration of the algorithm (allowing the RNN to retain state
+in h).L, this time producing a vector of size n,
+which will have the negative log likelihood
+function. This is assigned to y, which is the output of the
+network (and hence must also be declared).y result and pass it through the softmax
+function, which converts the log probabilities into a probability
+distribution. In inference mode, this is used to select the next
+character to emit. In training mode, this is used to generate the loss
+which is backpropagated.
+-DHS=128, \
+-DNW=' x = I(n), \
+ y = L(n, MD(MD(x)))' \
+-DBK=' hp = I(HS), \
+ z = S(A(L(HS, x), L(HS, hp))), \
+ r = S(A(L(HS, x), L(HS, hp))), \
+ c = T(A(L(HS, x), L(HS, hp))), \
+ zc = OG(1, -1, z), \
+ h = C(hp, A(M(zc, hp), M(z, c))), \
+ y = h'HS as the size of the hidden and cell vectors. There’s
+nothing special about this name, it’s just convenient to specify it so
+we don’t have a bunch of constants in the code. Second, the network
+itself is very simple – it declares x and has the matrix
+that converts the HS-sized hidden vector back to the
+n-sized alphabet vector… but it now calls MD,
+which is the user-definable module (here we are using it twice, to have
+two cascaded GRU blocks). The MD function performs the
+sub-network defined by the BK compile-time parameter
+(specified in the -DBK='...' setting). This sub-module
+again takes an x parameter and produces a y
+output. Inside it, we declare hp and h, the
+previous and current state vector, plus equations for the various GRU
+gates (these use S for the sigmoid activation function).
+One final new call is OG which does offset and gain,
+performing y = offset + gain * x where offset
+(the first parameter) and gain (the second) are constants.
+We are using this here to compute (1 - z) for the GRU’s
+linear interpolator.
+
+I(s): declares a vector (input or state) of size
+sL(s, x): learnable linear function
+y = W * x + B with an output vector size of
+sCM(x): learnable element-wise gain function
+y = W * xA(a, b): element-wise add: y = a + bM(a, b): element-wise multiply:
+y = a * bS(x): sigmoid activation function
+y = sigmoid(x)T(x): hyperbolic tangent activation function
+y = tanh(x)C(xp, x): copy x to xp in the
+next time step (propagate through time)OG(o, g, x): apply a constant offset and gain:
+y = o + g * xMD(x): apply the sub-network specified by
+BKMD in your network, you
+should still define BK by adding -DBK='y=x' to
+the command line, otherwise you will get a compile-time error.Hyperparameters
+-D on
+the compile command line. The list of hyperparameters follows:
+
+TP: Temperature parameter for use in inference mode.
+This divides the log probabilities before softmax. A low temperature
+makes the model choose safer but more boring choices. A high temperature
+takes more risks but makes more mistakes. Default is 1.0, which uses the
+computed probabilities.N: Batch size. This is the number of times the RNN is
+unrolled, so it controls how far back in the past the RNN can see. The
+default is 50. Larger batch sizes update the weights less frequently and
+allow the RNN to see farther back in time, but at a cost of
+proportionally more memory.TR: The percentage of batches in the input data set
+that will be used for training. The default value of 0.95 sets this as
+95%.LR: The initial learning rate, the default is
+0.002.LE: The epoch where the learning rate will start
+decaying. Defaults to epoch 10.LD: Learning rate decay, per epoch (after
+LE epochs). The learning rate is scaled by this number.
+Default is 0.97WD: Weight-decay parameter, to promote regularization.
+The default is 0.00008.RS: The random scale for weight initialization. Weight
+parameters will be initialized to be between -RS to
++RS. The default is 0.15.CL: Clamp value for gradients. Gradients will be
+limited to the range -CL to +CL. Default is
+5.B1: Momentum mean parameter for Adam optimizer. Set to
+0.9.B2: Momentum variance parameter for Adam optimizer, Set
+to 0.999.EP: Epsilon parameter for Adam, to provide numerical
+stability. Set to 0.00000001.DI: How often to print a training or validation
+progress message and inference snippet. The default prints every 100
+training batches.SL: The number of characters to print when doing an
+inference snippet. Default is 200.PF: Format string for the checkpoint filename. The
+default is "cp%02d_%.3f" which includes the epoch and
+validation loss. You may wish to add a subdirectory to the name to keep
+checkpoint files out of the current directory.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/mills
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 poikola
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/poikola
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Timo Poikola
+Location: FITo build:
+make-std=gnu11.Bugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog 512 ./prog
+
+sleep 86400; make clobber prog
+./prog 512 ./prog
+
+sleep 86400; make clobber prog
+./prog 512 ./progmake docspoikola.pdf for your
+enjoyment.Try:
+./try.shAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Alternate try:
+./try.alt.shJudges’ remarks:
+2 can be also said to be the greatest odd
+prime because it is the least even prime.Author’s remarks:
+How to build:
+gcc -O0 -o prog prog.cclang -O[0123s] -o prog prog.cclang -O1 -o prog prog.cPoster:
+make docs. This
+command creates a pdf file poikola.pdf. This requires the
+pdfTeX tool.What this entry does:
+
+
+
+
+main(), and do not use math.h
+nor predefined stuff at all. But wait, there are more rules: This work
+should reflect the extraordinary mind of Matti Nykänen, the all-time
+best ski
+jumper and amateur
+philosopher, who passed away on fourth of February 2019.Oh boys:
+iocccsize, using the 2019 version of
+iocccsize, is carefully selected. For the sake of clarity, I used
+single letter variables in the code. I also avoided unnecessary use of
+functions. Like a tripundra, this
+program has three levels. In order to reveal all of them, you have to
+compile this program on three consecutive days../prog <integer> <file><integer> is 224, 256, 384, 512 or even
+1024. Yes, I know 1024 is not a supported length of output, but as I
+said, the program does not validate its input in any way. These same
+parameters should be given in calculating a Fibonacci
+sequence or prime numbers.
+Please note that maximum file size is one gigabyte!Obfuscation:
+gotos
+instead of longjmp(3). Some Finnish ski jumping sites
+are used as labels, however, there is lahti instead of
+salpausselkä.SHA-3-512 Compatibility
+chart
+-std=).Missing a prime
+Observations
+gcc and clang are very fragile compilers. I
+spent numerous hours trying to achieve exactly the same output from
+different optimization levels and compilers. Small change in code can
+produce really unexpected results, i.e. the compiler can skip a few
+expressions or statements without obvious reason.Major spoilers
+Keith’s versus my algorithm
+(d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7. I noticed
+that (23*m/9+(m<3?y--:y-2)+d+4+y/4-y/100+y/400)%7 is one
+character shorter. In my solution, m<3?y--:y-2 is used
+directly, instead of assigning a value to d.Q is pronounced in Finnish exactly like
+kuu, a word for month or the Moon. So,
+Q = k is intended.^ is 94 in ASCII.Other stuff
+floats and binary
+representation of the string “25th IOCCC!”. (3) I don’t
+know. I used standard trigonometric
+functions from math.h
+for rotating the Big
+Dipper and later replaced those functions with my own
+implementations. But there was a bug in my code and the effect was more
+beautiful than intended. I did not even debug this bug and now it works
+as a feature. (4) It is not possible. If you change a single bit, the Fletcher’s
+16 checksum does not match anymore and goto jumps to
+the end of the code.sleeping time factor took about one minute. I realized
+that SHA-3 even with 224-bit output could take too
+much CPU
+time.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/poikola
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2019 yang
+
+
-
+ The International Obfuscated C Code Contest
+ 2019/yang
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Don Yang
Location:
+USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog sample_input.txt a b c d
+
+cat a
+
+cat b
+
+cat c
+
+cat d
+
+cat a b c d | ./progTry:
+./try.shJudges’ remarks:
+Author’s remarks:
+Summary:
+./prog original.txt > scrambled.txt
+
+./prog < scrambled.txt > unscrambled.txt./prog input.txt output1.txt output2.txt ...
+
+cat output1.txt output2.txt ... | ./prog > unscrambled.txt./prog original.txt | ./prog - > scrambled1.txt
+./prog original.txt | ./prog - | ./prog - > scrambled2.txt
+./prog original.txt | ./prog - | ./prog - | ... > scrambled3.txt./prog input.txt | ruby prog.cDetails:
+./prog input.txt > output.txtcat to unscramble the output text.cat output.txtstrings(1) and see that most of the original
+strings are gone. What happened is that the original text has been
+shuffled with ANSI cursor positioning codes inserted in such a way that
+characters are printed in random order. This effect is more visible if
+there is a delay after each character is printed. For convenience, a
+utility is included in the source to output characters slowly:./prog input.txt | ruby prog.c- as the first argument:./prog input.txt | ./prog - | ./prog - | ..../prog input.txt output1.txt output2.txt ...
+cat output1.txt output2.txt ... > unscrambled.txtcat if the input fits
+in a single terminal screen. If you don’t know what will be the terminal
+size of the recipient, note that prog.c will fit in a 80x25
+terminal, so a good guideline is to pick files that have fewer rows and
+columns than prog.c.cat
+will not be sufficient for unscrambling because any scrolling causes the
+character positions to be misaligned. But fear not, this utility also
+includes unscrambling functionality. If no argument is specified, input
+will be read through stdin and unscrambled to
+stdout:./prog < scrambled.txt > unscrambled.txt./prog input.txt output1.txt output2.txt output3.txt
+./prog < output1.txt > layer1.txt
+./prog < output2.txt > layer2.txt
+./prog < output3.txt > layer3.txt./prog input.txt | ./progFeatures:
+UTF-8 support:
+Error handling
+stderr, and the utility will exit with nonzero
+status.CRs
+are silently dropped. In fact, most control codes are silently ignored
+except line feeds (preserved) and tabs (expanded to 8 spaces).Compatibility
+
+
+Full version
+prog.c fit in a 80x25
+terminal without wrapping. If I were not constrained by space, I would
+have made an ASCII art out of it. violet.c is
+that program, and also comes with the minor benefit of supporting lines
+longer than a million columns depending on sizeof(int).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2019/yang
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2020 burton
+
+
-
+ The International Obfuscated C Code Contest
+ 2020/burton
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Dave Burton
+Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./prog arg ...Try:
+./try.shAlternate code:
+Alternate build:
+make builds the alternate code by default.Alternate use:
+prog_be as you would prog above.Judges’ remarks:
+./prog 128 128 and ./prog 128 128 128 128 but
+not ./prog 128 128 128?XORed.make testAuthor’s remarks:
+Rule 2-ish:
+B,I,T,S to the Makefile allows the code to be compiled for either
+LE (little-endian) or BE (big-endian) machines(!!), so they are truly
+configuration parameters, not logic.Notes:
+ping argument only. It will segfault on zero
+arguments, and display strange results with more than one argument.0 .. 511, sorta, for LE; 0 .. 255 for BE.
+Bonus points if you can explain why the limits work this way.long longs are required.Compilation:
+clang -Wall -Weverything -pedantic, but you need to add
+--include stdio.h --include stdlib.h for the
+printf(3) and atoi(3).clang -include stdio.h -include stdlib.h -Wall -Weverything -pedantic -DB=6945503773712347754LL -DI=5859838231191962459LL -DT=0 -DS=7 -o prog prog.cclang -include stdio.h -include stdlib.h -Wall -Weverything -pedantic -DB=7091606191627001958LL -DI=6006468689561538903LL -DT=1 -DS=0 -o prog_be prog.c./prog 1; ./prog_be 1Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2020/burton
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2020 carlini
+
+
-
+ The International Obfuscated C Code Contest
+ 2020/carlini
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Nicholas
+Carlini
Location: USTo build:
+makeBugs and (Mis)features:
+
+STATUS: INABIAF - please **DO NOT** fixTo use:
+./progTry:
+./try.sh# Play with a friend, real or imagined, P1 and P2, squares are numbered 1..9
+./progJudges’ remarks:
+printf(3) statement
+wrapped in a while loop. You would not think that this
+would amount to much, but you would be very, very wrong. A clue to what
+is happening and how this works is encoded in the ASCII art of the
+program source.Author’s remarks:
+CHESSTIC-TAC-TOE?USAGE
+cc -o prog prog.c
+./prog
+1 | 2 | 3
+---------
+4 | 5 | 6
+---------
+7 | 8 | 9
+
+LIMITATIONS
+-Wall -Wextra -pedantic will result in a warning
+about oversized strings.)echo "1 2 3 4 5 6 7" | ./progOBFUSCATION
+printf(3).int main() {
+ while(*d) printf(fmt, arg);
+}fmt is a single string, and arg is a
+series of arguments to printf(3).printf(3) also happens to be Turing complete. (See
+“Control-Flow Bending: On the Effectiveness of Control-Flow Integrity”
+where we introduced this in an actual, published, academic paper. The
+things you can get away with sometimes.)abuse this fact to implement the logic of
+tic-tac-toe entirely within this one printf(3) call (and a
+call to scanf(3) to read user input).Preliminaries
+printf(3) format specifiers.
+
+%d takes an integer argument and prints it.%s takes a string argument and prints it.%n takes a pointer and writes (!!) the number of
+bytes printed so far.
+
+"%hhn": store the number of bytes written mod 256 to
+the char pointer."%2$d": print argument 2 to printf(3)
+(and not the sequentially next argument)."%8d": pad the printed integer to 8
+characters."%3$.*4$d": print argument 3 to
+printf(3) with as many zeros as in argument 4.printf("%1$.*2$d%3$hhn", 5, 10, &x)x = 10;0000000005 (5 padded to size
+10) and then write the number of bytes written to x.
+printf(3) Oriented
+Programmingprintf(3) treating
+memory as a binary array–one bit per pair of bytes:
+
+00 00.xx 00
+where xx is any non-zero byte.printf("%1$s%2$s%3$hhn", a, b, c)*c = strlen(a) + strlen(b)strlen(x) is 1 for a 1-bit
+and 0 for a 0-bit, we have*c = a | bprintf("%1$255d%1$s%hhn", a, b)*b = (strlen(a)+255)%256 = strlen(a)-1strlen(x) is either 1 or
+0 we have*c = !bTic-Tac-Toe
+A, B, and C be pointers to three
+squares in a row to test, and D be where to save if there
+is a win or not."%A$s%B$s%C$s%1$253d%11$hhn" // r11 = !(*A & *B & *C)
+ZERO
+"%11$s%1$255d%11hhn" // r11 = !r11
+ZERO
+"%11$s%D$s%D$hhn" // *D = *D | r11*D to 1 if there is a
+three-in-a-row. We repeat this for all possible three-in-a-row
+configurations, for both players."%1$hhn%1$s" (repeated 256 times)"%1$hhn" will write zero to argument 1 and then “%1$s” will
+never emit any text. If, on the other hand, the count is not 0 mod 256,
+a length-1 string will be written to argument 1, and then
+"%1\$s" will increment the count by one. By repeating this
+256 times we’re eventually going to reach 0 mod 256.1$ the pointer to player 1’s
+square, and 2$ the pointer to player 2’s, and in
+3$ the pointer to the board string, we can compute"%1$s" (repeated 47 times) "%2$s" (repeated 56 times) %1$32d%3$hhn"*r3 = (*r1) * 47 + (*r2) * 56 + 32' ' if neither are true,
+'X' if r1 is true, or 'O' if
+r2 is true.Further Obfuscations
+printf(3) statement, we finish the statement
+with"\n\033[2J\n%26$s"char* in memory,
+that initially is undefined, but within the printf(3)
+statement we will construct this string to look like a tic-tac-toe
+board.
+P1>_
+P2>_
+P1 WINS
+P2 WINS
+P1 TIES
+P2 TIES*byte4 = is_win * 'W' + is_tie * 'T''I' and 'S' can always be the
+same, and we do the same for 'E'/'N'.scanf(3)
+format string, but for a different reason. We first want to run
+printf(3) to show the first board, and then alternate
+between runs to scanf(3) and printf(3) reading
+and then displaying moves. Importantly, we do not want a final
+scanf(3) when the game ends. It should just exit.printf()
+while (*ok) {
+ scanf();
+ printf();
+}printf(3)
+we require. So instead we implement it like thiswhile (*ok) {
+ scanf();
+ printf();
+}scanf(3) as an argument to
+avoid the extra statement, but it has the same effect.)printf(3). In order make
+sure the program doesn’t block before the first printf(3),
+we initialize the scanf(3) format to the NUL string so that
+it returns right away without blocking. The first time the
+printf(3) call runs, it writes out "%hhd" to
+create the scanf(3) format string.Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2020/carlini
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2020 endoh1
+
+
-
+ The International Obfuscated C Code Contest
+ 2020/endoh1
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+# IMPORTANT for macOS: run under Terminal.app
+
+./progTry:
+# IMPORTANT for macOS: run under Terminal.app
+
+# Try resizing the terminal window before the first click.
+
+# Try resizing the terminal window after the first click.
+
+./prog ioccc.txt
+
+./prog unwinnable.txtAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+For macOS:
+/System/Applications/Utilities/Terminal.app.Author’s remarks:
+Semi-automatic Minesweeper:
+
+
+How to use:
+gcc -o prog prog.c -lncurses
+./progKeyboard commands:
+
+
+r: new game (You can also click the smiley face at the
+top line.).q: quit.Internals:
+Rule 1:
+
+? ? ? . . .
+? 3 ? => . 3 .
+! ! ! ! ! !? is an unprobed cell (it is unknown whether
+the cell has a mine or not); ! is a flagged cell (it is
+already known that the cell has a mine); and . is a probed
+cell (it is already known that the cell has no mine).Rule 2:
+
+. ? ? . ! !
+. 4 ? => . 4 !
+. 2 ! . 2 !Rule 3:
+A and B. If
+A is equal to the difference of B and the
+count of B’s unprobed and flagged neighbors that are not
+A’s neighbors, all A’s unprobed neighbors that
+are not B’s neighbors are probed.
+? ? ? . . .
+? 1 ? ? => . 1 ? ?
+? ? 4 . . ? 4 .
+ ? . ! ? . !A and B are probed cells whose numbers are,
+respectively, 1 and 4. The count of B’s unprobed and
+flagged neighbors that are not A’s neighbors is three (one
+! and two ?s). Since
+A == B - count (1 == 4 - 3), the left and top
+unprobed cells are probed.Rule 4
+A and B. If
+B is equal to the difference of A and the
+count of A’s unprobed and flagged neighbors that are not
+B’s neighbors, all of A’s unprobed neighbors
+that are not B’s neighbors are flagged.
+? ? ? ? ! ? ? ?
+? 3 1 2 => ! 3 1 2
+2 2 . . 2 2 . .A and B are probed cells whose numbers are,
+respectively, 3 and 1. The count of A’s unprobed and
+flagged neighbors that are not B’s neighbors is two (left
+?s). Since B == A - count
+(1 == 3 - 2), the left unprobed cells are flagged.Note
+One more thing
+ ./prog ioccc.txt
+width height number-of-mines priorities-of-each-cell...Bug fixes and Credits
+-O3 is used. So I changed the code a little to pretend to
+use the return value of fscanf(3).Copyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2020/endoh1
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2020 endoh2
+
+
-
+ The International Obfuscated C Code Contest
+ 2020/endoh2
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./progTry:
+./try.sh./prog prog.cJudges’ remarks:
+Author’s remarks:
+cc -std=c99 prog.c
+./a.out
+./a.out hello.txt
+./a.out yoda.txt
+./a.out bear.txtCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2020/endoh2
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+ 2020 endoh3
+
+
-
+ The International Obfuscated C Code Contest
+ 2020/endoh3
+
+
+
-
-
+
+
+
+
+
+
+
+
Name: Yusuke Endoh
+Location: JPTo build:
+makeTo use:
+./progTry:
+./run_clock
+# And watch closely for 15-20 secondsAlternate code:
+Alternate build:
+make altAlternate use:
+prog.alt as you would prog above.Judges’ remarks:
+Author’s remarks:
+make clockCopyright and CC BY-SA 4.0
+License:
+
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)Inventory for
+2020/endoh3
+Primary files
+
+
+Secondary files
+
+
+
+
+
+
+
+
+
+
Name: Cody Boone
Ferguson
Location: US
make test
WAIT=75 WALLS=1 CANNIBAL=1 ./prog
diff --git a/2020/ferguson2/index.html b/2020/ferguson2/index.html
index b30837a90..d74caee39 100644
--- a/2020/ferguson2/index.html
+++ b/2020/ferguson2/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,1053 @@
-
-
+
+
+
+
+
+
-
-
-2020 ferguson2
-
-
+
+
+
+2020/ferguson2
+
+
+
+
+
-2020 ferguson2
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/ferguson2
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/ferguson2/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Cody Boone
+Ferguson
Location: US
+
+
+To build:
+make
+The author provided alternate code that prints the output one
+character at a time to make it a bit more like the real thing in that it
+isn’t dumped out all at once. See Alternate
+code below.
+To use:
+./prog
+
+# get recode help:
+./recode -h
+
+# general syntax for recode passing to Enigma machine:
+./recode [options] | ./prog - 2>/dev/null
+# general syntax for recode without passing to Enigma machine:
+./recode [options]
+
+# recode prompts for settings; pass to Enigma machine:
+./recode | ./prog - 2>/dev/null
+
+# recode reads from input file, prompts for settings; passed to Enigma machine:
+./recode -finput | ./prog - 2>/dev/null
+
+# recode reads config from string or file; passed to Enigma machine after
+# prompting for input:
+./recode -R<string|file> | ./prog - 2>/dev/null
+
+# write config to output file; passed to Enigma machine after prompting for
+# input:
+./recode -o<config> | ./prog - 2>/dev/null
+
+# pseudo-randomly select settings
+./recode -r
+
+# show Enigma machine settings after selection / generation:
+./recode -v
+NOTE: in recode no spaces
+between options and option arguments are allowed.
+Try:
+./try.sh
+What does:
+echo | ./recode
+echo | ./recode -v
+do?
+Alternate code:
+This version, prog.alt.c, writes a character
+at a time, sleeping after each character, so that one can read it more
+easily (for longer output) and to make it a bit more like the real
+thing.
+Alternate build:
+make alt
+The default time to sleep is 400000 microseconds but you can change
+this by doing:
+make clobber SLEEP=600000 alt
+to change it to 600000 microseconds. It guards against negative
+numbers.
+Alternate use:
+Use prog.alt as you would prog above.
+Alternate try:
+./try.alt.sh
+Notice how only the last part should use the prog.alt.
+Why? Try it and find out! Can you figure out why this works this
+way?
+Judges’ remarks:
+This code is an enigma.
+Try to decode it!
+There is a good deal of useful documentation that is provided with
+this entry:
+
+- enigma.1 - A useful man page for this entry.
+To render, try:
+
+man ./enigma.1
+
+- recode.html (or recode.md if reading on GitHub)
+
+- Some useful information about recode.c
+
+- chocolate-cake.html (or chocolate-cake.md if reading on GitHub)
+
+- Because most of us could use some Double-layered Chocolate Fudge
+Cake!
+- NOTE: see recode.html (or recode.md for details about how to decrypt
+this!
+
+
+Author’s remarks:
+My remarks about my Heer
+(army) and Luftwaffe (air force)
+Enigma
+machine simulator for the 27th IOCCC.
+I want to dedicate this entry in part to the millions of poor souls
+that were lost during the tragedy that is the Second World War.
+There are so many people who are unknown, unloved, unclaimed and even
+unidentified. And who knows what they might have gone on to do if their
+lives weren’t - like it is with all other wars - needlessly taken from
+them? When one considers it was all because the most powerful man in the
+world at the time felt he should rule all others it makes it somehow
+even more tragic: there wasn’t even a good reason for the war (is there
+ever?).
+If one were to write the name of every person who died in the
+conflict in a book, it would take so many pages that the book would be
+so heavy, so long, so expensive to print and it wouldn’t bring anyone
+back to life nor would it erase the suffering. Nothing will. It’s
+horrible.
+There really are no words that can truly describe the tragedy but I
+wish to with my Enigma
+simulator honour each and every soul who was lost, or suffered, or
+suffered the loss of friends or loved ones, as well as the world itself,
+in and from one of the greatest tragedies in the history of mankind.
+I have more information on this entry like the testing procedure at
+https://ioccc.xexyl.net/2020/enigma.
+
+
+
+-
+
+- Example run
+
+
+
+
+
+Bugs, limitations, differences from the real
+Enigma machines and general notes
+
+
+
+
+
+IOCCC: an
+Enigma?
+Is there a better single word that could describe the code that is
+IOCCC? I’m sure there are some other words that are equally as valid but
+I believe ‘Enigma’ is a great word nonetheless.
+However it’s curious that no winning entry has ever been a simulator
+of the German
+Enigma machine. I was actually quite surprised (though pleased as it
+gave me the chance to learn about it and submit and win an entry) at
+that because it’s such a brilliant piece of engineering of the time even
+though it had a critical flaw: that no letter could be itself; this
+combined with cribs (known or suspected plaintext) - which was down to
+carelessness, capturing an Enigma and sometimes settings sheet, as well
+as known messages the Germans started out with - allowed for cracking
+the code.
+Combining this entry with two of the Morse code entries
+is particularly interesting because that’s what the Germans did: the
+party sending the message would first set up the machine, write down the
+letters and then transmit by Morse code the
+encoded message. Then those picking up on the message would note the
+Morse code, translate it to the alphabet and then input it into their
+Enigma machine configured in the same way and thus have the original
+message.
+The 1998 ASCII
+/ Morse code translator entry by Franz van Dorsselaer
+prints the Morse code of text; and the 2014 Morse audio
+transcoder by Daniel Vik can
+be used to allow for the actual sound of it. With my entry we can
+complete the loop!
+The
+1992 Nathan Sidwell entry
+The author Nathan Sidwell
+of the 1992 Worst
+Abuse of the Rules had this to say about his program:
+
+This program is a hello world text encrypter/decrypter. It uses an enigma
+(I think) style encryption algorithm, where the encryption key character
+is modified by a value, determined from the previous character.
+Non-printable characters (those with ASCII values < ' '
+or > 0x7e) are passed unaltered, thus any kind of file
+may be successfully processed, but if the original is printable, the
+processed file will be too. The input is read from stdin, and the output
+presented to stdout. The key, a text string, is presented as a command
+argument. This is optional, and if omitted, the file is
+self-{de,en}crypted. To specify decryption, a - should be
+given before the key. (Actually encryption and decryption proper inverse
+operations, so you can use decrypt to scramble and encrypt to
+descramble, if you’re perverse.)
+
+But the Enigma algorithm is more complex than that and my entry can
+encipher (and by extension decipher) text in the manner of the Enigma
+machines of the Heer
+(army) and Luftwaffe (air
+force); the Kriegsmarine
+(navy; literally War Nazy) was more complex (see section Kriegsmarine support? for more information on
+that.
+My entry should also work as a non-military grade Enigma; they had no
+plugboard
+and by default mine is empty. I explain how to set up the simulator
+later.
+Yusuke Endoh asked the
+judges and me if the real 1992 entry source was available. Simon Cooper
+didn’t have access to it because it was before his time in the IOCCC;
+but before the other judges could answer Ilya Kurdyukov sent a link to
+the original 1992 code. As of 4 March 2023 the original before unseen
+code was published but I leave this in for historical purposes.
+Usage
+If you run the program by itself it’ll use the default settings and
+prompt you for input (end with EOF). At that point it’ll process the
+input string and print the result (after finishing the enciphering).
+If you run it like:
+./prog -
+It will prompt you for the settings of the machine (example
+below).
+The first group is in the order of rotor
+(number), ring
+setting (letter) and ring (starting) position (letter). It will do
+this for the first, second and then third for each.
+Then it will prompt you for the reflector
+(by number). The first one is reflector B and the second is reflector
+C.
+Finally it’ll prompt you for the plugboard
+pairs.
+After that you can input the string and it’ll go from there.
+Example run
+BTW: There’s a much more entertaining (and delicious) challenge or
+exercise in recode.html (if you’re reading
+this on GitHub check the recode.md file
+instead); this involves chocolate-cake.html (if on GitHub see here) though one might need a different
+kind of exercise after taking up the challenge! :-) These however show
+the general program as well as how to use the two winning entries of the
+Morse code that I
+referred to earlier:
+$ ./prog -
+Ring 1: 3
+Setting 1: I
+Position 1: O
+Ring 2: 1
+Setting 2: C
+Position 2: C
+Ring 3: 5
+Setting 3: C
+Position 3: Z
+Reflector: 2
+Plugboard pair 1: CO
+Plugboard pair 2: DE
+Plugboard pair 3: SN
+Plugboard pair 4: XY
+Plugboard pair 5: MS
+Plugboard pair 6: AT
+Plugboard pair 7: VF
+Plugboard pair 8: UR
+Plugboard pair 9: KL
+Plugboard pair 10: BJ
+IOCCC
+^D
+CFDRG
+Notice that all output except the deciphered/enciphered text is sent
+to stdout.
+If I didn’t specify the - by
+e.g. echo IOCCC | ./prog then it will use the default
+settings; as the judges suggest this invocation I will not show it
+here.
+But you can also type it out like this:
+$ ./prog
+IOCCC
+UUMMX
+The IOCCC comes from stdin; the UUMMX is written to
+stdout.
+If I compile the 2014 entry and copy it to my local directory as
+vik I might do:
+$ echo TEST|./prog |./vik | mplayer -demuxer rawaudio -
+And you would hear Morse code of the Enigma
+output of ‘TEST’ (i.e. KCWV)! Or perhaps not in this case.
+I’m not sure: I discovered a bug in that entry (Fedora, CentOS and macOS
+all affected).
+For example I can use the syntax provided in the winning remarks
+along with my entry to write it to a file. Say:
+$ echo TEST|./prog |./vik > test.raw
+$ ./vik e < test.raw | ./prog
+LEST
+Why did that happen? This shows more details:
+$ ./vik e < test.raw
+SCWV
+However as can be seen the first char is wrong:
+$ echo TEST|./prog
+KCWV
+And piping the original output to my entry itself you get the
+original input:
+$ echo TEST | ./prog | ./prog
+TEST
+I’m not sure what causes that or if there’s a way to fix it but
+that’s the idea anyway. Neither do I know if the original transcoding is
+correct.
+What if I use the input string LEST instead? In that
+case it worked fine:
+$ echo LEST | ./prog | ./vik > lest.raw
+$ ./vik e < lest.raw | ./prog
+LEST
+But there’s one obvious question, right? Let’s try the most important
+one:
+$ echo IOCCC | ./prog | ./vik > ioccc.raw
+$ ./vik e < ioccc.raw
+UUMMX
+$ ./vik e < ioccc.raw | ./prog
+IOCCC
+Phew! The program redeemed itself after the test failure! :)
+(Technically above it didn’t print a newline after the output and
+this is how it is with some of the things I pasted in the other file and
+maybe others here too. Notice also how it showed the same output that my
+program gave it - UUMMX.)
+What about the other Morse code
+entry?
+$ echo IOCCC | ./prog | ./dorssel
+..- ..- -- -- -..-
+The
+recode.c configurator
+I have included a supplementary program recode.c that can do a number of things which acts
+as a kind of wrapper and configurator to my entry. By default it prompts
+you for the settings (rotors, rings
+and ring settings and positions, reflector
+and plugboard
+pairs), validating input as you go.
+After that it prompts for text that you can pass to the Enigma
+simulator; alternatively you can specify a file to read in.
+It has a randomise mode and it can save/read the settings to/from a
+file to allow for duplicity (an archaic term for the state of being
+double but obviously for Enigma it has to also mean deceitful).
+I recommend using this in a pipeline instead of the simulator itself if you want to change the
+configuration of the simulator because it offers a much richer
+experience (and because you can reuse the configuration without having
+to type it out again every time).
+It does take the effort to try and prevent invalid input (as above)
+though maybe I didn’t think of everything. My entry was meant to be a
+simulator only as far as the ciphering goes but I thought this would
+make it much more interesting: make it more flexible by a wrapper
+program.
+For examples using it (and a delicious challenge) see recode.html (or recode.md
+if reading on GitHub). See also the recode.1 and
+enigma.1 man pages.
+A
+parser subtlety that could cause confusion
+The parser is in a sense rather rudimentary but allows for both
+interactive and automatic (e.g. via the recode
+program) input. This does mean that something like the following can
+happen:
+$ ./prog -
+Ring 1: 1AB
+Setting 1: Position 1: Ring 2: 2CD
+Setting 2: Position 2: Ring 3: 3
+Setting 3: A
+Position 3: B
+Reflector: 1A
+Plugboard pair 1: BC
+Plugboard pair 2: ..
+Plugboard pair 3: ..
+Plugboard pair 4: DE
+Plugboard pair 5: FG
+Plugboard pair 6: HI
+Plugboard pair 7: JK
+Plugboard pair 8: LM
+Plugboard pair 9: NO
+Plugboard pair 10: PQ
+IOCCC
+WD
+SIRDK
+First of all: what is that WD? I didn’t type that but it
+showed up hitting ctrl-d to end input.
+If everything is input correctly it would show nothing except the
+actual Enigma
+machine output (maybe at times ^D - I have noticed this at least
+when I don’t fill in all plugboard
+pairs - which might or might not be possible with the Enigma machines
+that had plugboards; I really do not know). I don’t view this as a bug
+because the parsing of input is meant to be simple and in fact you can
+expect the same output from the same input even if there are errors in
+the input.
+Anyway as you can see the first 1AB was the first ring,
+setting and position. After this it wants Ring 2 and I did similar; for
+ring 3 I did it each variable by itself. However for the reflector I did
+1A but it only expects 1 char! So will that mean that the
+plugboard pairs are off? Yes it does seem to be so. This is buffering at
+play I believe but it’s useful for allowing the recode
+program to easily configure the Enigma machine. In the recode.html file (or recode.md if reading on GitHub) file I give a hint
+as to how this could be fixed but the caveat is it would necessitate a
+need for rewriting recode.c.
+There’s another thing to be aware of and that’s the way the ranges
+are enforced. There are five rotors which obviously are in C 0-4 but in
+‘natural language’ 1-5 (they were labelled I, II, III, IV and V
+though).
+There are two reflectors
+and the same applies: in C 0-1 but in human it’s 1-2 (technically these
+were reflectors B and C in the Enigma machine which I display by name in
+recode.c just like with the rotors).
+For more information see recode.html (or recode.md if viewing on GitHub).
+BTW: If you need a reminder to go to the gym just do your Enigma ABCs
+and it should help you remember (though not at this time in our world it
+might help you later on?). This might become even more useful after the
+challenge is accepted, accomplished and made use of! :)
+$ echo ABC | ./prog
+GYM
+$ echo ABC | ./prog | ./prog
+ABC
+On the
+source code layout
+The layout of recode.c isn’t too significant
+(but see below) but I want to mention prog.c
+especially:
+I did think of a more artistic layout but reflecting
+on it I think that the blankness of it can be another way of honouring
+all the many people who died in - like all other wars - what was a
+useless conflict because - again like all other wars - a powerful human
+being decided that they should rule others.
+The blankness is a reflection
+of the millions of people who died unknown, uncared for, unloved,
+without ever being acknowledged in their far too short lives, some even
+unidentified; it’s the presence of absence.
+I find it somehow fitting that the day I have finished this is 30
+April 2020, which was exactly 75 years from the day that the person
+responsible for the Second World War,
+Adolf Hitler, ended his life. (I later made a bug fix but I consider
+this inconsequential).
+As for recode.c though I really love this:
+ /\
+ / This is *not* what you think:
+…because it seems so wrong in C code at first glance. Also what does
+the ‘this’ refer to?
+Obfuscation
+It’s an Enigma
+machine simulator! Isn’t that proof that it’s obfuscated itself?! :)
+Silliness aside obfuscation.txt has some
+of the ways I think this entry is obfuscated. To decipher try:
+./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > obfuscation.md
+To encipher:
+./recode -Robfuscation.key -fobfuscation.md | ./prog - 2>/dev/null > obfuscation.txt
+The file obfuscation.key is the key to
+decipher/encipher obfuscation.txt.
+For the lazy obfuscation.md has the
+deciphered version. I am afraid I’m not so inclined to do that for the
+cake recipe: the idea there is to make it a fun exercise that when
+solved unlocks a wonderful double-layered chocolate fudge cake recipe.
+But given that my ‘Don’t tread on me’ award
+entry also has the recipe
+(ferguson1/chocolate-cake.md if
+reading on GitHub), not enciphered, one might just go there instead.
+Still it’s a fun way to explore this entry.
+As for the obfuscation.key file if you
+observe the contents you’ll find the word OBFUSCATION:
+2OB5FU1SC2ATIONCDEFGHJKLMPQRYZ
+ OB FU SC ATION
+Bugs,
+limitations, differences from the real Enigma machines and general
+notes
+Ways that my simulator differs from the real thing. Not all of these
+are bugs and some could be considered features; others are just
+differences.
+
+Does not check for using the same rotor
+more than once. The real Enigma machines this would not work because
+they had to choose from a set of rotors and there were no duplicates.
+This shouldn’t be a problem here however except that it wouldn’t be a
+possible configuration of the real Enigma machine. The
+recode program however does validate this (except
+when reading in settings via the -R option which I explain
+in the recode.html file (recode.md on GitHub).
+The way the plugboard
+- for the machines that had them - is, if you connect A to B then no
+other letters can connect to A or B. Earlier there wasn’t proper
+detection and this caused invalid output.
+Why only 10 pairs when the German alphabet has 26 letters (the Enigma
+did not have the Eszett or the umlauts and in any case there is some
+disagreement about these being part of the alphabet; anyway for umlauts
+one can add an E after the letter and for the Eszett you can use ‘ss’ or
+‘SS’ which is what they did)? It’s theoretically possible to have 13 but
+the Enigma typically had 10 pairs. It’s easy enough to update my entry
+to do this once you de-obfuscate it but I’m not helping there (and in
+fact I don’t think I could any more even if I wanted to - at least not
+easily).
+It does not obviously have the clicking sound associated with the
+moving parts of the real machine. I think it would be annoying to have
+this as it processes each letter - but with the 2014 Morse audio
+transcoder entry you can at least have the output played in Morse
+code as the Germans did; I think that’s really cool (I think it’s really
+cool even if there’s a bug in it). That it pays homage to that (and
+another) entry is a bonus here.
+The simulator doesn’t report errors but
+tries to gracefully deal with them: if one chooses a value out of range
+it moves it into the range (if > the max then the max, if < min
+then the min). If invalid chars are input for the plugboard pairs then
+it’s not added to the plugboard etc.
+The real Enigma
+machines had only letters: no digits, no punctuation. My entry
+prints !isalpha() chars untouched. The Germans had
+different systems for punctuations, numbers etc. (one of the documents I
+link to has these details).
+My entry preserves case of letters. The real Enigma had only one
+case as it was just a keyboard and they didn’t need case-sensitivity.
+Context would be important as some words in German have different
+meanings depending on if capitalised or not (and all nouns are
+capitalised).
+Later models introduced a fourth rotor. The Kriegsmarine
+procedures were also far more complex than the Heer
+(army) and Luftwaffe (air force)
+(though apparently the additional notch provided another flaw). I find
+this particularly interesting because it was Hermann Goering who was the
+Supreme Commander of the Luftwaffe and the intelligence agency
+Forschungsamt (FA) was his; it provided Hitler with invaluable
+information so one would think the Luftwaffe system would be more
+complex! See Kriegsmarine support? for more
+information.
+I only include reflectors
+B
+and C. To have included more would have used too many bytes (each
+reflector and rotor
+is 26 characters!) and I could not include them for this reason; I
+include five rotors and two reflectors and that’s a total of
+(5 * 26 + 2 * 26 == 182 chars) but there are as you can see
+many other strings too. It is however feasible to update the rotor and
+reflectors options and you could even make your own versions if you
+wanted to. Doing this is an exercise to the reader however (the idea of
+trying this makes me cringe because of how I obfuscated things including
+encrypting some of it with the Enigma itself).
+
+There’s one thing I’m unsure of in my implementation. Because of all
+the possible settings I used some other simulators as a starting point
+and more importantly to validate that my code worked right. These other
+simulators had bugs though and so one thing looked odd and I don’t know
+if it is right or not. An online simulator appears correct but I don’t
+see the option to change that part.
+If you notice in the Q() function where I set up
+specific pointers and other data there is a call to the macro
+q but I only refer to the first ring setting (of which I no
+longer even know which element it is! Or was it position? I don’t even
+know that now for certain). That’s because the Python code did that
+(though very differently of course) but I also had to bug-fix the Python
+in another part.
+I do not know if this is correct but as I show somewhere my entry
+does match the online simulator so I presume it is correct. It might be
+that the Germans tended to have it at A but again I do not know.
+Kriegsmarine
+support?
+Is it possible to add Kriegsmarine
+support? I thought so by adding the additional rotors but looking at it
+again it appeared that it’s not as simple as adding the rotors to the
+code and then updating the references to the array etc.
+This is because it had three additional rotors -
+VI,
+VII and VII - and had two
+notches and this changes the way things work. The Kriegsmarine
+M4 also had an additional change which would complicate matters
+more.
+I looked into trying to do this for another version after winning but
+some of the obfuscation techniques dramatically complicates even
+attempting this so I haven’t even tried.
+It is feasible that you could add your own rotors however but I leave
+this as an exercise to the reader. I will say that the five rotors I,
+II, III, IV and V can be found in the source code verbatim and you could
+confirm it by looking them up; however much more would have to be done
+in order to get them to work, than to just put the strings in. Again the
+way I set things up complicates this greatly.
+Portability
+I have tested it under macOS, Fedora and CentOS Linux and all seems
+okay under these platforms. When I was in the final stages of
+obfuscation I made an error somehow (or else maybe the vim formatting
+caused a problem - I have seen this before) and I had to go back and
+undo some of the obfuscation to figure out what was going on (I had a
+hunch where and I noted it in the obfuscation I believe) but this made
+me wonder on if I made any other mistakes since it appeared to be
+working before that.
+I don’t know if EBCDIC will work but I think it might because it
+appears that the alphabet is a contiguous sequence. I don’t believe
+endianness matters but I no longer remember what I’ve done in full and
+I’ve no way to test it.
+If there are any inconsistencies in input/output one also has to be
+certain that input was put in correctly because as soon as a letter
+differs the entire sequence will be off.
+The results of my test script (not included here but I will probably
+have it on my website) are the same under Fedora, CentOS and macOS.
+Resources
+A
+note on Wehrmacht, its branches and other agencies and their Enigma
+machines
+The Wehrmacht
+was the defence force in full which included the Heer
+(army), Luftwaffe
+(air force) and Kriegsmarine
+(navy). As I said the Kriegsmarine procedures were more complex: they
+had additional rotors and one of their models had a different reflector
+system (thin instead of thick - some of the documents below discuss
+this). The military intelligence agency, the Abwehr, had their own
+system too. Non-military grade Enigma machines didn’t have the plugboard.
+And so on.
+However one of the documents below distinguishes the Kriegsmarine
+from the Wehrmacht; when you see this you can read it as the
+Kriegsmarine versus the rest of the Wehrmacht rather than the Wehrmacht
+and the Kriegsmarine.
+Enigma
+Message Procedures: The Heer,
+Luftwaffe and Kriegsmarine) Enigma
+procedures.
+Interactive Enigma
+Machine: Shows wiring of the Enigma machine
+based on the settings and input (unfortunately uses Flash). This was
+what I used to verify output (as best I could find). To set this up to
+use the default settings in my simulator make sure to use Rotors
+I, II and III and the starting positions at B, B and C respectively (as
+in left, centre, right). To do this click the button at the top right
+that looks like:
+o->
+<-o
+and then select the rotors. Next click the button again at the left
+of the rotor selection ‘screen’. Then use the arrow buttons above each
+rotor to set from left to right B, B and C. After this you can type your
+message in the input field and watch the wiring of the rotors change and
+show the path it takes.
+If I made use of the Enigma code in the recode.c program I would maybe consider doing
+something like that but I intentionally do not use it there: as cool as
+it might be it would give a better idea of how the algorithm works
+(unless I were to make it just as obscure as I do in prog.c but that’s
+also a bit risky). I don’t believe I could do it now anyway.
+I’m uncertain how to change the rotor setting itself in this
+simulator to determine if the ring settings being different from
+ABC would cause a problem (this is the thing I mention I’m
+uncertain about in the bugs section).
+Going back to the configuring the online simulator try inputting the
+text IOCCC and you’ll see the resulting text being:
+UUMMX
+Which is exactly as my entry shows! So at least for the starting
+position BBC and an empty plugboard
+and the other defaults in my entry (which appear to be consistent with
+the online simulator too) I can verify it works.
+Tony
+Sale’s pages on The Enigma cipher machine: This is many pages on the
+Enigma machine by the late Tony Sale who was the original curator of the
+Bletchley Park Museum.
+There is a wealth of information in these pages on how the Enigma worked
+and this includes some challenges to do to see how well you understand
+the algorithm.
+Fun fact: the abbreviation for the Signals
+Intelligence is that of our wonderful SIGINT.
+Technical
+Details of the Enigma Machine: ‘This page provides the technical
+details of the Wehrmacht and Luftwaffe Enigma,
+and the Kriegsmarine Enigma M4.’ It is quite a nice document with
+diagrams, pictures of actual Enigma rotors
+and other parts and more.
+The
+German Enigma Cipher Machine: The history of Enigma, its
+development, use during the war and cryptanalysis.
+How the Enigma was Set
+Up and Operated: This is the third page in a document series on the
+Enigma that explains the initial set up of the Enigma machine for each
+day. This is a good introduction to the set up. There is one thing that
+I was not aware of (or if I was it did not register): the operator would
+after setting the positions also put in three letters before the actual
+message (there were several parts to each message but this was another
+layer of complexity). I did not implement this in the recode program but
+what would it be anyway? If the user here wants to they could add three
+letters to their message beginning. I don’t think there need be any
+addition to the recode program - at least not that.
+Author’s dedication:
+Winning
+thoughts, dedications and thanks
+Once again I’m honoured to win along with some of the other veterans
+who I have a huge amount of respect for; there’s Don Yang, Dave Burton, Yusuke Endoh and Edward Giles all of whom are
+amazing programmers. I’m especially proud to win besides Dave Burton and
+Yusuke Endoh but Don Yang and Edward Giles too.
+But there are some others who I don’t remember like Ilya
+Kurdyukov (who’s offered a lot of interesting thoughts on Snake and who plans to have his own
+version after the entries are published), Nathan Otterness, Nicholas Carlini (your entry
+is an absolutely brilliant abuse of printf - and I totally
+agree with the judges remarks that your entry is so novel that it’ll be
+worth special mention in the future Best of IOCCC list!) and tsoj too.
+Well done and congratulations to all of you again! Thank you for
+submitting the wonderful entries and I’m honoured to have my two entries
+beside yours!
+To Yusuke Endoh, Dave Burton and Nicholas Carlini I very much
+appreciate your wonderful comments on this program. Your comments Yusuke
+on this entry specially and also Dave’s comments on my double-win are
+both extremely special to me - it truly takes my pride to another
+level!
+I would like to dedicate this entry to my wonderful mum Dianne
+Ferguson whom I love with all my heart and soul <3 Thank you for
+being the best mother imaginable! You’ve been there for me in the
+darkest of my hours without question without complaint and with all the
+love, compassion, empathy, sympathy and devotion anyone could ever ask
+for. Bless you again and again and again dear mother.
+I also want to dedicate this to Vicky Wilmore who has given me a lot
+of love the past few years and who was there for me in some very dark
+times. Thank you Vicky sweetheart from the bottom of my heart and soul
+xxx
+Once more besides those two I want to also dedicate this to all the
+many millions of people whose lives were taken from them in what amounts
+to - like all other wars - a horrible, pointless conflict and an utter
+waste of life, something precious that is far too often taken for
+granted. As I noted before I found it fitting that I finished this on 30
+April 2020 - exactly 75 years after Adolf Hitler, he who started the Second World War,
+ended his life. The blankness of the layout is another way of honouring
+the poor souls who lost their lives, many of whom we will never know
+even their name let alone what they might have accomplished if it wasn’t
+for their tragic and pointless deaths. Always remember that life is
+precious and never ever take it for granted! Believe in yourselves.
+Everyone. Do not let anyone ruin that for you ever.
+I would like to thank my dear friend Martijn Schoemaker for encouraging me
+in my programming over the years and who I owe a great deal to. Thank
+you for believing in me and my programming abilities (and other
+abilities) even when I couldn’t believe in myself! Very much appreciated
+especially coming from an amazing programmer who I have huge admiration
+for!
+Finally I want to thank Leo Broukhis, Simon Cooper and Landon Curt
+Noll for continuing to hold the contest after all these years - and for
+having selected my entries. It’s a huge honour; thank you! I also happen
+to love your comments as well as the award titles. And yes indeed ‘most
+of us could use Double-layered
+Chocolate Fudge Cake!’
+If you wish to contact me please do so. Please contact via mastodon.
+You can try email but I’m more likely to respond to mastodon
+messages.
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory
+for 2020/ferguson2
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.alt.c
+- alternative source
+- prog.orig.c
+- original source
+- input.txt
+- sample input
+- obfuscation.txt
+- sample input
+- recode.c
+- Enigma machine simulato source code
+- try.alt.sh
+- how to run alternative code
+- try.sh
+- how to run
+- try.this.txt
+- sample input
+- enigma.1
+- Enigma simulator man page
+- ioccc-and-chocolate.pdf -
+IOCCC publications
+- key.txt
+- key to decipher or encipher IOCCC
+- obfuscation.key
+- key to decipher or encipher obfuscation.txt
+- recode.1
+- configuration tool man page
+- 2020_ferguson2.tar.bz2 -
+download winning source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+- cake.jpg - image for chocolate cake
+- chocolate-cake.md
+- markdown source for COMPILING.html
+- ioccc-cake.jpg - image for chocolate
+cake
+- obfuscation.md
+- markdown source for obfuscation.html
+- recode.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/giles/index.html b/2020/giles/index.html
index 34abea3e6..e18e9213d 100644
--- a/2020/giles/index.html
+++ b/2020/giles/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,320 @@
-
-
+
+
+
+
+
+
-
-
-2020 giles
-
-
+
+
+
+2020/giles
+
+
+
+
+
-2020 giles
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/giles
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/giles/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Edward Giles
+Location: AU
+
+
+To build:
+make
+Bugs and (Mis)features:
+The current status of this entry is:
+STATUS: INABIAF - please **DO NOT** fix
+For more detailed information see 2020
+giles in bugs.md.
+To use:
+./prog < dtmf.wav
+
+./prog [digits] > digits.wav
+where dtmf.wav is a WAV file of the dialling of a number
+being dialled with DTMF
+(Dual-tone multi frequency) (more commonly known as Touch-Tone) and
+[digits] is a sequence of digits that will be converted to
+the DTMF sound!
+Try:
+./try.sh
+./prog < pi.wav
+
+# See
+./prog 867-5309 > jenny.wav
+If the script try.sh did not play a WAV file, it
+means you do not have SoX installed; see FAQ
+3.10: How do I compile and use an IOCCC winner that requires
+sound?). In this case install it and try it again or play the files
+jenny.wav and ioccc28.wav in a program that
+can play WAV files.
+NOTE: the phone number of jenny.wav comes from https://en.wikipedia.org/wiki/867-5309/Jenny.
+Judges’ remarks:
+A cross platform utility for both encoding and decoding touch
+tones.
+Author’s remarks:
+Introduction and Usage
+This program encodes and decodes dual-tone
+multiple frequency signals used in telephone systems, more commonly
+known as Touch-Tones.
+If the program is executed with no arguments, it will read a WAV file
+from standard input, decode the touch-tones in the file, and output the
+corresponding digits to standard output. This program only supports WAV
+files that have exactly 16 bits per sample, but it allows any sample
+rate and any number of audio channels.
+$ ./prog < pi.wav
+31415926
+If the program is executed with a command-line argument, it will
+generate the tones corresponding to the specified characters, writing
+them to standard output as a WAV file.
+$ ./prog 867-5309 | aplay
+Interesting Features
+
+- When compiled with
gcc -pedantic -Wall -Wextra there
+are no compiler warnings.
+- This program can be successfully compiled and run on Windows, using
+both Microsoft’s C compiler and TCC.
+- This program resamples the incoming audio, so that it can accept
+audio data at any sample rate.
+- The code that generates the output sine-waves is the same as the
+code that looks for sine-waves in the input. (see Algorithm Details for
+roughly how this works).
+- Despite handling lots of sine waves, the program only uses basic
+arithmetic operations. It does not depend on
libm.
+- All type punning is done with
memcpy(3) so there are no
+strict-aliasing violations.
+- The size of the source code using the IOCCC size tool is 1963, the
+year the first push-button telephones were made available to
+customers.
+- The source code (not counting the C pre-processor) is roughly in the
+shape of a telephone handset.
+
+Assumptions
+
+- Code is compiled using the C99 or C11 standard.
+CHAR_BIT == 8.
+- Machine is little-endian.
+int16_t, uint16_t, and
+uint32_t exist.
+int16_t is 2’s-complement.
+double is an IEEE 754 binary64 floating-point
+type.
+sizeof(double) == 8.
+
+Obfuscations
+
+- DSP code is inherently somewhat difficult to understand.
+- Lots of identifier reuse. Each identifier is used for about 2.2
+different tasks, on average. For example,
aa is both a
+variable and a macro for error handling, and memcpy(3) is
+both a library function and a oto label.
+- Most of the identifiers are only 1 or 2 characters long, and are
+unrelated to their actual function.
+- The
f macro is used to unroll some of the loops.
+- Some numerical constants are replaced with character literals, so
+the actual value is unclear.
+- All of the strings used by the program have been combined into a
+single string literal.
+- Most of the values used for the actual signal-processing all reside
+in one array, named
l. This array is usually accessed at
+index z plus a constant. Accesses of this type have been
+rewritten from, e.g. l[z+17] to 17[l+z].
+[l+z] ends up occurring quite often, so I created the macro
+a as a shorthand.
+
+Algorithm Details
+Each tone in a DTMF signal is a combination of two frequencies. The
+lower frequency determines which row the digit is in, and the higher
+frequency determines the column. There are 4 possible row frequencies
+and 4 possible column frequencies.
+| | **1209 Hz** | **1336 Hz** | **1477 Hz** | **1633 Hz** |
+|------------|-------------|-------------|-------------|-------------|
+| **697 Hz** | 1 | 2 abc | 3 def | A |
+| **770 Hz** | 4 ghi | 5 jkl | 6 mno | B |
+| **852 Hz** | 7 pqrs | 8 tuv | 9 wxyz | C |
+| **941 Hz** | * | 0 | # | D |
+This program determines which frequencies are present in the input by
+passing it through a set of 8 virtual resonators, each tuned to one of
+the frequencies used for DTMF. These can be implemented using only basic
+arithmetic, and they are able to ‘select’ a specific frequency from the
+input sound, blocking all other frequencies from reaching the output.
+The loudness of the sound output from each resonator can therefore be
+used as a measure of how much of a particular frequency was present in
+the input. The program then decides, over the course of one tone, which
+row frequency and which column frequency were most prominent.
+Tones are generated using those same resonators by providing an
+impulse as input. An impulse can be thought of as consisting of
+sine-waves at all frequencies, and when it is put through one of the
+resonators, the result is a single pure sine wave.
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory for
+2020/giles
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.orig.c
+- original source
+- try.sh
+- how to run
+- pi.wav - touch tone for leading decimal digits
+of pi
+- 2020_giles.tar.bz2 - download
+winning source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+- dtmf.bin - binary support file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/kurdyukov1/index.html b/2020/kurdyukov1/index.html
index 750dd14f5..40b9d8d10 100644
--- a/2020/kurdyukov1/index.html
+++ b/2020/kurdyukov1/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,279 @@
-
-
+
+
+
+
+
+
-
-
-2020 kurdyukov1
-
-
+
+
+
+2020/kurdyukov1
+
+
+
+
+
-2020 kurdyukov1
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/kurdyukov1
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/kurdyukov1/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Ilya
+Kurdyukov
Location: RU
+
+
+To build:
+make
+There are alternate versions of this entry. See Alternate code below for more details.
+To use:
+./prog
+# input some text
+
+echo text | ./prog
+
+./prog < file
+Try:
+./try.sh
+Alternate code:
+There are a number of alternate versions for this program, some in C
+and some in assembly.
+The file prog.alt.c is smaller and does not
+contain any headers or any workaround for WIN32 based platforms.
+The file prog.extra.c has a number of
+layouts including some for different social media profile covers as well
+as different shapes.
+The files prog.x86_64.asm and prog.x86.asm are the program in assembly for
+x86_64 linux and x86 linux respectively.
+Alternate build:
+To build prog.alt.c:
+make alt
+Alternate use:
+Use prog.alt as you would prog above.
+Judges’ remarks:
+This hash of a C code makes a hash out of input. Do you understand
+how? You should get a-round-to-it figuring it out!
+Author’s remarks:
+MD5 with integers
+Just a tiny MD5 checksum utility. Prints hash string of data from
+stdin. Works the same as
+openssl md5 | cut -d' ' -f2 command.
+My objectives
+
+- Reduce code size as much as possible.
+- Avoid warnings from gcc/clang
+
-Wall -Wextra -pedantic.
+- Portable (regardless of register size and endianness).
+- Fit code in a round shape.
+- Mo macro defines.
+- No floating-point arithmetics.
+
+Notes
+The main difficulty of making MD5 code smaller is a 64x4 bytes long
+table with constants which will take more than 512 bytes in hex
+encoding. This table is a results of a sine function, so can be
+generated dynamically, but merging floating-point arithmetics with
+precise integer calculations is not a great idea, because it can cause
+portability issues.
+Attempts to satisfy clang -Weverything will ruin comma
+magic, that is so great for obfuscation, so I don’t want to care about
+that.
+Probably, should work correctly on any machines, but I have nothing
+exotic (like BE or not 32/64) to try it.
+Added a macro hack to make stdin work in binary mode
+under Windows (tested under mingw64), otherwise the hashes can be
+incorrect.
+Bonus
+
+prog.extra.c is the same with the sine
+function (so smaller), and in different shapes.
+prog.x86_64.asm contains the same
+program, but written in assembly for x86_64 Linux, for the sake of
+smaller executable size which is 500 bytes long (where 120 is for the
+ELF headers) after compilation. Algorithm details is slightly different
+(like constants packing), just to make smaller binary code. It’s
+interesting to compare density of binary code and obfuscated
+
+
+
+
+
+- prog.x86.asm is for x86, although the
+headers are smaller, but the binary code is larger due to fewer
+registers and lack of 64-bit multiply.
+
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory
+for 2020/kurdyukov1
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.alt.c
+- alternative source
+- prog.orig.c
+- original source
+- try.sh
+- how to run
+- prog.extra.c
+- variant of winning source with sine function
+- prog.x86.asm
+- assembly source code
+- prog.x86_64.asm
+- assembly source code
+- 2020_kurdyukov1.tar.bz2 -
+download winning source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/kurdyukov2/index.html b/2020/kurdyukov2/index.html
index cace4e7f5..b48baa880 100644
--- a/2020/kurdyukov2/index.html
+++ b/2020/kurdyukov2/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,278 @@
-
-
+
+
+
+
+
+
-
-
-2020 kurdyukov2
-
-
+
+
+
+2020/kurdyukov2
+
+
+
+
+
-2020 kurdyukov2
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/kurdyukov2
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/kurdyukov2/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Ilya
+Kurdyukov
Location: RU
+
+
+To build:
+make
+To use:
+./prog
+Try:
+# Take a selfie
+./prog 1000 selfie.jpg output.jpg
+# Admire your portrait in cubist style
+
+./try.sh
+Judges’ remarks:
+This entry has reminded us of a winning entry back in the early 90s.
+Can you guess which one?
+For a given image, try graphing the execution time relative to the
+number of rectangles. What is the complexity? Is it obvious from the
+source code?
+Author’s remarks:
+Usage
+This program divides the image into a specified number of rectangles.
+This process is content aware, so the algorithm tries to match most of
+the information. However, it doesn’t find the best theoretically
+possible layout.
+./prog 1000 input.jpg output.jpg
+Building
+You can build three versions, depending on the image format.
+Default is JPEG version; if you have the libjpeg
+development package installed in your system, then make
+without arguments should do the right thing.
+If you want to use libjpeg compiled from sources, then
+use the LIBJPEG define to specify the path to includes and
+the library. For example using libjpeg source
+version 9c:
+make prog LIBJPEG="-Ijpeg-9c jpeg-9c/libjpeg.a"
+Use this command to build a PNG version (you need
+libpng):
+make prog_png LIBPNG="-lpng"
+And the PPM version (no additional dependencies, can read raw/ASCII
+PPM, writes raw PPM):
+make prog_ppm
+Building on macOS with
+MacPorts:
+Thanks to Cody Boone
+Ferguson for this information!
+First, make sure you have the compiler tools installed e.g. by:
+sudo xcode-select --install
+Make sure you install MacPorts. Then do:
+sudo port install jpeg libpng ImageMagick
+The program itself doesn’t need ImageMagick, install it only if you
+plan to make GIFs from the results using makegif.sh.
+After that’s installed you need to run make with these options:
+make LDFLAGS="-I/opt/local/include -L/opt/local/lib"
+Building on macOS with
+HomeBrew
+First, make sure you have the compiler tools installed e.g. by:
+sudo xcode-select --install
+Make sure you install HomeBrew.
+Then:
+brew install libjpeg libpng
+eval "$(brew shellenv)"
+You are now ready to compile this entry:
+make clobber all
+Notes
+Made this thing while experimenting with the idea of representing an
+image with rectangles (lossy compression). It’s not very good in that
+sense, but the results look funny, like a kind of cubism pixel art.
+Do not use values above 50000, it’ll be slow.
+To understand how this works, just try running with 1,2,3,4… number
+of rectangles. At each iteration, the rectangle with the biggest
+difference from the picture data is split (halves may have different
+size) horizontally or vertically to get the minimum difference.
+You can use this command to make a GIF from output images (uses
+ImageMagick). For instance after running the command suggested by the
+judges:
+convert -delay 10 -dither none -loop 0 $(ls out*.jpg | sort -V) $(ls out*.jpg | sort -rV) +map out.gif
+Also provided makegif.sh to aid with GIF creation.
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory
+for 2020/kurdyukov2
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.orig.c
+- original source
+- try.sh
+- how to run
+- makegif.sh
+- utility to form GIFs from the results
+- prog.png.c
+- build a PNG version
+- prog.ppm.c
+- build a PPM version
+- sample.jpg - sample image data
+- 2020_kurdyukov2.tar.bz2 -
+download winning source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/kurdyukov3/index.html b/2020/kurdyukov3/index.html
index 3b6919b5a..2b1b04bec 100644
--- a/2020/kurdyukov3/index.html
+++ b/2020/kurdyukov3/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,231 @@
-
-
+
+
+
+
+
+
-
-
-2020 kurdyukov3
-
-
+
+
+
+2020/kurdyukov3
+
+
+
+
+
-2020 kurdyukov3
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/kurdyukov3
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/kurdyukov3/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Ilya
+Kurdyukov
Location: RU
+
+
+To build:
+make
+There is an alternate version of this program. See Alternate code below.
+To use:
+./prog
+Try:
+./try.sh
+Alternate code:
+The alternate version, prog.alt.c, has the
+main code as a macro.
+Alternate build:
+make alt
+Alternate use:
+Use prog.alt as you would prog above.
+Judges’ remarks:
+It is interesting how well smeonoe can raed txet wtih lots of tyops
+in it. How well can you raed porg.c, C prgoarm that is in the shpae of
+an SD card (or is it a pnuch crad)?
+BTW: this funny reading of English (which also works with several
+other languages) is called typoglycemia
+(the article however is incorrect in stating that if the letters were
+more jumbled or if other words were formed one could not read it: we
+know of some who can in fact do exactly that). Also, to be clear, there
+was no such study stated in input.txt but as
+you’ll likely see you should be able to do exactly what it says
+nonetheless.
+Author’s remarks:
+Letter Mixer
+Compile and try this:
+cat input.txt | ./prog
+The program can work with letters that are not represented in
+English, as long as these letters are encoded in the higher part of the
+single-byte character set (use iconv to convert from UTF-8
+and back).
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory
+for 2020/kurdyukov3
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.alt.c
+- alternative source
+- prog.orig.c
+- original source
+- input.txt
+- sample input
+- prog.extra.c
+- alternative source with extra functionality
+- try.sh
+- how to run
+- 2020_kurdyukov3.tar.bz2 -
+download winning source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/kurdyukov4/index.html b/2020/kurdyukov4/index.html
index 5d1620025..57a5997d9 100644
--- a/2020/kurdyukov4/index.html
+++ b/2020/kurdyukov4/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,292 @@
-
-
+
+
+
+
+
+
-
-
-2020 kurdyukov4
-
-
+
+
+
+2020/kurdyukov4
+
+
+
+
+
-2020 kurdyukov4
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/kurdyukov4
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/kurdyukov4/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Ilya
+Kurdyukov
Location: RU
+
+
+To build:
+make
+To use:
+./prog text_file output_length context_length random_seed
+Try:
+When running this, ask yourself why it gets progressively slower when
+the context length decreases:
+./try.sh
+
+Performance depends on the number of same hashes found. Too many
+identical strings if the context length is small. – Author
+
+Judges’ remarks:
+We were able to write our own program performing
+the same trick using the (still non-standard, for some reason) library
+function memmem(), but that way it works too fast
+regardless of the context length, and it’s much less fun.
+The author wrote in reply:
+
+Wow, amazing! Very fast, but there is a drawback to randomness. If
+some string only appears after half the input, the first instance of
+this string will have a 50% chance of occurrence. Example:
+echo "00000000000000000000 01 02 02 02 02 02 02" > test.txt
+./prog test.txt 1000 2 123
+# more twos in output
+./rand test.txt 1000 2 123
+# more ones in output
+
+But this will happen very rarely on real data. – Author
+
+
+Try using the same random seed and varying the context size.
+BTW: what on Middle-earth is lámatyávë? It’s Quenya, one
+of the languages of the Elves in Tolkien’s Legendarium. It means sound
+taste (plural is lámatyáver) and it refers to phonaesthesia - in other
+words, it refers to the pleasure of sound and form of words. It’s
+discussed in Morgoth’s
+Ring, volume X of History
+of Middle-earth (HoMe). Now can you appreciate the award title a bit
+better?
+Author’s remarks:
+Building:
+cc prog.c -o prog
+Usage:
+This program generates random text from the provided dictionary using
+a Markov chain, outputting to stdout.
+./prog input.txt 2000 10 12345
+Parameters are:
+
+dictionary filename Need at least the size of the book, the more
+the better (1Mb); you can concatenate several books into one file. This
+should be a text file (not .doc/.pdf). You can
+feed it with books in .fb2 format, metadata is filtered.
+Whitespace characters are also filtered. For languages other than
+English, it’s better to use ANSI encoding. You can use UTF, but you need
+to increase the chain length (if one ANSI character is encoded as two
+UTF bytes, then multiply chain length by two).
+bytes to generate (limited to 1Mb)
+chain length Randomness and performance depend inversely on this
+parameter and the size of the dictionary. If you feel that the bytes are
+generated too slowly, then you need to increase the length of the chain.
+This length means that any part of the output of this size in bytes
+exists somewhere in the dictionary.
+random seed
+
+Example
+You can try this with the inputs provided with 2019/mills from the IOCCC winners.
+$ ./prog Shakespeare.txt 2001 10 12345
+produces:
+r sons, wives for them, as the hope I had it. This is the way they be not too ra
+sh a trial of you only. Therefore will not out of door? Nurse: Marry, bachelor,
+Have other some, he is in Rome: but where is Warwick frowns at his. PRINCE EDWAR
+D: Where is the light: But I will watch thy waking, what work he makes Amongst y
+ou? Come, sirs, We shall write to you, fortune and The hazard of much blood. I w
+ould to heaven, respective lenity, And fire-eyed fury be my convoy in the senten
+ced; 'tis too horrible, so bloody on the banks If they were created, Would bring
+ them to our presence? FLORIZEL: And those his golden crown, What is six winters
+? they are but Lewis and Warwick bids you come too late come from the king's fri
+end, and will do't; for, look you, sir, For still thy true servitor: I will rend
+ an oak And peg thee in his knotty entrails till Thou hast hazel eyes: what eye
+but such an eye would spy out such a day to-morrow, or next day: He is within th
+e limit of the like, forsworn to love, Send her a story of more woe Than this is
+ a merry ballad, but a very pretty one. MOPSA: Thou hast amazed me, My name is E
+lbow: I do lean upon, Now thou art: Thy tears are womanish; thy wild acts denote
+ The unreasonably: come, you must: and there, I then do't to them? VOLUMNIA: Now
+ the red pestilence hangs in our aim, which is yours. What is't your honour, as
+in war, since then, You have said before: My child is dead; or 'twere not 'long
+of him; but he, like you, lads; about your ears it is Menenius? Second Officer:
+Come, come, young wanton and effeminate boy, Takes on the hungry beach Fillip th
+e stars Shall bitterly begin his wooing that we have in hand are angry And frown
+ing brow to brow, ourselves, Still your own affections are devised, As blanks, b
+enevolences, and I thank thee for it. KING HENRY VI: Master lieutenant comes. Ma
+ster lieutenant comes. Master lieutenant, pray you,-- CORIOLANUS: What's that to
+ him? CHRISTOPHER: At Pembroke, Sir James Blunt, And Rice ap Thomas with a virtu
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory
+for 2020/kurdyukov4
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.orig.c
+- original source
+- Eugene_Onegin.txt
+- Eugene Onegin poetry
+- Shakespeare.txt
+- Shakespeare text
+- rand.c
+- randomize a file
+- try.sh
+- how to run
+- 2020_kurdyukov4.tar.bz2 -
+download winning source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/otterness/index.html b/2020/otterness/index.html
index ed0963380..26f3e2ab6 100644
--- a/2020/otterness/index.html
+++ b/2020/otterness/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,309 @@
-
-
+
+
+
+
+
+
-
-
-2020 otterness
-
-
+
+
+
+2020/otterness
+
+
+
+
+
-2020 otterness
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/otterness
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/otterness/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Nathan
+Otterness
Location: US
+
+
+To build:
+make
+Bugs and (Mis)features:
+The current status of this entry is:
+STATUS: INABIAF - please **DO NOT** fix
+For more detailed information see 2020 otterness in bugs.md.
+To use:
+./prog
+Try:
+./prog < cvikl.mid > output.mid
+# Play output.mid with your favorite player
+
+./prog < entertainer.mid > output2.mid
+# Play output2.mid with your favorite player
+Judges’ remarks:
+In an entry that boasts not using literals, one would expect to see
+straightforward ways to produce small integers like
+!(x^x)<<!(x^x), etc. but this entry is trickier than
+that. Deciphering what it does, apart from reading stdin
+and writing to stdout, would take a while.
+While doing that, you can be audibly entertained by a sample
+of its output.
+Author’s remarks:
+MIDI “boots and cats”
+This program seeks to automatically “improve” standard MIDI files
+(.mid) by adding an extra track that provides a driving drum beat to
+bring some excitement into boring video-game music rips or classical
+music sequences that otherwise only see the light of day when modern
+musicians import them into FL Studio to copy a few chords.
+Prerequisites
+If you’re not using Windows Media Player or already familiar with
+MIDI files, you may need to install some additional software to be able
+to listen to them. For example, on Ubuntu, I was able to play them in
+VLC after installing vlc-plugin-fluidsynth and
+fluid-soundfont-gm.
+You can obtain MIDIs in many places, but I mostly tested the program
+using files I found here.
+However, as discussed under the Limitations
+section below, not all of them work correctly. I will admit to having
+used
+http://www.kunstderfuge.com/-/midi.asp?file=beethoven/symphony_6_1_(c)cvikl.mid
+for most of my testing (see cvikl.mid).
+Usage
+Compile the program using the following command (I tested this using
+both clang and gcc):
+cc -pedantic -Wall -Werror -Wextra -O3 -o prog prog.c
+The program expects a MIDI on stdin, and writes a
+modified MIDI to stdout:
+./prog <input.mid >output.mid
+If the program encounters an error, no output will generally be
+produced, and it will exit with a specific status code. Meanings of the
+various status codes are listed below, under the “Program error codes”
+heading. On success, the program exits with a code of 0.
+Limitations
+
+The program does not support MIDI files over 4 MB (specifically,
+it will not take input files larger than 2^22 - 1 bytes).
+This is unlikely to be a big limitation in practice, since even lengthy
+MIDIs are rarely over a couple hundred KB.
+Not all MIDIs set (or correctly set) their timing
+information, which will lead to the tempo of the drum beat not matching
+the track. This will be especially true for “live performance” .mid
+files.
+There may be some types of MIDI messages that the program is
+unable to correctly parse, but I have rarely seen this in practice. The
+largest cause of program failures, in my experience, has been Limitation
+2.
+
+Obfuscation notes
+I had one primary goal when writing this program: include no C
+literals whatsoever. The final C file includes no numerical, string, or
+character literals. Instead, all literals have been replaced with a
+handful of global variables, which are occasionally modified throughout
+the file to prevent simple uses of find-and-replace.
+So, in a sense, this obfuscation is simply an intentional use of
+global variables’ classic problem: absolute spaghetti code. The absence
+of any sort of literals has the added benefit of forcing any would-be
+reader to trace the contents of many variables starting from
+main(), since, without literals, very little of the code
+gives any inherent visual cues as to its purpose.
+I already took the liberty of running prog.c through
+clang-format, since it still fits in the size limit and the
+formatting of the code was never intended to be an obfuscation technique
+here.
+Other remarks
+MIDI files are generally divided up into one or more “tracks” that
+play concurrently. While it is easy to find the positions of each of
+these tracks in the file, figuring out the amount of time each track is
+supposed to play is more difficult, and requires parsing every track in
+its entirety. This means that generating a drum beat that covers the
+entire piece of music requires parsing every track (the entire file) in
+order to determine the longest track.
+Once the program has determined the longest track in the file, it
+generates a new track, containing the simple 4-note percussion sequence,
+to match the length (in beats) of the longest-running track. It appends
+the new track onto the end of the file, taking care to update the file
+header, as well.
+Program error codes
+If the program encounters an error, it will exit with a nonzero code.
+The error codes can be interpreted as follows:
+
+1: Encountered an invalid MIDI variable-length integer
+in the input.
+2: Attempted to write an invalid MIDI variable-length
+integer to output. (This would be an internal error).
+3: Encountered an unsupported MIDI event in the
+input.
+4: Encountered a bad MIDI track header in the
+input.
+5: The input MIDI file uses SMPTE time division, which
+isn’t supported.
+6: Failed allocating a temporary buffer to hold a
+single copy of our “beat” messages.
+7: Failed allocating a buffer to hold the new track
+data.
+8: Failed allocating a buffer to hold the input
+file.
+9: The input file was too large.
+10: The input file’s MIDI header was incorrect (but
+this isn’t checked very thoroughly).
+
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory
+for 2020/otterness
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.orig.c
+- original source
+- cvikl.mid - sample input sound
+- entertainer.mid - sample input
+sound
+- 2020_otterness.tar.bz2 -
+download winning source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/tsoj/index.html b/2020/tsoj/index.html
index b3eaa66bc..a70f32546 100644
--- a/2020/tsoj/index.html
+++ b/2020/tsoj/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,281 @@
-
-
+
+
+
+
+
+
-
-
-2020 tsoj
-
-
+
+
+
+2020/tsoj
+
+
+
+
+
-2020 tsoj
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/tsoj
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/tsoj/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: tsoj
Location: DE
+
+
+To build:
+make
+There is an alternate version which has controls that will make much
+more sense to those familiar with vi. See Alternate code below.
+To use:
+./prog
+Try:
+# Make your terminal as large as possible, possibly reduce your font size
+# then...
+./prog
+Alternate code:
+This version has the difference of moving forwards, left, backwards
+and right, where instead of w, a,
+s and d, you can use k,
+h, j and l.
+Alternate build:
+make alt
+Alternate use:
+# Make your terminal as large as possible, possibly reduce your font size
+# then...
+./prog.alt
+..and maybe curse less than you might otherwise, but still probably
+curse (see below) :-)
+Judges’ remarks:
+This game does not use curses, but you may end up cursing.
+The code is made more difficult to read using an innovative, right
+justified, reverse indentation style.
+Author’s remarks:
+Controls
+
+- Movement:
w (forwards), a (left),
+s (backwards), d (right)
+- Fire: space
+- Quit:
q
+- Pause:
p, then use any other key to resume
+
+ /\
+ //\\
+ / \
+/______\
+ /\/\
+Compile and run
+Linux
+cc -std=c99 -O3 prog.c -o prog
+./prog
+Windows
+The only way I found to make it work is to use MSYS2. When using the MSYS2 shell you
+can install gcc via pacman.
+cc -std=c99 -O3 prog.c -o prog
+./prog.exe
+Warnings
+
+-Wno-missing-prototypes
+-Wno-shorten-64-to-32
+-Wno-sign-conversion
+-Wno-implicit-int-float-conversion
+-Wno-missing-field-initializers
+-Wno-implicit-float-conversion
+-Wno-vla
+-Wno-float-conversion
+-Wno-comma
+-Wno-shadow
+-Wno-format
+-Wno-empty-body
+-Wno-misleading-indentation
+-Wno-maybe-uninitialized
+- You may experience a mild motion
+aftereffect when playing for too long.
+
+High score
+Score will be shown in the top left corner. My best was
+156. If you beat that I’ll send you the image of a very
+expensive chocolate.
+Features
+
+- Procedural star generation.
+- Very space-efficient
for loops.
+- No use of
!= or ==.
+- Smooth rendering even on slow terminals.
+- Advanced ASCII art.
+- Cutting edge physics engine and collision detection.
+- Probably not many segfaults.
+- Every letter in the English alphabet has a variable or function
+named after it.
+- Not a virus.
+- Runs on my machine.
+
+Tips
+
+- Adjust your terminal size for different experiences.
+- Run this program in a virtual console to immerse yourself in the
+game.
+
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory for
+2020/tsoj
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.alt.c
+- alternative source
+- prog.orig.c
+- original source
+- 2020_tsoj.tar.bz2 - download winning
+source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/2020/yang/index.html b/2020/yang/index.html
index a183ad7bc..a78b529e7 100644
--- a/2020/yang/index.html
+++ b/2020/yang/index.html
@@ -1,4 +1,6 @@
+
+
@@ -6,27 +8,292 @@
-
-
+
+
+
+
+
+
-
-
-2020 yang
-
-
+
+
+
+2020/yang
+
+
+
+
+
-2020 yang
+
+
-XXX - fake content until readme2index is working - XXX
+
+
+ The International Obfuscated C Code Contest
+ 2020/yang
+
-
+
+
-
-Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2020/yang/index.html
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jump to contents
+
+
+
+
+
+
+
+ Bugs & (mis)features
+ Fixing IOCCC winners
+ Fixing the web site
+ Fixing winner info
+ Thanks for the help
+
+
+
+
+
+ Jump to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Author:
Name: Don Yang
Location:
+US
+
+
+To build:
+make
+To use:
+./prog [PIN] < input.txt > output.c
+Try:
+./try.sh
+The author provided the file cppp.cc which can
+preprocess the generated output to make them more acceptable to typical
+compilers. To build:
+make cppp
+See the author’s remarks for more details.
+Judges’ remarks:
+You might think of this entry as code obfuscater with a code. If you
+use the wrong code, you’re gonna have a bad time. What is compiling this
+entry about? Having a good ..
+time!
+This winning entry also comes with a JavaScript timelapse spoiler that shows how this
+entry was written.
+Author’s remarks:
+Synopsis
+echo "Hello world" | ./prog 12345 > encoded.c
+
+gcc -DPIN=12345 encoded.c -o ./decoded && ./decoded
+Details
+Mile is a C code generator. Run without arguments for the help
+message below:
+usage: [PIN] < input.txt > output.c
+
+where [PIN] is an integer in the range of 1..65535
+When run with an encoding PIN (first command line argument), Mile
+will read bytes from stdin and generate C code on
+stdout. Example:
+echo "Hello, world!" | ./prog 56789 > encoded.c
+This generated code will reproduce the same input bytes on
+stdout when executed, if it was compiled with the same
+encoding PIN.
+gcc -DPIN=56789 encoded.c -o decoded
+The generated code reconstructs all data at compile time by seeding a
+random number generator with the given PIN to reproduce the input bytes,
+and simply does one fwrite(3) call at run time to print
+those bytes. Not specifying a PIN is a compile time error. Specify the
+wrong PIN and output code will still compile, but will likely produce
+garbage instead of the input bytes. If the original input was empty then
+any PIN works, but you might get a compile time warning complaining
+about empty arrays.
+Because all data is reconstructed at compile time, expect the compile
+time to be excruciatingly long if you try to encode too much data. Code
+generated by encoding a haiku will probably compile in seconds, a
+limerick may require tens of seconds, a sonnet will take minutes. Give
+Mile an epic poem and you can probably write a faster preprocessor
+before GCC is done (Clang probably already failed long before then).
+I see that there is a lack of preprocessor abuse in recent years,
+probably because programming in preprocessor is too tedious. Mile is
+meant to help with that by producing C code filled with at least 98%
+preprocessor lines for any input. Now you too can enjoy long compile
+times with minimal effort.
+Features
+
+Output is randomized using system clock, so if you wait a second
+between runs, you should get a different generated code even for the
+same encoding PIN.
+Customized bytecode encoding of preprocessor boilerplates, mostly
+for compression but should also make reverse engineering more
+fun.
+CRC32 of the source code is embedded in the source code
+itself.
+Code layout shaped to resemble “Mile” from “Didn’t I Say to Make
+My Abilities Average in the Next Life?!”. Mile is known to be able to
+talk to nanomachines directly, which is exactly what programming in
+preprocessor feels like.
+
+Compatibility
+Mile has been verified to work in these environments (also, compiles
+without warnings on all of these):
+
+- gcc 9.2.0 on Cygwin
+- gcc 8.3.0 on Linux
+- gcc 7.4.0 on Cygwin
+- gcc 6.1.0 on JSLinux
+- gcc 5.4.0 on Linux
+- clang 8.0.1 on Linux
+- clang 8.0.1 on Cygwin
+- tcc 0.9.27 on Linux
+- tcc 0.9.25 on JSLinux
+
+Output of Mile is a bit more taxing, and only works with a subset of
+the above:
+
+- gcc: works just fine when using 8.3.0 and below, but may trigger
+warning for large files. gcc 9.2.0 and above may crash with large
+files.
+- clang: works fine for small files, fails on large files due to preprocessor
+bug.
+- tcc: works just fine on Linux. Fails silently on JSLinux.
+
+For people eager to encode large files, an extra utility has been
+packaged with this entry to preprocess the generated output to make them
+more acceptable to typical compilers. View the cppp.cc source and then compile it with a c++
+compiler of your choice.
+Copyright and CC BY-SA 4.0
+License:
+This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
+Reserved. You are free to share and adapt this file under the terms of
+this license:
+Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
+For more information, see:
+https://creativecommons.org/licenses/by-sa/4.0/
+
+
+Inventory for
+2020/yang
+Primary files
+
+- index.html - winner home page
+- prog.c
+- winning source
+- Makefile
+- winner Makefile
+- prog.orig.c
+- original source
+- try.sh
+- how to run
+- cppp.cc
+- encode large file C Pre-PreProcessor source
+- spoiler.html - SPOILER WARNING
+- 2020_yang.tar.bz2 - download winning
+source
+
+Secondary files
+
+- .gitignore
+- list of files that should not be committed under git
+- .path - directory path from top directory
+- .winner.json
+- description of winner in JSON
+- README.md
+- markdown source for index.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/author/Anonymous_2001.json b/author/Anonymous_2001.json
new file mode 100644
index 000000000..9d46b65e9
--- /dev/null
+++ b/author/Anonymous_2001.json
@@ -0,0 +1,20 @@
+{
+ "no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
+ "author_JSON_format_version" : "1.0 2023-06-10",
+ "author_handle" : "Anonymous_2001",
+ "full_name" : "Anonymous 2001",
+ "sort_word" : "anonymous",
+ "location_code" : "GB",
+ "location_name" : "Great Britain",
+ "email" : null,
+ "url" : null,
+ "alt_url" : null,
+ "deprecated_twitter_handle" : null,
+ "mastodon" : null,
+ "mastodon_url" : null,
+ "github" : null,
+ "affiliation" : null,
+ "winning_entry_set" : [
+ { "winner_id" : "2001_anonymous" }
+ ]
+}
diff --git a/author/Jari_Arkko.json b/author/Jari_Arkko.json
index 0f91c6f62..094a4459f 100644
--- a/author/Jari_Arkko.json
+++ b/author/Jari_Arkko.json
@@ -15,7 +15,7 @@
"github" : null,
"affiliation" : null,
"winning_entry_set" : [
- { "winner_id" : "1989_jar1" },
+ { "winner_id" : "1989_jar.1" },
{ "winner_id" : "1989_jar.2" },
{ "winner_id" : "2000_jarijyrki" }
]
diff --git a/bin/README.md b/bin/README.md
index dd509bdd0..c76fb8177 100644
--- a/bin/README.md
+++ b/bin/README.md
@@ -13,6 +13,11 @@ as well as various JSON files and other content from the
## bin tools
+### [all_run.sh](all_run.sh)
+
+Run a command on all winning entries.
+
+
### [gen-author.sh](gen-author.sh)
Output winning author(s) Related HTML.
diff --git a/bin/all_run.sh b/bin/all_run.sh
new file mode 100755
index 000000000..bcd88af8e
--- /dev/null
+++ b/bin/all_run.sh
@@ -0,0 +1,519 @@
+#!/usr/bin/env bash
+#
+# all_run.sh - run a command for all winners
+#
+# Copyright (c) 2024 by Landon Curt Noll. All Rights Reserved.
+#
+# Permission to use, copy, modify, and distribute this software and
+# its documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright, this permission notice and text
+# this comment, and the disclaimer below appear in all of the following:
+#
+# supporting documentation
+# source copies
+# source works derived from this source
+# binaries derived from this source or from derived source
+#
+# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
+# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+#
+# chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\
+#
+# Share and enjoy! :-)
+
+# firewall - must be bash with a version 4.2 or later
+#
+# We must declare arrays with -ag or -Ag
+#
+if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then
+ echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2
+ exit 4
+fi
+
+# setup bash file matching
+#
+# Requires bash with a version 4.2 or later
+#
+shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded
+shopt -u failglob # disable error message if no matches are found
+shopt -u dotglob # disable matching files starting with .
+shopt -s globskipdots # enable never matching . nor ..
+shopt -u nocaseglob # disable strict case matching
+shopt -u extglob # enable extended globbing patterns
+shopt -s globstar # enable ** to match all files and zero or more directories and subdirectories
+
+# set variables referenced in the usage message
+#
+export VERSION="1.1 2024-01-16"
+NAME=$(basename "$0")
+export NAME
+export V_FLAG=0
+GIT_TOOL=$(type -P git)
+export GIT_TOOL
+if [[ -z "$GIT_TOOL" ]]; then
+ echo "$0: FATAL: git tool is not installed or not in PATH" 1>&2
+ exit 10
+fi
+"$GIT_TOOL" rev-parse --is-inside-work-tree >/dev/null 2>&1
+status="$?"
+if [[ $status -eq 0 ]]; then
+ TOPDIR=$("$GIT_TOOL" rev-parse --show-toplevel)
+fi
+export PANDOC_WRAPPER="bin/pandoc_wrapper.sh"
+export PANDOC_WRAPPER_OPTSTR="-f markdown -t html --fail-if-warnings=true"
+export REPO_URL="https://github.com/ioccc-src/temp-test-ioccc"
+export TOP_URL="https://ioccc-src.github.io/temp-test-ioccc"
+export DOCROOT_URL_SLASH="/temp-test-ioccc/"
+#
+export NOOP=
+export DO_NOT_PROCESS=
+export EXIT_CODE="0"
+
+# usage
+#
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
+ [-p tool] [-P optstr] [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
+ tool [tool_options]
+
+ -h print help message and exit
+ -v level set verbosity level (def level: 0)
+ -V print version string and exit
+
+ -d topdir set topdir (def: $TOPDIR)
+ NOTE: The '-d topdir' is passed as leading options on tool command lines.
+
+ -n go thru the actions, but do not update any files (def: do the action)
+ NOTE: -n is passed to tool
+ -N do not process file, just parse arguments and ignore the file (def: process the file)
+ NOTE: -N disables running a tool
+
+ -p tool run 'pandoc wrapper tool' (not pandoc path) during HTML phase number 21 (def: use $PANDOC_WRAPPER)
+ NOTE: The '-p tool' is passed as leading options on tool command lines.
+ -P pandoc_opts run 'pandoc wrapper tool' with options found in 'optstr' (def: $PANDOC_WRAPPER_OPTSTR)
+ NOTE: The '-P pandoc_opts' is passed as leading options on tool command lines.
+ NOTE: The 'pandoc_opts' may not contain a single-quote, nor a double-quote.
+
+ -u repo_url Base level URL of target git repo (def: $REPO_URL)
+ NOTE: The '-u repo_url' is passed as leading options on tool command lines.
+ -U top_url Top level URL of web site where HTML files will be viewed (def: $TOP_URL)
+ NOTE: The '-U top_url' is passed as leading options on tool command lines.
+
+ tool the tool to run over all winners
+ tool_options tool command line options to use before YYYY/dir
+ NOTE: You must use -- after the tool command line option and before 'tool_options'
+
+Exit codes:
+ 0 all OK
+ 1 some execution of tool exited non-zero
+ 2 -h and help string printed or -V and version string printed
+ 3 command line error
+ 4 bash version is < 4.2
+ 5 tool is not an executable
+ 6 topdir is not in proper form
+ 7 topdir/YYYY is not in proper form
+ 8 topdir/YYYY/dir is not in proper form
+ >= 10 < 200 internal error
+ >= 200 ((not used))
+
+$NAME version: $VERSION"
+
+# parse command line
+#
+while getopts :hv:Vd:nNp:P:u:U: flag; do
+ case "$flag" in
+ h) echo "$USAGE" 1>&2
+ exit 2
+ ;;
+ v) V_FLAG="$OPTARG"
+ ;;
+ V) echo "$VERSION"
+ exit 2
+ ;;
+ d) TOPDIR="$OPTARG"
+ ;;
+ n) NOOP="-n"
+ ;;
+ N) DO_NOT_PROCESS="-N"
+ ;;
+ p) PANDOC_WRAPPER="$OPTARG"
+ ;;
+ P) # parse -P optstr
+ case "$OPTARG" in
+ *"'"*)
+ echo "$0: ERROR: in -P optstr, the optstr may not contain a single-quote character: $OPTARG" 1>&2
+ echo 1>&2
+ print_usage 1>&2
+ exit 3
+ ;;
+ *'"'*)
+ echo "$0: ERROR: in -P optstr, the optstr may not contain a double-quote character: $OPTARG" 1>&2
+ echo 1>&2
+ print_usage 1>&2
+ exit 3
+ ;;
+ *) ;;
+ esac
+ PANDOC_WRAPPER_OPTSTR="$OPTARG"
+ ;;
+ u) REPO_URL="$OPTARG"
+ ;;
+ U) TOP_URL="$OPTARG"
+ ;;
+ \?) echo "$0: ERROR: invalid option: -$OPTARG" 1>&2
+ echo 1>&2
+ print_usage 1>&2
+ exit 3
+ ;;
+ :) echo "$0: ERROR: option -$OPTARG requires an argument" 1>&2
+ echo 1>&2
+ echo "$USAGE" 1>&2
+ exit 3
+ ;;
+ *) echo "$0: ERROR: unexpected value from getopts: $flag" 1>&2
+ echo 1>&2
+ echo "$USAGE" 1>&2
+ exit 3
+ ;;
+ esac
+done
+#
+if [[ $V_FLAG -ge 1 ]]; then
+ echo "$0: debug[1]: debug level: $V_FLAG" 1>&2
+fi
+#
+# remove the options
+#
+shift $(( OPTIND - 1 ));
+#
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: file argument count: $#" 1>&2
+fi
+#
+# verify arg count and parse args
+#
+export TOOL TOOL_OPTIONS
+case "$#" in
+0) echo "$0: ERROR: expected 1 or more args, found: $#" 1>&2
+ echo "$USAGE" 1>&2
+ exit 3
+ ;;
+1) TOOL="$1"
+ ;;
+*) TOOL="$1"
+ shift
+ TOOL_OPTIONS="$*"
+ ;;
+esac
+
+# verify that we have a topdir directory
+#
+REPO_NAME=$(basename "$REPO_URL")
+export REPO_NAME
+if [[ -z $TOPDIR ]]; then
+ echo "$0: ERROR: cannot find top of git repo directory" 1>&2
+ echo "$0: Notice: if needed: $GIT_TOOL clone $REPO_URL; cd $REPO_NAME" 1>&2
+ exit 6
+fi
+if [[ ! -d $TOPDIR ]]; then
+ echo "$0: ERROR: TOPDIR is not a directory: $TOPDIR" 1>&2
+ echo "$0: Notice: if needed: $GIT_TOOL clone $REPO_URL; cd $REPO_NAME" 1>&2
+ exit 6
+fi
+
+# verify that we have an author subdirectory
+#
+export AUTHOR_PATH="$TOPDIR/author"
+if [[ ! -d $AUTHOR_PATH ]]; then
+ echo "$0: ERROR: author is not a directory under topdir: $AUTHOR_PATH" 1>&2
+ exit 6
+fi
+export AUTHOR_DIR="author"
+
+# verify that we have an inc subdirectory
+#
+export INC_PATH="$TOPDIR/inc"
+if [[ ! -d $INC_PATH ]]; then
+ echo "$0: ERROR: inc is not a directory under topdir: $INC_PATH" 1>&2
+ exit 6
+fi
+export INC_DIR="inc"
+
+# verify that we have an bin subdirectory
+#
+export BIN_PATH="$TOPDIR/bin"
+if [[ ! -d $BIN_PATH ]]; then
+ echo "$0: ERROR: bin is not a directory under topdir: $BIN_PATH" 1>&2
+ exit 6
+fi
+export BIN_DIR="bin"
+
+# cd to topdir
+#
+if [[ ! -e $TOPDIR ]]; then
+ echo "$0: ERROR: cannot cd to non-existent path: $TOPDIR" 1>&2
+ exit 6
+fi
+if [[ ! -d $TOPDIR ]]; then
+ echo "$0: ERROR: cannot cd to a non-directory: $TOPDIR" 1>&2
+ exit 6
+fi
+export CD_FAILED
+if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: about to: cd $TOPDIR" 1>&2
+fi
+cd "$TOPDIR" || CD_FAILED="true"
+if [[ -n $CD_FAILED ]]; then
+ echo "$0: ERROR: cd $TOPDIR failed" 1>&2
+ exit 6
+fi
+if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: now in directory: $(/bin/pwd)" 1>&2
+fi
+
+# verify we have a non-empty readable .top file
+#
+TOP_FILE=".top"
+if [[ ! -e $TOP_FILE ]]; then
+ echo "$0: ERROR: .top does not exist: $TOP_FILE" 1>&2
+ exit 6
+fi
+if [[ ! -f $TOP_FILE ]]; then
+ echo "$0: ERROR: .top is not a regular file: $TOP_FILE" 1>&2
+ exit 6
+fi
+if [[ ! -r $TOP_FILE ]]; then
+ echo "$0: ERROR: .top is not an readable file: $TOP_FILE" 1>&2
+ exit 6
+fi
+if [[ ! -s $TOP_FILE ]]; then
+ echo "$0: ERROR: .top is not a non-empty readable file: $TOP_FILE" 1>&2
+ exit 6
+fi
+
+# verify tool is executable
+#
+if [[ ! -e $TOOL ]]; then
+ echo "$0: ERROR: TOOL does not exist: $TOOL" 1>&2
+ exit 5
+fi
+if [[ ! -f $TOOL ]]; then
+ echo "$0: ERROR: TOOL is not a regular file: $TOOL" 1>&2
+ exit 5
+fi
+if [[ ! -x $TOOL ]]; then
+ echo "$0: ERROR: TOOL is not an executable file: $TOOL" 1>&2
+ exit 5
+fi
+
+# print running info if verbose
+#
+if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: NAME=$NAME" 1>&2
+ echo "$0: debug[3]: REPO_URL=$REPO_URL" 1>&2
+ echo "$0: debug[3]: REPO_NAME=$REPO_NAME" 1>&2
+ echo "$0: debug[3]: TOP_URL=$TOP_URL" 1>&2
+ echo "$0: debug[3]: TOP_FILE=$TOP_FILE" 1>&2
+ echo "$0: debug[3]: AUTHOR_PATH=$AUTHOR_PATH" 1>&2
+ echo "$0: debug[3]: AUTHOR_DIR=$AUTHOR_DIR" 1>&2
+ echo "$0: debug[3]: INC_PATH=$INC_PATH" 1>&2
+ echo "$0: debug[3]: INC_DIR=$INC_DIR" 1>&2
+ echo "$0: debug[3]: BIN_PATH=$BIN_PATH" 1>&2
+ echo "$0: debug[3]: BIN_DIR=$BIN_DIR" 1>&2
+ echo "$0: debug[3]: DO_NOT_PROCESS=$DO_NOT_PROCESS" 1>&2
+ echo "$0: debug[3]: NOOP=$NOOP" 1>&2
+fi
+
+# process each year
+#
+export YYYY
+for YYYY in $(< "$TOP_FILE"); do
+
+ # debug YYYY
+ #
+ if [[ $V_FLAG -ge 1 ]]; then
+ echo "$0: debug[1]: starting to process year: $YYYY" 1>&2
+ fi
+
+ # verify that YYYY is a readable directory
+ #
+ if [[ ! -e $YYYY ]]; then
+ echo "$0: ERROR: YYYY does not exist: $YYYY" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -d $YYYY ]]; then
+ echo "$0: ERROR: YYYY is not a directory: $YYYY" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -r $YYYY ]]; then
+ echo "$0: ERROR: YYYY is not an readable directory: $YYYY" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+
+ # verify that YYYY has a non-empty readable .year file
+ #
+ export YEAR_FILE="$YYYY/.year"
+ if [[ ! -e $YEAR_FILE ]]; then
+ echo "$0: ERROR: YYYY/.year does not exist: $YEAR_FILE" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -f $YEAR_FILE ]]; then
+ echo "$0: ERROR: YYYY/.year is not a regular file: $YEAR_FILE" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -r $YEAR_FILE ]]; then
+ echo "$0: ERROR: YYYY/.year is not an readable file: $YEAR_FILE" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -s $YEAR_FILE ]]; then
+ echo "$0: ERROR: YYYY/.year is not a non-empty readable file: $YEAR_FILE" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+
+ # process each winner under YYYY
+ #
+ export WINNER_PATH
+ for WINNER_PATH in $(< "$YEAR_FILE"); do
+
+ # debug YYYY
+ #
+ if [[ $V_FLAG -ge 3 ]]; then
+ echo "$0: debug[3]: starting to process year/dir: $WINNER_PATH" 1>&2
+ fi
+
+ # parse WINNER_PATH
+ #
+ if [[ ! -d $WINNER_PATH ]]; then
+ echo "$0: ERROR: WINNER_PATH is not a directory: $WINNER_PATH" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -w $WINNER_PATH ]]; then
+ echo "$0: ERROR: WINNER_PATH is not a writable directory: $WINNER_PATH" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ export YEAR_DIR=${WINNER_PATH%%/*}
+ if [[ -z $YEAR_DIR ]]; then
+ echo "$0: ERROR: WINNER_PATH not in yyyy/dir form: $WINNER_PATH" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ export WINNER_DIR=${WINNER_PATH#*/}
+ if [[ -z $WINNER_DIR ]]; then
+ echo "$0: ERROR: WINNER_PATH not in $YEAR_DIR/dir form: $WINNER_PATH" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ $WINNER_DIR = */* ]]; then
+ echo "$0: ERROR: WINNER_PATH: $WINNER_PATH dir contains a /: $WINNER_DIR" 1>&2
+ EXIT_CODE="7" # exit 7
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+
+ # verify that WINNER_PATH is a writable directory
+ #
+ if [[ ! -e $WINNER_PATH ]]; then
+ echo "$0: ERROR: WINNER_PATH does not exist: $WINNER_PATH" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -d $WINNER_PATH ]]; then
+ echo "$0: ERROR: WINNER_PATH is not a directory: $WINNER_PATH" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -w $WINNER_PATH ]]; then
+ echo "$0: ERROR: WINNER_PATH is not an writable directory: $WINNER_PATH" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+
+ # verify YYYY/dir/.path
+ #
+ export DOT_PATH="$WINNER_PATH/.path"
+ if [[ ! -s $DOT_PATH ]]; then
+ echo "$0: ERROR: not a non-empty file: $DOT_PATH" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ DOT_PATH_CONTENT=$(< "$DOT_PATH")
+ if [[ $WINNER_PATH != "$DOT_PATH_CONTENT" ]]; then
+ echo "$0: ERROR: arg: $WINNER_PATH does not match $DOT_PATH contents: $DOT_PATH_CONTENT" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ export WINNER_JSON="$WINNER_PATH/.winner.json"
+ if [[ ! -e $WINNER_JSON ]]; then
+ echo "$0: ERROR: .winner.json does not exist: $WINNER_JSON" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -f $WINNER_JSON ]]; then
+ echo "$0: ERROR: .winner.json is not a file: $WINNER_JSON" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+ if [[ ! -r $WINNER_JSON ]]; then
+ echo "$0: ERROR: .winner.json is not a readable file: $WINNER_JSON" 1>&2
+ EXIT_CODE="8" # exit 8
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+
+ # run the tool
+ #
+ if [[ -z $DO_NOT_PROCESS ]]; then
+
+ # run the tool
+ #
+ if [[ -z $NOOP ]]; then
+ if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: about to run: $TOOL -d \"$TOPDIR\" -p \"$PANDOC_WRAPPER\"" \
+ "-P \"$PANDOC_WRAPPER_OPTSTR\" -u \"$REPO_URL\" -U \"$TOP_URL\" $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
+ fi
+ eval "$TOOL" -d '"'"$TOPDIR"'"' -p '"'"$PANDOC_WRAPPER"'"' -P '"'"$PANDOC_WRAPPER_OPTSTR"'"' \
+ -u '"'"$REPO_URL"'"' -U '"'"$TOP_URL"'"' "$TOOL_OPTIONS" '"'"$WINNER_PATH"'"'
+ status="$?"
+ if [[ $status -ne 0 ]]; then
+ echo "$0: ERROR: tool: $TOOL failed, error: $status" 1>&2
+ EXIT_CODE="1" # exit 1
+ echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
+ fi
+
+ # report disabled by -n
+ #
+ elif [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: because of -n, did not run: $TOOL -d \"$TOPDIR\" -p \"$PANDOC_WRAPPER\"" \
+ "-P \"$PANDOC_WRAPPER_OPTSTR\" -u \"$REPO_URL\" -U \"$TOP_URL\" $TOOL_OPTIONS \"$WINNER_PATH\"" 1>&2
+ fi
+
+ # report disabled by -N
+ #
+ else
+ if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: arguments parsed, -N given, not running tool" 1>&2
+ fi
+ fi
+ done
+done
+
+# All Done!!! -- Jessica Noll, Age 2
+#
+if [[ $V_FLAG -ge 1 ]]; then
+ echo "$0: debug[1]: about to exit $EXIT_CODE" 1>&2
+fi
+if [[ $EXIT_CODE -ne 0 ]]; then
+ echo "$0: Warning: about to exit non-zero: $EXIT_CODE" 1>&2
+fi
+exit "$EXIT_CODE"
diff --git a/bin/gen-author.sh b/bin/gen-author.sh
index f3e65494a..2050655ba 100755
--- a/bin/gen-author.sh
+++ b/bin/gen-author.sh
@@ -55,7 +55,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
-export VERSION="1.3 2024-01-14"
+export VERSION="1.3.1 2024-01-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -78,9 +78,8 @@ export DOCROOT_URL_SLASH="/temp-test-ioccc/"
# set usage message
#
-export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
- [-d topdir] [-p tool] [-P optstr]
- [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
+ [-p tool] [-P optstr] [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
yyyy/dir
-h print help message and exit
@@ -94,7 +93,7 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
-p tool run 'pandoc wrapper tool' (not pandoc path) during HTML phase number 21 (def: use $PANDOC_WRAPPER)
-P pandoc_opts run 'pandoc wrapper tool' with options found in 'optstr' (def: $PANDOC_WRAPPER_OPTSTR)
- NOTE: The 'optstr' may not contain a single-quote, nor a double-quote.
+ NOTE: The 'pandoc_opts' may not contain a single-quote, nor a double-quote.
-u repo_url Base level URL of target git repo (def: $REPO_URL)
-U top_url Top level URL of web site where HTML files will be viewed (def: $TOP_URL)
@@ -698,7 +697,6 @@ fi
else
echo '**Author:**'
fi
- echo
} | if [[ -z $NOOP ]]; then
cat >> "$TMP_FILE"
elif [[ $V_FLAG -ge 3 ]]; then
@@ -736,14 +734,12 @@ for author_handle in $AUTHOR_HANDLE_SET; do
# write this author's information
#
{
- echo "Name: [$FULL_NAME](${DOCROOT_URL_SLASH}winners.html#$author_handle)
"
+ echo "
Name: [$FULL_NAME](${DOCROOT_URL_SLASH}winners.html#$author_handle)
"
if [[ $LOCATION_CODE == null ]]; then
echo "Location: [unknown](${DOCROOT_URL_SLASH}location.html#$LOCATION_CODE)"
else
-
echo "Location: [$LOCATION_CODE](${DOCROOT_URL_SLASH}location.html#$LOCATION_CODE)"
fi
- echo
} | if [[ -z $NOOP ]]; then
cat >> "$TMP_FILE"
elif [[ $V_FLAG -ge 3 ]]; then
diff --git a/bin/gen-inventory.sh b/bin/gen-inventory.sh
index af460dd63..bdc7eab75 100755
--- a/bin/gen-inventory.sh
+++ b/bin/gen-inventory.sh
@@ -55,7 +55,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
-export VERSION="1.0 2024-01-14"
+export VERSION="1.0.1 2024-01-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -77,9 +77,8 @@ export TOP_URL="https://ioccc-src.github.io/temp-test-ioccc"
# set usage message
#
-export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
- [-d topdir] [-p tool] [-P optstr]
- [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
+ [-p tool] [-P optstr] [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
yyyy/dir
-h print help message and exit
@@ -93,7 +92,7 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
-p tool run 'pandoc wrapper tool' (not pandoc path) during HTML phase number 21 (def: use $PANDOC_WRAPPER)
-P pandoc_opts run 'pandoc wrapper tool' with options found in 'optstr' (def: $PANDOC_WRAPPER_OPTSTR)
- NOTE: The 'optstr' may not contain a single-quote, nor a double-quote.
+ NOTE: The 'pandoc_opts' may not contain a single-quote, nor a double-quote.
-u repo_url Base level URL of target git repo (def: $REPO_URL)
-U top_url Top level URL of web site where HTML files will be viewed (def: $TOP_URL)
diff --git a/bin/pandoc_wrapper.sh b/bin/pandoc_wrapper.sh
index 9d9ec0f78..9fc6bfb4e 100755
--- a/bin/pandoc_wrapper.sh
+++ b/bin/pandoc_wrapper.sh
@@ -56,7 +56,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
-export VERSION="1.3 2024-01-14"
+export VERSION="1.3.1 2024-01-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -84,9 +84,8 @@ export TOP_URL="https://ioccc-src.github.io/temp-test-ioccc"
# set usage message
#
-export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
- [-d topdir] [-p pandoc_tool] [-P pandoc_opts]
- [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
+ [-p pandoc_tool] [-P pandoc_opts] [-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
file.md output.html
-h print help message and exit
@@ -100,6 +99,7 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
-p pandoc_tool path to the pandoc tool (not the wrapper) (def: $PANDOC_TOOL)
-P pandoc_opts options given to the pandoc tool (def: $PANDOC_ARGS)
+ NOTE: The 'pandoc_opts' may not contain a single-quote, nor a double-quote.
-u repo_url Base level URL of target git repo (def: $REPO_URL)
-U top_url Top level URL of web site where HTML files will be viewed (def: $TOP_URL)
diff --git a/bin/readme2index.sh b/bin/readme2index.sh
index 15e61c37c..7dea4393d 100755
--- a/bin/readme2index.sh
+++ b/bin/readme2index.sh
@@ -55,7 +55,7 @@ shopt -s lastpipe # run last command of a pipeline not executed in the backgroun
# set variables referenced in the usage message
#
-export VERSION="1.0 2024-01-14"
+export VERSION="1.1 2024-01-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -77,8 +77,8 @@ export TOP_URL="https://ioccc-src.github.io/temp-test-ioccc"
# set usage message
#
-export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
- [-d topdir] [-c md2html.cfg] [-H phase=name ..]
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
+ [-c md2html.cfg] [-H phase=name ..]
[-b tool] [-B optstr] [-p tool] [-P optstr] [-a tool] [-A optstr]
[-s token=value ..] [-S] [-o tool ..] [-O tool=optstr ..]
[-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
@@ -88,12 +88,12 @@ export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
-v level set verbosity level (def level: $V_FLAG)
-V print version string and exit
- -n go thru the actions, but do not update any files (def: do the action)
- -N do not process file, just parse arguments and ignore the file (def: process the file)
-
-d topdir set topdir (def: $TOPDIR)
NOTE: -d may only be used in command_options (getopt phase 0)
+ -n go thru the actions, but do not update any files (def: do the action)
+ -N do not process file, just parse arguments and ignore the file (def: process the file)
+
-c md2html.cfg Use md2html.cfg as the configuration file (def: use topdir/inc/md2html.cfg)
NOTE: -c may only be used in command_options (getopt phase 0)
@@ -2030,16 +2030,36 @@ fi
# move temporary index HTML in place
#
if [[ -z $NOOP ]]; then
- mv -f -- "$TMP_INDEX_HTML" "$INDEX_PATH"
- status="$?"
- if [[ status -ne 0 ]]; then
- echo "$0: ERROR: mv -f -- $TMP_INDEX_HTML $INDEX_PATH filed, error code: $status" 1>&2
- exit 138
- fi
- if [[ ! -s $INDEX_PATH ]]; then
- echo "$0: ERROR: not a non-empty index HTML file: $INDEX_PATH" 1>&2
- exit 139
+
+ # compare files
+ #
+ if cmp -s "$TMP_INDEX_HTML" "$INDEX_PATH"; then
+
+ # case: file did not change
+ #
+ if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: file did not change: $INDEX_PATH" 1>&2
+ fi
+
+ else
+
+ # case: index.html changed, update the file
+ #
+ if [[ $V_FLAG -ge 5 ]]; then
+ echo "$0: debug[5]: mv -f -- $TMP_INDEX_HTML $INDEX_PATH" 1>&2
+ fi
+ mv -f -- "$TMP_INDEX_HTML" "$INDEX_PATH"
+ status="$?"
+ if [[ status -ne 0 ]]; then
+ echo "$0: ERROR: mv -f -- $TMP_INDEX_HTML $INDEX_PATH filed, error code: $status" 1>&2
+ exit 138
+ fi
+ if [[ ! -s $INDEX_PATH ]]; then
+ echo "$0: ERROR: not a non-empty index HTML file: $INDEX_PATH" 1>&2
+ exit 139
+ fi
fi
+
elif [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: because of -n, disabled: mv -f -- $TMP_INDEX_HTML $INDEX_PATH" 1>&2
fi
diff --git a/bin/subst.default.sh b/bin/subst.default.sh
index 765bcccdd..b9748aeeb 100755
--- a/bin/subst.default.sh
+++ b/bin/subst.default.sh
@@ -53,7 +53,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
-export VERSION="1.1 2024-01-14"
+export VERSION="1.1.1 2024-01-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -73,8 +73,7 @@ export TOP_URL="https://ioccc-src.github.io/temp-test-ioccc"
# set usage message
#
-export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
- [-d topdir] [-p tool] [-P optstr]
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
[-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
yyyy/dir
diff --git a/bin/subst.winner-index.sh b/bin/subst.winner-index.sh
index bfd499259..ed624cf7e 100755
--- a/bin/subst.winner-index.sh
+++ b/bin/subst.winner-index.sh
@@ -52,7 +52,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
-export VERSION="1.1 2024-01-14"
+export VERSION="1.1.1 2024-01-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -72,8 +72,7 @@ export TOP_URL="https://ioccc-src.github.io/temp-test-ioccc"
# set usage message
#
-export USAGE="usage: $0 [-h] [-v level] [-V] [-n] [-N]
- [-d topdir] [-p tool] [-P optstr]
+export USAGE="usage: $0 [-h] [-v level] [-V] [-d topdir] [-n] [-N]
[-u repo_url] [-U top_url] [-e string ..] [-E exitcode]
yyyy/dir
diff --git a/inc/topnav.first.html b/inc/topnav.first.html
index 627e8813e..40839887d 100644
--- a/inc/topnav.first.html
+++ b/inc/topnav.first.html
@@ -1,7 +1,7 @@
- first entry
+ first entry
↑ %%UP_TEXT%% ↑
%%RIGHT_TEXT%% →
%%INVENTORY_TEXT%%
diff --git a/inc/topnav.last.html b/inc/topnav.last.html
index 932d4d64d..573d5502e 100644
--- a/inc/topnav.last.html
+++ b/inc/topnav.last.html
@@ -3,7 +3,7 @@
diff --git a/tmp/manifest.csv b/tmp/manifest.csv
index 98398a597..41c7d3686 100644
--- a/tmp/manifest.csv
+++ b/tmp/manifest.csv
@@ -920,6 +920,8 @@
1993,plummer,Makefile,30,true,makefile,true,winner Makefile
1993,plummer,plummer.alt.c,40,true,c,true,alternative source
1993,plummer,plummer.orig.c,50,false,c,true,original source
+1993,plummer,try.alt.sh,100,true,shellscript,true,how to run alternative code
+1993,plummer,try.sh,100,true,shellscript,true,how to run
1993,plummer,1993_plummer.tar.bz2,300,false,tbz2,false,download winning source
1993,plummer,README.md,4294967295,true,markdown,true,markdown source for index.html
1993,plummer,.gitignore,4294967295,true,gitignore,true,list of files that should not be committed under git
@@ -989,6 +991,9 @@
1994,horton,horton.alt.c,40,true,c,true,alternative source
1994,horton,horton.orig.c,50,false,c,true,original source
1994,horton,gtface.c,100,true,c,true,gtface source code
+1994,horton,try.alt.sh,100,true,shellscript,true,how to run alternative code
+1994,horton,try.sh,100,true,shellscript,true,how to run
+1994,horton,login_sept92-pp28-31.pdf,125,true,pdf,false,login article on graphics for dumb terminals
1994,horton,gtface.data,150,true,text,true,data for gtfsace
1994,horton,1994_horton.tar.bz2,300,false,tbz2,false,download winning source
1994,horton,README.md,4294967295,true,markdown,true,markdown source for index.html
@@ -999,6 +1004,7 @@
1994,imc,imc.c,20,true,c,true,winning source
1994,imc,Makefile,30,true,makefile,true,winner Makefile
1994,imc,imc.orig.c,50,false,c,true,original source
+1994,imc,try.sh,100,true,shellscript,true,how to run
1994,imc,1994_imc.tar.bz2,300,false,tbz2,false,download winning source
1994,imc,README.md,4294967295,true,markdown,true,markdown source for index.html
1994,imc,.gitignore,4294967295,true,gitignore,true,list of files that should not be committed under git
@@ -1008,6 +1014,7 @@
1994,ldb,ldb.c,20,true,c,true,winning source
1994,ldb,Makefile,30,true,makefile,true,winner Makefile
1994,ldb,ldb.orig.c,50,false,c,true,original source
+1994,ldb,try.sh,100,true,shellscript,true,how to run
1994,ldb,1994_ldb.tar.bz2,300,false,tbz2,false,download winning source
1994,ldb,README.md,4294967295,true,markdown,true,markdown source for index.html
1994,ldb,.gitignore,4294967295,true,gitignore,true,list of files that should not be committed under git
@@ -1019,6 +1026,9 @@
1994,schnitzi,schnitzi.alt2.c,40,true,c,true,alternate alternative source
1994,schnitzi,schnitzi.alt.c,40,true,c,true,alternative source
1994,schnitzi,schnitzi.orig.c,50,true,c,true,original source
+1994,schnitzi,try.alt.sh,100,true,shellscript,true,how to run alternative code
+1994,schnitzi,try.sh,100,true,shellscript,true,how to run
+1994,schnitzi,try.txt,100,true,text,true,input data for try.sh
1994,schnitzi,1994_schnitzi.tar.bz2,300,false,tbz2,false,download winning source
1994,schnitzi,README.md,4294967295,true,markdown,true,markdown source for index.html
1994,schnitzi,.gitignore,4294967295,true,gitignore,true,list of files that should not be committed under git
@@ -1039,6 +1049,7 @@
1994,smr,smr.c,20,true,c,true,winning source
1994,smr,Makefile,30,true,makefile,true,winner Makefile
1994,smr,smr.orig.c,50,true,c,true,original source
+1994,smr,try.sh,100,true,shellscript,true,how to run
1994,smr,1994_smr.tar.bz2,300,false,tbz2,false,download winning source
1994,smr,README.md,4294967295,true,markdown,true,markdown source for index.html
1994,smr,.gitignore,4294967295,true,gitignore,true,list of files that should not be committed under git
@@ -1049,6 +1060,10 @@
1994,tvr,Makefile,30,true,makefile,true,winner Makefile
1994,tvr,tvr.alt.c,40,true,c,true,alternative source
1994,tvr,tvr.orig.c,50,true,c,true,original source
+1994,tvr,try.alt.bw.sh,100,true,shellscript,true,demonstrate alt code in black and white mode
+1994,tvr,try.alt.color.sh,100,true,shellscript,true,demonstrate alt code in colour mode
+1994,tvr,try.bw.sh,100,true,shellscript,true,demonstrate code in black and white mode
+1994,tvr,try.color.sh,100,true,shellscript,true,demonstrate alt code in colour mode
1994,tvr,tvr.bw,150,true,text,true,black and white
1994,tvr,tvr.color,150,true,text,true,RGB values
1994,tvr,1994_tvr.tar.bz2,300,false,tbz2,false,download winning source
@@ -1060,6 +1075,8 @@
1994,weisberg,weisberg.c,20,true,c,true,winning source
1994,weisberg,Makefile,30,true,makefile,true,winner Makefile
1994,weisberg,weisberg.orig.c,50,true,c,true,original source
+1994,weisberg,primes.sh,100,true,shellscript,true,feed primes to the program
+1994,weisberg,try.sh,100,true,shellscript,true,how to run
1994,weisberg,1994_weisberg.tar.bz2,300,false,tbz2,false,download winning source
1994,weisberg,README.md,4294967295,true,markdown,true,markdown source for index.html
1994,weisberg,.gitignore,4294967295,true,gitignore,true,list of files that should not be committed under git
diff --git a/tmp/manifest.numbers b/tmp/manifest.numbers
index 7b9653cfecfa31e00a4fdb9f700b8a7d06a91506..0141580ad5cc21dfa7f4662f5e4bd47a2b4c0f50 100644
GIT binary patch
delta 155240
zcma%j2V5Ih)~`lL8X<#x5lvuh19lvn#5Qr9ILRh)33il(O`KvoamuFdX7{Ck+0@-2
zdhccE2q7W5KmtVXz4t15@1l2jXN0qfclUe0=bttInRCzFbIvX2o_p@trNqs}>YGPy
zzNA6ZqmX|}b1dJ~|MdAgp+_hb^2Z^}wsiHWlpx;=XHV?K-YyYbnvJ{^5P8Wl@KTKA
zHjBoDM{^nzC>Atkj3mwO|Iny=vGN647lY1zNt==;uQ^nD*oHlCY%00Up)tjh+gyxJ
z<8bs%OtdT*v69=fk!%}HF5DPHW$g1uXt9!~u2M`_A};{}uD>aV3M}8e;o@k)qERU1
z5A>tF@WscU{BZvEUqAW&^>07;_LH-ZTzurBgKI
zEf_}wqtLkw3ymh_9Z(&vLm0+DoO8^rcQucyKA6WW%$k*VT9kKMm3P{dciNSAI+S-h
zm3O+7ce<5#dX#sjm3RDan&`hVro1z*yfdM^GpW2YrM&Y5
zDMp-2Ov<$(l*uVb1=s$Zb++h4V2sOF}FbSLhQ~r_14gacq;0jqu-$5n)>PjdB
z|9T&8?n3e41Lynrpq^Ub@B#100q^MVd0+bqyMLfPw9+hIHDFOz4g8Opo_RCRmcr-L
zRPHY@iv*WA&oKqZ4+ay#G-t7BEGm_OFfPTyqC#+~N^q%6aH&CXsZMaIQgEqOa7mnb
zsa|lYT5zdGaH(8yX+d~sSSok3IakIs&5rKr
z)I43miMiVW#PwE8DEoGyGhU7V8M}Fvk#e?fP}IxC2?Dr9-CD%E3tNbXR87$M7lw(JPw~
zsTg-LT$VsL&6=o8V4iO6_RYZpRkw7Ybbi97Xqmws5(X`4o4RB#Won(aA5V>-!pj^e
zZtYMx(778G0il|v{Oznp?bCeM@j47jb)j^p!BL>iT^-L}qMEw7=Vxo5?v9RJfvOYq
zK&!Bn_I`{TU1m=;mD*3_Xq}D=8kFJisy@6LRh2oU#jPHWYO$f3+AsEGvrpGFI*%NN
zVgo21OR|g7$qQULX^XS1$qoWG?G*8z%R_xMFdnQmX(3sGTaD|?PD|9AYZ5m)0*TJt6
zezkN4O`M6Hq}0>3DAhoyp)-o0XTf7Z=bCC*&_DU&Pq$vTbg<7Ycd7LbNXDLu#8_b%
z%uR8`^j3gl)kJ@y|5@`Br+Yp&AhqNmW*iJf4JwN(!z?t~1(!g^2hULgo*JY)jhNgM
zL`^--(#GUPDvRq99CDi^F2ZCtF-(Fqw$LrRb1ma}Mbb
zq9jsZ+q>6#DNF{Jjy3M}QsA#nFNK1&Gj*6{Hwq}Wf@=j7CX1`NS3rTk=nop>DbY_bNqFld4>3H=PtwV6`7L{@gi)C^t=10?M
z<}9Oh%1^eR&^X`T`dsz3+>d7QXJWCH_R)#{lG~t8JT%`mF7+mrOEdTJrm?h`7@}NY
za4DwL(-;x)7X2s1Y#WWQarh(~O8D3XoXf9X!H}ZpVfvPa;#(!{=o6YWK4OES=D#Rx
zCuy4+EIqys$!DPFL=v_&h*T3gO~ZiUb@0g21#X(IDVs|C>jgda3)2w?9JoGNpHfV~
z>w!4aU*GhYrH`s-&dx*aE5fkj&Ge*6OEg4$>CaIX7rbdTep
zxMFCQ7N)`C@=ZxAOjmD`wX{)*s5|r#!cs}IVw!<)irKB31Qa~0K}Rmc^mo(~#C$zX
zi!lD4dK{}G+TNr)n^Jb^3=`;?Z%(sLv2IUOs{U;d6W_l@KS{l6q3#(1dgh0dTF0Tg
zIJ1WykZGC1-6vagww4)r^8=lY%;Cmd{|QCKUHT?f%aKdtW9;jiQ`!d|xTX>G4V{je
zC@Mdo>(H?CitbP7Y#Me=G5J>#Zz2qvJK1(7T=oBLRZ+DN)48;XA&
zHTll>m6KI0kX3NhRdC2Es=V)GF$NYD$)c-f(FGQyOLiSyJx
z)29214MC3$vW6q-8jb)9<%s#8&y&OQUSlZUs-^#xamKRdDA`WtjP||`bDNNc()HQLK6%T8e~cXO$4tNe>+fr}>7;AZ4wK?d4af^A
z-Bj^vDZTyPj41k=e(fmIVZu1Kc!^6RFoT!46f=_7jN~=D^;h*Yv7sZ?6$2(L`M-0@
zp;QZvHQ6)Zxe|YK{BaqIK(*&bIG15=%3{EHqgVhFmF3Kxn7#`LkET+m`sI22=w
zImLqV6y>RJS%^g=oiv9Dte7#CNnv3e3U(BJ^us49RJhTg!|y1^ic0j=)3`RYYY(TK
zqn!NJ|1-reu2T+H08s1R3P9tq%pWjjo?_xy55@ef9{Ho0GtL}bxH?RTVK|2#`&3W8
zBBZ|f8AS_ea1WVXdg?h$R!`a6rkvY`SR7mBnlK^O;TY%_sBX!a7MlK}#HUTPlQyn6
zOPl#4LeTt8rlu6|QQFL()Q`=-KK`tJY%w*}JWTlq{TQv)RQoLDpY+3&Hl4$iUjW+y
zZ2&to4{NcRe3&bgP8~$C)kKsoKs&&0KzqO*KnK8HKu16uCEPf{O&_2$U_YP>-~ga2
z;2@wI;1HlY;4q*E;0T~6;3%LM;25Ac;5eWU-~^yA;3S|Q;1r-g;51+W;0$1(CbFT-
z!c7nm<^T!6dB9-61;7wM6<{dfB48Nc5@0ysGGGMY3ScDQDqs}g8lV7h9WWYj15gOK
z2^a&o1tmbn)Tl}5M%g{J_Xl`UYpAR(Oz%Zz5?-v
ze!i8-mrO16J}mf;ThM6c+7~QnOml7KxnCa+NWZ^QbTIGT$dk@Ac#jWpw)s=f!Hew2
z|39xb|4&vXc#{kNpEdnIEBaqG`cL^3ovXrkjr1f`Fi7x%(S>)^=KOk9YxL^_S?m9P
z4^8pE7ykO{k>6_I{>X%_2ThQF0-@PRd(?*F37bQx
zF5ZPK%6H-9u^_ZV*x*q^CeFmz_yaWXTuV2&6!3FqG!iwCnE{D3WOkZFIx>5TLSQ536S(XiXqm9gJNMs{3C5eZT**u8|U8Rty
zgRXK&-
z#fnF+y-$o<
zj_EPV$M-tnh=#)8E*5r(?h_1?(SN|hoOsb!Ltml#9$Td{-KWz%
z`hU?$_rL0-j%oFN)9HJhNy~)iBa}@4=C_V2TBbFwvDi9%GQ_1^p~0T&UyAnWC>~0~
z9?;e>=C}9{J*Dq|#a&17a{=b51*64~)X$LA@A`fE-J{>9A6-2}iDna;(Z7#SF4<(<
z-_(0ahnOD6d?Dh7ecBa@(Qo~gbPS{(A*CK6rM`5Z)O+;%q#jI+BmdqiV5_&1Ro^@A0-9vA5v8Pf!c5!1gkf6e*9G!7l?{0!gVq-ueyG0{{zC62Qm>4biDN#CR2yQCu0
zB`FO5NqtEB0aHF1_N(2}iDwOxE|sM8R-AcpjaQJKEga>`KvxT3=l^7>w&(Iwt`Suz1LCG;h9L2Q4NX4>)3IPTbJQ{U&0jKfNUd~(NUfNlmEJv%
z7<&14w#gg!3)lvF>V_alPEAsOO;Uf&|Ipw5tcD@;LCb6wNX%xL!omaXeW1S;lZt+&
zAMDwPv}05YMh^DARt}5!yiMalh2_^++C2+G4lFoyU;*i6`G@{x!J+#t&
z2kzDM*u{^2XTm}EDAqsHU>KjVJP@vdve;zfetXckS!`378X$~zK!<0d={k0dk&Ru^
z%4YvIH|1tdqxV#dI8gEMfr_LL<{vf>z1PTxe^t?zNvCLV60Rvu`f5C(sc!H{Qe6b<
z>fLk1_ci!|wuDoX28Y@Z^Di@sjV@a%I3Ps9F{P>7^-HztR!m3}+@sUgCNT67g#r5^
z91y1?m?T-4rB)V)G~zVz-Y2v}ipj6A&3jfvA6TJ#U6OwyNpyd|;CT=BmPgw8@h6)n6%!zrsve2g6@{V3Xm2O{Ayi8=8mSv&rz^
zY>Fjq;*vJq^YQ;~lO>yU_1@|k4Chkd?17nLM9u)Cf1d%YIAEX|n{!?+Qslit3&J0?
z%rFM|8OEmSNlp3uUZ+t|CP~jUzBj3fWEu5{dMe9{|L5vGJK_)QIC5YIxpwf6m>WNE
z&^Jf!w?i+1RLulbRwsZM|M&vP;T$>z
zqfFD_Q9hZAfrW}qUQQWZ(IzVLXvgFig-0-Bl{>H-Fd;SnyPV7@q^8@5t7a@C|8LBX
zY2Qn|Ku#J`F#d$O<$H7%(^!xBq5*|+O?H3or1)O$r0rkXbI6@!1eiX-gbgt4OIb$!
z6m#uptfX{ITeCn9DB>3`IqP=8T8Jw$)-@Cj2-TdMKnEKAloism`8TLzgY
zTj0zN-tWQaOeZ*pA{IG^jv6AbUm2O_o}f@%?4F>|ylr1r{G_74PSyD3O>ITP9DNV=
z2~dae4L+ALNf>O=f54au?=3o?s$g%>KRKn%OyDAl#(|)NiXTJ?e60fw?vtDZs(%N9
z5?=#BDcoNaZpRp57evj?zZZA7&^OgAX!@lQ(Zbjr0TY_ZkF0U6bD~z)_j4-ha`e$>P^`BoA5+
z8uD?dqny;L#o`yj!W|a0qbtmwT{TF3cp1#)^
zhtUxKWzb>`I)O6$+E+x>PmHtFn;6mX6JwYDautJ;u4wp~(Mwgt{m3xKu**d4PmC#2
zr0I)3=9E;$h9hXCu(V@fbONq-uxo^i9piNk)zfLjMQ6q{+Mm3@y?3g_{`dvr7iY#R
z)E=Rt(V21jwn?ZloAZZ@Pd>__AyY19>~73*F@CS(B{Xlunjv)i86H$)ZAElH<1mfm
zB`Ql@8s3up5hY6pBI1iv#EPV0#w~_E99*p`_I8~{Vy~mX)s6Ik;!3+=Vt8Y$Gaxz+L%uVEllgT?Q$W{ePRA|8Q-0O;ypLx8w!n7#Ou(*O}!y
zN3z@7&CE=6M%YApV`!F;hc5Ow2QH8W&hZ@~u9NA}wHQk3jOc0?HN`BF^vz_V(?2V7
zpb0}|y8**p)q9T1Wc`w`n4r=2!t75_j6hXV9WP%8GMugzRrsaFYzg}@6w&QoP`>2f
zxOyCX}h^&0_=k)!j2~
zt{6(4>c}WuBpTPqdW7=kI(d;x|5IpHCKU#CiTUd!xic#`JajukL`C+lek)C?;g&73
zcDbX^c6>mFtsRC|dsUTfQG3K5$v$*Caer4JnDsf1h6l=5Jrz>onssjZRu*IK#Ni&}4U6sh%d@onbsf!wgi<
z5|Kcqv5T~L#Lx^w*BCS8iL)o7!W(PmR2WJV@3~JWPc5_8{uDu1X-6EcuW!$E-RUgAG0kMK@t$MCXV_6ZtB7hhAGu?a
zBZf-)#|N@K(%sqr!&}j%2HFo7?=NSSG0e?V1hY$4KNDHtrwR5kOLjZM85xW(w%=oC)A!paZzbP~p7#5grVyc7FaJ@+IILh62kU2;7*Z-)nP%)mz?sBH|
ztcvZ^dZssqP9c$VN6pS&fNdydXyun)lOwEj?)ezCOB|zpOU5SXhCKO1cyDs~p8IPk
zp|WzlZ8_663_Hhj@^x))FN$zEj9f}UngE(W}M|(`xUfH7v_Uwp^)F~DDA2&
z_o>9VJmQgWG<9t_v^RKxPN|C>RSD65Kxy`ywjP@Wc2(GUUVrwC*L*>%M2w*@&!HuU
zgpnx@{SDrzths6>J6pv@?ykwbIoZOkYOLMLUyxBS-nl9I3-rFoVN#K}!7+J*r>ahE
zEpQS9-9=m5^}eyb9$mHAyVfrWYER5932o^ed=X8wyEG|t`usTSM%I&wgzsE)b5$F7I@!XsOLwPa8;iBBwacw<
zjf@q*OpOU!%V`m3Eo@`&5r11{T-DexdV@$=Wf&YY*f6qu4BVADxT_^2)`HP{8%C(z
zh}B~B;f7HhF|^9iKTn4Vla?VI6h4k6
zr2Qeb;EI)VaE!NY)b!72Y6{PfAu-|)bG|wpL$H2
zM->0U)FtZH8JR}m?^&fU<=GaQ9*>7tKi0}=D#oN{IT^SAY&fh5&
z>Z91|Y(e)zXg%B9m^ZqX=F*qH6$8sjj+_@`@OWfRK*wNTpUkHc}ARYm4
zUp$=GHZ)dN(E+myJ|kHzi`~QwSEzJ_@fIV3YC^6`Z5!+3k0tW~*?
zbfS5Op??H!s=c~%#9OXy;P&cE@)}$`0@A(J4Ew35XRk
z#139t+l3-h{Gk1$Py1eN*fS_KXxPOqdn8v(lD%qW(YXan+vkzerE4J}QkWI1mNK-<
z(6y0}w@u!GA>~`?D|HwWjJPO-#S-rowI
zPa`#3T(eP52Tiz1jw8Q?KA$vsV`U~;kKL$jaj$hLrVsqHeYBI^L`jQ+&z~_q?Ujw9XPW
zxiD?Zb~)5G>}6CQH1@}tHiz)le3IR5&vvlGzG74#1@}$+?T$G}ir5XBJo|-!4sldf
zDKz%<`ii_r;WxwS*5dh1&e|1D*^9F=By)Eg7o-(sar}sL`wT;jM_^xT>R)GHXIZrf
zOT(JuO8c!)curxSOOIb2{XEYrJ|wiYw}x=Ske6Ff-u|}4pW~;+vkUKBicl>^Pl5mQ
z^r>qd-;r>BCZhHk4`H4}?LNbs>Ut{h9sCmYfe!)$@rN)~U@>lJXq`429=f+1m)Zhj
zaZXyE*edDn!MK47_~+QS#Jd>&kj;0etuiKCCLC6}6fdB_NJZw{N_jTtyVJak&W?c`
zF)m0~XHo6j7<+7}uH~>`=cL)0Q(1@rYFFW))}#?jozbaYe|h*Nq?qk|AY9N
zikm*g7IF1D1`_>4QrTKRT9xMwM~=+)^}dO+(lWhVx>ozxAJ+05VZa#V^x2|FiNom0)Y&S8qUPyEo4ZbK{abVM_Y6_12{&?QZLUcO4PQ=bcLj
zy-ZQRG%kA7uA@*NsGjkHAm^T@iTBZFYt2fNe};!4RG}a=@ObR(Gr-VWClzKlI*2|-
zdD+V7n(5L|lG?hMx>e)574r_t?e3o#PU)*-6aR;fo1ePyk;&Fl^Vmv|r=0y~W2=
zyzvlzYP|_c@C++RYaU31_*Hd=nR^5}-d029~eK4iV)6y!QbM3ygMDBd9_O0H05xk6N-rHMamz^fqYn>%OT2orU3;JJG6%KSagO2eI&LM&U+0
zztzE1h*8rZ7LM}b`wBYq`5gPth__j|BX{UC-e3rkw(C9^ZG$2dQvsgR^z{^wy}`mC
z#w>{k4&i4Ft(T|c!WQbB2MaLNTRQ6K8P~s;2I0G
za{Fo*2`o5K6YGh}fWf9b?0dpZ3%_`h{-}v9A+;AIwN!C-jd_z>j%hn#f>>Q7%xH56
zTdEH)1H*>3@F8x+MJsP_MTcL}R>$8_M}J64SI<}t=TjS^R~x@WJ${k6$i}Zx=e{6*
zVB^mp>(^q>eqnkNCQHx>mj8+O`nAxeIcv@Q!(k(9=*V6+Zt?v0->IJMDTz_J)+Ehb
zN4t45_616p5ga;tJSr=7#I3aTP1NjMnzptzH%(GUd@|yrD_6x-BwvhEsQO(NarXFk
zR>TX3@wd(j5_V#?9OOkC81ft_BbKvPBM}UgE%)3Y-+7p2u-lwlDVxjo9%I)S5sioO
zhiJb%3PX7BFn;v{yZw~4ufWMMIdW*v87lCLjtXBGNPpornAw!_N`lOU$
zzoZqm^Y=XBYlQ0>nk8L{U2Pul2^9SSxd!qhYC0wBn1O(ZK=>INTN}cW8n`ol)!Ay=
zOI|-5WLv3&%8N$Em&zBC*@h3Aq!8LVxWkFKfR=%vu>il-9azOirh7e`hP*F;^2u>K
ziuy`-F+}M^x(@yWRmYe($H8UbzlS)uE{)xF+KSlV;5C*Hu8eCW6oyR%PxnbbML|^x
zVR$6J_zpB$@lHiYwRfEV4YW8lWmnu}ry{Auf-ZjM!dv7_iVLk=;x9}_VyKxPSYMYd
z?7s^P!{g!Iu?|H+PogP#MNsiv?C{$_^&wu+!%dzR!tOH4H9RUWETZ&XAkW$JqXfb-
z(W@v?Ha)oSFxo-x!7^JMd=~?wnw~ah~MrI3tR;lPzZZzlpm0g}K9Z;{`xAV0yc(MRa9nNFZ_uk@~s`VnxwDB)wxR
zOJ3X9;0;csOD>=4^jUE9BkA1}s?z16%8nuoRiyMgB}CLO`?FuuwC-FXCUl*KVpd`G
zTgl`1ZwiD&Ap3L3FdO1u8CZ>Ebf(6RMyz~~(ud`7-EQe_oWjS58(iET%Oz^KxSi$x
zY3uFWjh?h{@90=K%v+DyDR%ElipAdJ)orC__t%P|XW@Iy?%9QURb(88a)$Va5pJhJ
z7g-ThW8C4K=!})?YH(H4f_udu(9mRxqNlLJoAU#k*D8>7iqd4UmyuU(n2%HIOidwd
z1JaFQgu}k8oftO8Kh+SPu_l_o)YP>s$3#~~#G^wYMHRyLkyHDOeTQ=qJNt~aJ~JTE
zP2?3a75f;9pK++)S#22QG@T*5kKp<@-Z{go7WdalTxWu6puNOy?tUq0B^%>J<+ya{-{$z?DKWS}gk`V4(
zF`Ql_W4Gy8twnV&xp@>xoMhV;J2|{R!J75Chv>ATp2-}2xrO8z_J-u
zfs(>ix$T*5!)$?$>hoUWGc)`$?Ll(zOM#Vfn*G^Bkca6r!*9Qf8CnNKCirFV*Sf}I
zNSNo%mq+AgpJjjX(3PI0kfH5K;g1k9MhAzE``58Oba>6}{q^fhU9Oi=c1q%Kwr{fS
z1$N~T)wAxBsJfzXp&s(=%!Yq#u$Xj_oZCL;xW##P&J$J}<-}6Qk`nw&PnPFUa(izo
z+f9dOzZy8Wm?GbZh9J3G){!*SH-Q-v)8_a?I;zi9S629GKHC-BWWuJ^mGQeqw;wZq_CDJjxzT3!QT)s9>LX%1Z7tI@vSX7xX@gDI-F?13IVJ
z|9sdgeq*#cR5jXp6_S+Gg^g1?>+BzoztOwnw(a2&Rtq~~ulxn)`SkS!9(-Lhb`cV7
zZ=S@Tp~Js@f))-riQhiTe!-o$ljrHrX#ejv`_ryK@z8?SBSKrihjYa62;R)j+&?
z3L=tU$gWL0g`atpPdcKg)ndM?cVUKux<(tt+ubE9Taqj(7-~;nh>S8rbIozkgz
z_9U4&^dSB)xu+Y5jq7Pk*cL%8Cx!VgZkCE6BuVV6
z8gN?LBV0*_7`OG+uIWVAF6c(jBG*;v{Dd1>vzt$HzF^b8?pc%~aFWM+I=H%%?1}4D
zPLaVSVp!;+E8B!=-s=bS+@TFS2e)t`taOf&O;uD`SBMA6A2uWnw6)o(OG?L3hW&a{
zPvKO$x}bPNEFK*2;g@5md%e_tug@z)?Qy&I^Hdq7?QO8fnhL1Rp7#!zQafnh{O+F6
zI++SbMfm}fX$iAyYI53=Lg5wLKlL4o-DxQE39PpV|E$lfQn>YYlvGBZMLjLGfu{An
ziAieuoOAE;>O_9>X=FbZ)039Dv!Zs}#8;>ni?P^_r8z!lD$
zvX=1TR96i3SI>In45oO-kaA*rGFMh+N>Wdvl*qo(DaX}m5xbm4+&qJSdE)O@34!BH
ztDEbK-=gAb_f$oExCgt#WpuLC5F%7FHy}NABusV2r>0$gf)=CH;#?PDa`d!zT2;WI^wD|A3W)(M7M$x(41cgKD
zdSfkH8c8fZjK6GPl~dYU5S$yhtdB~SHN(>>sxZ!nI>fEB_}kb#k#-h>-vMu;|15qL
z>sFYa!?iI3t5kd2=
zIy=T!(xyFVs9#yu8@8Xd&OT|*BdRU&v*)bZrYc7h*6PO3B58MQldG(!g8e1Ws&U9~
z*(uFq1R>|zR@-g+&{DPntyF$3bykKk!<
z^YWbc*LDgL1@n-Bl$X@?Ed|c86U=!&%cDh=p4pQulqD2M6DNEVVEd^lXzNW^HTiD^
zVQ9>DXfh}^QTh;6zqjHcEoqW={DR`*D~u_ksj)}Ziuof_mjeBmiu|^SRDZo@+b~jte^d$
zh6<>G&dxjxx0)Bp+lx=DLJ8}Oc-Rs4XD4}OKDqnJi)%39x1C2Ovt%>A@3Bvq3kd3C
z_?h!&HoX0!{N;tnf-DFdWt{~fZAsD(+4{(;A|PxabwJz;mOCzb7nZ|z$naa@oyYKF
zhodi=iu|WCduNI=KgHe=5bjVD&DI9wXFY~rwqYOEe3
zd*BLhE+AwmCRhw-Dd_>C+|I2ehcDSkmzSyVahjVLScT}mRn=AMmRtKJyZN$}k6-N0
zQmOx!sAej!JiB?w;cIrzwhUr$CK(czRok1z{@hZvLZm#7uQDlp8{~0j6A^O>
zf6N9B1_B~wbzb!n@9StW#383*t=QEKyJ4N{o3+|M*XI%nyJ)3dod4bg;ep-YW%y+b
z^)7pgzd-p5Ub!LC&`vMd*~Tp{cFY%T2c1Xtvyny3DiG^r9pn<$o@_xW|XL=^Tsk3di2dNzi<3jY>oaY?@X2PE8-ttfUn
zCj?-CtiFB9HfAff7=pFM@tEk`ZXyQ4Sfy)ILR)^x_BGVl&|4H5;Tj{s&Rgxc5;Ka7
zWm*agyI6@nw9p+ZYdBsz48>Uf0j327F8YDy%}SJ)*bV5>_iE3QaGmI
zhqQMj}7U3ULSRQ;7O>Zm=x;jiK
zv!H(L5BS4Y)?=NqRa0wuW8h<4Rh97`QNi1J*q?YK%PYf)GDX!-$VV~f5#-p>Py_=j
zb=oc3S>h$qLzyGa>2hUfUlI15HSzTyaNT!`!S=|`o)G`^ecO}Baj(riWPQB51m3FN
z$rP0AuSg)`&z3Yr*##w*LT|P^lcSdiyv)#xTHtsMIMSsSK)!iVx^htaew@(9rl$
zL;ON~F;Iy?(A9?5=v2Eh(^(pO7&)~#OxVrYrI$lLh?L7s(%^y35)AESZx!3_ITu%B
z-|+;ovEJbo^-+IE)%n9+irO*f8W?~beznU3t$t;5u<5TW8guRN@dvWia`0MRR%?#<
z4$AS4^_~}}2Et5CZgU-S@bS)Iqr9FTMLA=}xu+I8NBBOC>l+&KJbbFsk`^5T|A|K9
z3;f1C`X=fjXPN&rZfL+uZpp|?X^KnYq1K(@uH@QPQ8O4Z{WKVH-daAXkcPDSFC{?4
z-PfL7(m7qx4joz^=U9^_DJy`5cc^M@B6WUpsRKH+xnk7Iv(8EMDGG2^@)e5?X`Nt(
z-*S7AZ+?3i#Cr=34MLac@c3S+BX_-;*Ir9SBKA;oP&wz&-g1a20ysJsIyaBuS4nE((C3ZAy1oI{up202Nx?vrv?48#hE
z%xIFVb~`u!C<<)PDQfM=_g(5Q)aRPTJdg1&CCj|5pA`V^3k!d>|Z6
zS4ulFGD77lXuN?rkDQs^+N>{;P@3KB^*zg=Fx+KC{y1=0G>{
zfUPNKKQ<{KO87idtWMZfFE;ryfJ(e{1@c2=ax0{-vMH#>rT8xDNlQsBNL=)1lI31d
zZbRO+`S$ULY6xEj3SX@qt8usWKLpgZ5OHI(L(}kSRF*zCpXMy~*8&w{J*K6FQBw;r
za0b`9V}*pPPz#uSJf_m!_gCG%L$Y@7xvWJZ_AoHlcx1Lu4-1{b;XF6ROV*mDlpKg;aA+xZigV-L1uuiZ!mbl=(8-4~v5DV8Jh_QgX;n?iOJ%wYZ6>=_^Z|&-cZafdK
zRi-6`OVb4fkV8q}N447)_~enjLA>`Igdk)x&1-pm&}V44tQEpVTe~^Ix?S%DQuP3z
zN;@~daxRLVpIe%l*lK;8Llnj^4T!quU?x8eZ*IoV&J9$Cbiip`a)3fI*Ed9{Q|et#
z+09}};Aco)JeN^l(GvFzFc%7%gA(g9i`?PFY&j}CT^bJmR|KTt0&RVSb!9ORqMVT0
ziDF^k?iFC3Ug)T{PcDc7M-{N_FhAGO=zSHKTT)W@JlE%@P9Uw7{%l7_v1t7oa1#zz
z5HLcy)FH~gw=iYl7V_iI_&Qb(iedN5Om!941v!Rpo1lr>fQ+(oX){TkkBg2FL=8t@
zM$x-LDT5{R+az_fYJbn&XWZQoc?(Bf%N8cGUmyi|UB}PdcnQk8^OF{us(c(7$ZI`k
zODUPmvIc70N=5fjd)?m0Xg9mPJ|LAJ_(z};8}0Jmi6wG{j2gFV93MKMZeNEujr#cnrKW0OIzvWk38W<@~
zA~T=ulkH)nM1muDtf5%Dy=lLJE|Q$0Xx!@C?i71rC}(WEN*?VjB@?21!JVPCfh)dL
zRF|;W=`TpBB&lINlTM<@sF=SYFQQUWTsh4r(-;X3+1YJN1@@01f4L;Er6DQg6R23<
zq0=e8e@a#i-z`kn){ESWRMVfpMtK~@zBdooxBN4_8mC;(t4|QezJ;7)HVb`)&TfAJ
zYNxM@*r_tz_8GM59#Gm@;*<0js1UY^OkMTyO^b)`q#aSZ{SV}oJJatz>#(dY-{avA
z@qlroDu1RoBrRkc5(NFOOWj*>ZvO|!+w#&@aehpB8|kt~Rx9e8iO)b-O&w9m1zO+j}MIL{7`J-)wVld9Odj1a-+JT}xY$kiP+!;kz*4=HVfE8A-zOid`HV7a)CO
zz--?1YFM1upN5EWr6{+tcwoa;oxe$!th5JA)D-MP^2=wmZEtO47wGWeTX9>!h>e44
zO%qMVO*)3mF84s12L7L()q#POx;BWM`0M2%V{s`fYVwx2T(;Iw;B*TOMP%nqgd|6+
zvoY;?)!pHW65&TEy|%-rE5ygqi&SQAd8{FNN7fIKwlKKXEm9`!20G-7cj|W~Rm1C#
zq0GRc|lY7esg^V9t!0@t_LGQFDy%#4D3SznS+kORr%QblOp
zVCDv=Mvq72r3hj=+Xk|T{(LlMY%iAbiv5@T@
zomUMJQr%LKte;;sbsTwmESC;0IfjJ8_h2&(&OxeZFWW!H#Iscu>
z?k)J12}uf;L_vY0g>)|Q-s74E=d8!t3&Z0YqeYP8@)!56_~lAe5fINOMwIQ_3rg(&
zf#$1Lw)ZD(Wl=yS7N648)!;bl6Ng`h{YkpMm9)Rwy)Z-)%|!{NPPH4dhE~u`wwT+r
zQsC5h1jR*<&xMZ8RYqffCtiISKYQ2OwXSoOKR74!gn8xboUbZPa>Qkh*J=UIK?!YlZlv!Cl*&Fz(>I65~b&``1G
zXw}qYpAz&P@|=xrYU~u=L@r~S)tj=&{7h_y$a)1oYh%4xCLK(u$w+_^AW)9EwXT(h
zWn(;^k8QV7F|)JTZI)~MhADHHdBg3-0s|Rv0OYTVdTyI8A
z>ea_h3*x=A>Kbzec^KEKYh^Pv*+se`11G&IskCe9V%O`xVZd~>A6aczR>ui3)W&j*
z4RD_b$S8(j^NXAKH3KVm_gp(+??~3`C~qXVbg#HNp5v@fRNTbBptkUc55CvbC0=+H
zH!`$t_a2PlPtJOPr;5#5;}3<}N$cRVzaL)(t9WBw5ngkdU6R{K(Al5m>Ehzi1fh6Q
zMM*(lSPUd9+D3ObqXSpr|7_xwC%M>;#7!&Dp<>spR&n}dNDKBYPo6K|m~eC7T!UdF
z8?$rs3f<&H>08&OOFexhEfPqX1&e)4mQ=ONZ7|ebhdTmGi8$p)sAxSjHJMm&)})_<
z4O9GXpo3Qkcq_Mcf4+Tp^lTUQo^?ac5X=JiB=Bvv0bO>|NY!XJ?1tWa4GwzF6Vd*f
zdWMEp$=y>mS*kV1$C0pNV9MPgF`XmVC#0|8R=QSU3AV#yA@xBIqb&PMVm@gkj`&lk
zrlAclPrRL;zqb~B6A33mt5mB+-eYE%wPSy^Xm)Br1bYETNu!r+M3FuYBhqbRdm%#J
zEers+;~3Cfmgdnh0c1tmLTK`UE&1tk+Q4pNT41o}Bz({3lWG^^xGDDh7!^khwn^)!
zLME~ETvfnMh}X)NS*%IEcjU3@sMfG@j;;YOsdj31uf;d!Bb3qVI8+_yygmctx9)ZP
zVMCs&Qi^K|B@<;cr_i2%_|Ev~
zdK~AJ0a5e@9Om=73Pu+l+k2xSXpD7U>mTo)N#)!&AZWKBAL~UtatqR@-@QYa7^@Fw{Rt$7A=Q!k*2p{CBqE4xg}-&LU%v5!*P?eY{xkw4Du(2D*=ZTSKqdU#!MJRwad>47VCa>okS5jY`9-0dA(v#Tml(>n`V){@4T7xyrf4T~z-Z_0q#)RBkHv=sEW0S`)gOA*Bo$`ZH8#ecL~*f0#l<0n
zXBMgAdVPCCm~Wq(1#)bSKnN4yh#HaP0d%n{GLBi=k$s@>pEPcYwYrH&{WcT$*tdi}|R~<)=i3^L>X~iA|
z>Siha2oh>gJ{Z!yXxG(le-;%5jZ}&EvwI53^0FW=IJ-@Vc>>k;<+s@FOavB@jj~$V
zDnqH9*_A&>nNB6?T%+KOjNOGxr$nr&y8FgEurY8j}M
zb&8~JWn?W`or{Sxoyi^#LKNBK7(H6iYAdQB`7^eLvb{zUm)=KxnE_iKUisTnstc?Pv*qNC+
zQXX;m6I}g;W8Q2|Y_mM2Z5cAUqslJd!K{czlA*sgW;4pRvH^=9sMw>Ixh1pL4SHXeHT`mhz*QJQAuQD2N|RsZW!3q_mOjgzYEy^fdF-)P1Rk
zq{${iRYB68fPbRk{%!Xe$Ig8q8!!h|iu}p7j(SLPMYzlP^F!4cy(GJRW{STgJWFDO
zgt@K*^DQ1zO0@-xU;%la=POV54`~?_!1-CQz$IbVuCH~7e9w8UyN0M1@4bd1Yxk#%
zQu(7mHelwC&dU;4djqQ>imh`Ox%auvj*;xC8}b3KmN9oa>Q?Rc3!)^w@XtOVGHdPI
z&Qq31RxtQhZlo#9RDv%ZyuM}dHn&uOlAU;<>vN|qfRnOX0kS!%uLeEWNFf5(vak)
zF-_96+1Kt#x1_%|ZPR5y5f=m$g)5@Sj)Ds=h={nNf{KbDDk_T`E-0v|xS;Pb@B5d0
z9`G*DeV%i^=bZ2P-qNNa$V@6mMd_Nl!mjVeyV?7Zk$#4_s+y8pYbl8zdfr%h>T1D3{4;d2&aTK(kU6}SqjBQA>LjdPpuE;iR;ZOZ
z)sUgyX<+2A+7!msqaW;6TO}nso8$MR4u;s?x6srE%_xAucQvEiy}9;(pthMNw`)3<
z`&}Nwh<8Mc9PT+7zc@J^P1wN@fW
z{Ewl_gWAcNSzar)h7m=-BVRa!JdRO&mZ}w7TW0k$XmopGtCl}CfI<0b@^|F-Za~hT
zBA)m?89)2z6JUrz8{+nzw{O~d`;#|Lp_6alH2(H4-#8Wdf++qy`Af+2+#db+X~WH5
zkpFY~I`Y#*Jfg0y6t3*meS>yP&aKZ+EzM;CK#FRcm#6ykr=CM)!{t@+EN5yqj1FyY
z$%i?^v0tEC#e%Q0V=q4&=}5%8)(1EB7m=FOwd{!;9U_y4swjW)eDMZC4x!;`U1ErB0>Yp&_bP`VS?{)w%>v_tfa*x
z#YKIX;2gdsn5#)WFiL^nDjv3E7b;3>vB0aiwP&${-kvu6ceI1P)~{DIj0#CAd?#GA
zy{8$=Uxs{nP4SqvyV-)7u24sPWo50SJJM&-=DuJ7J!{B`{p|{_w$uI2iOM>t~m!
z8-{niJ}!(?>s*a#2P0js8_~JCf>4)tPK-VHlN5SEv|vYAy$*ILS6#f^J~CM$CN)!=
zeKWGj>{iboP@!+EvZ_9ffj##V>V|QuPEr{b-iYSz2ew!0=Y?3)6?|kqA_&m>qA*w8
zn+x3W3}rFQRToX4w$}QirV&W81Q*l1&L+MZhL==gt}Me-2*jiHMRrsmS~
zuLv)Xe1CizCcBe
zl58n2QveHkM@bVEFGq#%qk7(&Xpg}WE6)FbnmMtnGjvU={)u+!YIp1f3uf3-&Vt%e
z|D3l;mq;E8W>ur&l^<2GXOhSqm?xo
z%vDNKGp^T2SF<_dW+)seO6$^ccO*0L;}u<6czSDR0G2$jvqU+Sqc^BvDejDJdicHT
ze!x{}MQsJ!`_^nM_bSz?A^JE?nU?<&uf25gW}@SzlL^Tr7j@Ui&!rO@(9)t87){-!
zi-&M~L?8_?#U<(h-L+G2*tVOD4u;sZ24AlNZivwll)2*CjK89SaO!Zqc|8pizlPV+
zccv%u78+9_^EowP)U}sa9X-^FG4(8GO#+u#mNrr|Cue724X;sqMb3o`Ep6)!2tmc$
zt=fJ!jHZlhrw_;Wty1vaWpum$`gYu%T>)r+m8Mw8bg11{5-KQmHG0~6O%)_1)lttO
zoQLJg7tx8jam_T%It>@6_H22F`Z=oODBIDNDR0|P#r9vLb}Uy!_42*FPtaCD`x-&C
zJDRGda-t5cx
zUjB&IJy03Eh^j36g4BYZau`jqX$#F0bm`tLOJuc=0PCpxv-)?et)6x2gK
zqLEIa^)zhPo%v#_S?%XMR>Q
zmh?JKNSWk>iy!0SgMF_&duQqwXwQW9kZGCkY$Sb*JM58g-V#>=h3Xbxa}i75v324y
z@##k=PhU^TWoR}uJ!K3h2_4)&n3~vXU>HfCP-WX`=`B(*{WX+d+iW*?+ZdSoNqqY-
zZ!LYnnmGxv$fi1rrKdN*1Wn~PXEtmK=h}dZU~mnFRPli((koQ9HbYb>ZFBtxE$AOt
zbSu_MFxKnTLup%jz_`@(H0sUClU;90`)
z^&z7J7C_uSbgo%i}
zDp5nnIBg=_M;dL#VI=}oX*gR%PQ
zfYK6ySyZ-57L|TY4p1_x4tMgctxefBFh|+@ea)8KrMz-*cD*ypq6)tsZh$e{SK*aM
zq=4UP(vd}S*p({4Zulv2cNS3B|4w|G1q_4nr@&QYnR^@^w5w>iHLBd2=`6FKKStza
zksrQJWh&=18NO_P0-6?Zw|R1_r?G$h6z4};%J&5OG)N89as^d$%WFI={1l$MCwH_u
z_v_E1l>f^^tjS*=@kWqFMZ
zTYC!kZT2X6OXXH@Te)=c-MNcQCg8=VQkv=82E8!Q14M`APA`9!#w&7>J|lvRlaCOz
zYzW2ApCyQF^79{1N4);*NKb%q51KJAZx*g{qu7-<&J6_V`z(3-f)L?cO|IHKnD^M+
zq`y(C7Z%k6y--)EMef_||a%Uw}=gVjHv+L=u9rt%Z#bYcW61N{HdQ|S6l*yJXU@TVE
zzM^Oy(*v8fwWMhB;7~sN0&0-1*=3SJ5sVV0Eb
zZxGuoSYB+rwkl2PNOx|7q)0u-=I?55E5^R~A@NKOGzirEkSNF@zxckJS~p)7V|WCN
z6X<|>-xKdykYNRHQeB%X{HB4-{2R~`XM=d9y|D+2{ScoXZkV!7wdO)md$>TklS=Pc
z2bjy9aaL*a_KY{8Y({a5jJ3*}g)W6h+2qrS)Dn(DTXis7^gT4Rz-qV6+eR_%o5Y7~
z^0hPINLuGI)6;0iPQVgVtZw;MGY7h+a){QFlg|5XOe!EO`wnk4|KI{Rkp*4=V2RfrNot7bJy_NCIN)2oBGytM&4*;
z`245D0bI|q-DikvT=Kig%PG|pD*e`az6sW)Me5&ejclhzNzFtxmwe$~ysIu6-yW}O
z@Ij=OF_T+eE}~=q`&sg?Ax$^jn2N03dX|WD$#*Az^(@}ZVzt^$xv}dgBSLSe9~i9K
zB7JJOl1u&|A71|9#9=Ye(
zW5}})rnG0RU@c!G^7!Nz
zj*~6{ug%RTi>{L{Qp-Jve)57CgM!V<{owIjcMj+(RVmjtJSqDRs0
zk*%JY=5+_OKXFLm{OK8AcYWYZG+#7OYFHPL>7*N8$oh)-M5x>VG=wVi}W%zGM>k7Y->{9jJD1UtVar~m~cn7;yy)e^FZ+m
zn&+5F7rCrWFnHi$yEI#y^Y5ZlV{_X)f_vvl@Da_8Z#rhTJiyeZ#IA3-JK*
z5&`jdJTY&sBeQ*)qj?SWvf1**%wb*uiG%Y@BWsmnXEs=QTl=P|qPwRMPPOSSi<(y?
zekcI$Pb)c&s>UfydNay(3FNu&xIN5mqDxyxK!
zh85q1x99O^`nnxM5JncJ#b}Ih>mJs37uBY(El{re_uoaCW=GU%(}%D>-j%Z3(6(4f
z%T#iq4Rg=Y)Z3fuQJ%j8D7BLBrddMhiH`8B`V1-&P46y=(tSr&8%}Fe8PUBs^B**p
z+nHaH*IuNu`}-4co)Y3$^&@5xzXMnc5Ob1Mk>d*(+t8E4ICow
znr6+1b(624>qV0OH5ao3xN_Gt#7O5_VgAUwXkY5Q{?mfInv+S?4Pwn`Rb@(_KwFfS
zYGdYNE>?M#>f4^2Gn6vB3c*sI#;Q9t%^Lv$Wxm
z&q5umToJQaCs$7-pPk=kv|D@T`w+(IvwMnySrJVFMWhsBND9zCL{-~d4I%qp?;Yr5
zV7{4`e>jOfc?T{SPo4FJ59F_+rm2>N-9>vr3sm^ZN9yzTeHn^xP*%;JH&5tdv;n3S
zPAOzcYn~jQo=H5wU~ZTju<_qh`CaKOy0WsR6tDj+Fc*JKI;>EdktG
zOc*}Xb9L1@R#?Qle6z@#QLn~PL6^VY$Y%rb8q^Nz3T$3NSPrnp&Woq*_Z1(-w+p7V
zwWTW2AmB44J)X(e=G0*Mzo#l&c-CUm{xo2QS;dl}Y{LR=kb%FSJaq?_dpmCMwb5$5
zvvonp9=QdDPHEm0w)r#YAeJ8m+VDv?oT|*8D3?ZHQO}6&F*8d7=OP~a?)zKcruv1Q
zo$+yg$0c-{J4dUqIm)poZciaTlf$w*e;ii^jfM2xIgoG8WYZPi{WQ+N`CsC4c52a7
zNuwO-LbANce(}`)2plvs>KWFwu6lZ44|>MRRDv2Q_S4&Ou85i46X1!#l^JKm+Z}ld
z4R*^H)YPsyuWyqh{1rMK-V)3#FE(P)-{YHJL#4F8nYbCXDX&j?^15WB!@wj=i&;1O
zYx|mF0H@stJ5%fabvWUOc3m3|meI7Ju^^{q<#f%JVt;xY-)>vq&h@(@H=-pTvBy?p
zRgXa6RM27JjcX?)5WThzD$}wL#Z%Z_w^P^W>ho$3=5l_4DpqZ)ye`@dHg*OdF<3i%
zf2^8S)sfKby#jw%k)s`Z<_o;6sY$WlIU#p}v1Btmai@C;>wg=cD-+vv-6Qe`&|G;-
zBsf45c;KRktLaQrwpI?s39iH2JGVGs!gyz>^T9I9NUVP5Nix^QIg+HN}0E=IyP6haR{ICOiRv@8IE_Jv_wQoPbLrzO7iVTO$JJ6
zGFT$Hh&N?0xThp19uvP!oKlf5UBb;SM!bO~SJL6G+v{C4VWt_Y`66W{x7#6$`pRH&
zkDFVvHOp-s5vXN-r6MQ3gFC#|-sXn<@@wckv$%u9m*lOJE>ZnlyLYf`N$_*jWz-cd
z*3}Gy#~IqJw$!eLg!iMd()CtNOhdym-liI>hqhwvh4U|=AuTPVw?kY2OLkI4{v(KK
zys9QslTsR6wtJ@1dZi1nY&Ax|rghu252|1aHTj`qz)BoclRrFxbY6S(G2&7gIqB@r
zPg7>)9Z^xu)Q}Xaqs(-6=HPPYF+_+0<^1z9^0gbDe!Y-Tm60Djj{M^162egiyggDP
zwOh41(!5@-e;-}7)VcMCre);WYmq+@3FYKJA3uLD6x*b~hLo|eoc!Vqq$CO9F9#kw
z$N>F`xK#tcK(wbIW%W18sT&ddkE7)`7z7%!<^~+`f&U$MXjNI7#uw4ivFRqod4G4vh*^XJfjNQljv6>
ze3|)k!ME-FsXr>4R$>ow<5#%>D_qH~IEi{Ovk~nuJfen<}UF8{|Os
zU<#|&_5)cO7^W85riKS*^3?YM>&2R$-lgq2>U7mqAKgz9z^Bn_@(Xv6KEw-W8w?%m
zQkcc6pt;;XpPTna;2+U4lHqY3G^3wExM!|ubG+Fb+q2ivcEMDMK7W^o%)BEZHfzWa
z!5ozl_tcUvoIrkm5@!Cb+M{Lz_Z=XlQBX@xy`A(3?%!g}wCcJ#C@3Q|Eht#6FuVYr_Z!>XX$2DAEPya)i!pAHVlXhCmH^)
zj{GX=Wu)LKe0jJ%-b<^@>F$1K8hpojRF#T@!U#)q9#4j_%HCbSo=%Dfa89Qo`F^*`qYC
z6dHLe935?02Dt^A$?;X`mS(4O0J=g7@@nU0ya^Tyc@0T%J6JtK;lW1W7_^#miY?U|
zehw6|3mu0!OXhq9NKUZk`ZL{ZOG^$|oeg1a?OKAcB6Rx%R+F%>p=tLploDPkZbH{ZFWUkl~hFJFa2#+BqMgUe(mxnERmo
z=xOeS%ALy2gYXhmEwUHGL!EUT?6xb!^KYFzO-;s4`SFNsd%6koQ{2T3darjejy-q<
zk7jCl{OMxl8I->1lm_<9P%r<6TCFzd>-#M|Z=)j_y+pBDs=$Pg6ONCMDtMnK;a*pZ
zWYAyeY=EpjZ8Q{R@p7^1A5h&Jl5SPWqVjKOZkotq4v)GaWT+`=F%K-y%Wgok4zpB)
z?(s$wv<;8PgvI@v9h0}B1>>@ydp>)}^uo8e;h>{Yt*uf(_E*d;8_{}9QdkPqgLS#K
zZY#cf3%VJ-9;EBLx;jYrf3p6tsQFveTX5IqG>ax6d3<@yB48I?$$z1(sEeAETUD^ZG`cb`+e~4>=^_y;!w-d8QGJ5^*csnsX?>pF&u0g~(!?4q{2`Se5C3P>V
z<@o2fCI3dNrWm;yp*l8pBAFUc4BIv<53>G?YRWQf3qe8(6JyV|h*|?p2aluuo2ygP
zlAy{8rM4a-bt-6`Z-#(B+CIWQ)Dw(eQV!mqUZE8+bK4+|C}=WXZ%^~6q0s@KBe;VL
zdx8##MmReSa
zA%Tr|M}qTfLux4)n|khMhj^XSikXveeTy!OH!N3w4>cLWaZy@F+W?78U0qTZm!&g^
zr~iBM=Hr+mDTP2yfRU9c>Un2)r8z&F1p)@y>glZJ*7{*ct7aPWGW$4o=)@tiio*qM
zp?<*rarySxkg@y(%4asETDe<8!(bt2f&w19s&x)%RocA;x;|B8#h&^>iZ2$)HY}{q
z4Fi*}E1-kUC6NmfjqSp;>{)&wP!DOlDe-lC?`C}yG%NNv`NP5TM#P+SPR2h_4Cm$)
zkHD|{%6&WwJ!10G*yyA9Kxz(+QN@R_1XYCfX@$*}I!yg2o|lLkv^sTkXI#8hrBd3`?5Qt&Qq!g}+?po$`
z_QTx8CkN<@df>uC-%Z;<_C|f!H3Ig*zu(-Eu{V&r4B4u9#Ml=W1a%N3H>PP8+Fe>X
zmI8e}%G7a};*bkiP|GYEpX~E#AT6A!A1BgW9jYowU|%QtbLsZ|vK0~+->Z&WnFsL@
zik7yFv6xW*UL}1>O&uAW&1-h6peCc4%jZ>SLy7;sj4!G*Ju?}>$?v0(G*%lkwp$`F
zSuM6AW>Z`yeG;vxcIii3OLnm4B&t0vU)Uq&Q_m<{F-*IvVWUKoYbDY
z$Wu$4==k-is+&Tto=Ko6Y<
zSr(?muyy_z4qBZWM!=u|cx2dAYb)x4JUB*j+V+OtDJewCnP=5nVQ6bNZi7u&KFyR%
zXMJkO-)UC@yAZ(EtDf``2Q^`k{2
z9Gy9=Z3MCy?^WzX(v>5T((gfLF74HuXs_P%LDC=4dHkjs{7dsiYDH|XRXx2r{1V#I
zo6mDZ{U~y8BDIco=+;k5(;!k@OLI=K>Wa>{;fr#cCmN;oC?Qhl%n3}5yeeTMkAV?&
z)4D;HYCR5(N?C&qiwBbpFiiEOiwXNiWj2oT_(15ZsqH0Q#G}(L_qeE}JPRVKs$8c}
zV_Syo+jGQdE3mnd_y15x+}=ih@J8enkVHFXc&Uwi1LX3O-lfL&S&^~bg7~k|;z5^BA}r6}|t)~*lr)}|sO?;K&xe|7-YJpTD6P%!SdkiP`Xei9BHZqPD_X}%Xd&zLY(M=_5iqQNg+$vJgqB&
zb}nwL@u05L5g}ca5U;}5K%`6QoSrDyE{#QZAg5coUhkt71TP~mV}%5#i~Qgn$jL|X
z`psb7rqic@(7R?Xe=<-z=R1;0AcndCpaXt>j(E8H2Ok0+=G^K3PAKf2~`jI
z?i-PsPoqCbFxYy?k0)G47-y*~D+U|E9+Z>OqDo$Cws=&DT|H0DEDJ66Yo~_4LUYr_
z?fx-YH+KGMqWa&k!0{Cevo4r>a>k#+{&tWqZWWAZtr8l(KR#{zl0FDkQ?Xxp(w(xtX
zQEW9bOG8!%V!snlpKIXS_S1@BE$xnuT%Qo+`m5p4ct&qzVjA*JU_>U@!lBwecL*yu
zkDJt%Z5F*onTQ&Pixj1c<7y}A@6_gDQ^E8|RQ+3sXp0-%8?hjs2VNX0wT^R6t)9ZAqTVF!UJ9W`RQ6LY7
ziBB?4K71J~JAbWT?H`F$hK;Au1<30(DmF+-$TPQGlL_{?WrB1Fed0YLv0pF6e)BY;
zpCUg@rFsOThh;mnyYHjf{!|XnC||)&+=G|R^3v^fwG}YC8NHSK(Z)Cp`v?1+L$pxQ
z?Ce#nA(H2k*A83f3HI3eM~VBqKm=WXnt00#{k7*?@D6dXvZtHR3PX%*FIqa3v3b~U
z?jf#w$uA`0S>d5xuG^r06Wz^kF%M;0i6d1NHyq-kCE})`(9dmPx
zuEc)DA@28s=E_UN3v!@9|H@BJPNZ@p>V|awrthEVaILIFF|qB%3hpKH{BX;ZBj
z>7T@G0I0p^4thd%eN9EG42k6>G!yOol`2edFY*0pa#|uDA6J$ZrHy!AMVYZI2Ft7Q
z?L%&&eVUv|E%Q|A3VjAfngblNzP4#|g0~+(;;cz^twP#VH>(ez6WV0QDO
z5_|hfNmByaVPbP<({hwhJtEG`kT1Q;zYqCLbsq-S-*on-#jU69l1lv#4>2ebZwXdZ(K$qe}dyf(ID
zMZGt)ju2E^a6kcoALIuPx`+dU_DmJ=DU%AV^R4
zssD$jD^(KT?jj4}-g6YTm(D`iega822WB%gM}GcsJF`*wop1eCHDrzi>Y=u=&46c`thL?Jkq8E{jbJPXf#G=?BNkN63lF@V{z4=9?
z_Z&W#9$hP_6G4@re{;7URH84
zMJcBZrHinKt|L#M!egCm+f-dYa8Zh6v(@E>5IY?aQc_m)Vq0syIY(lZMN<{L`I6bX
z4CHj?Z88%YKrO?Eo#5uhiFE3wntyf>c*0upo*#scq{H1
z<#9Buo7!IW&}7)Ruj8Y+<>vN?uD^(MAKF_jcJ*$|O0dPN_-xcK$;f9*MBp__!~`$D
zn2SAsCWWBifAZ8vc_d{@b(Xo?*CPt8!_(?%iwS~hhj}Cpl@@E8I`o!Ly@_V9^5$zh
zchfM_RjRO;w&pJ^+WRd!7F$qME#>9HD9(i5@zq05@TaIJ$f@xurNct7BooU=g!;Ud
z?Wst3O$OLLU~<#l1EU#O;vb1?PoIQ#qQ*a*>zbIF6#H1}ETrq@gsfPZ-dv1vuM)3^
z$PXufgXb(Sl=l}bTey(XW*Ry>m1-Tvxk_+Du&+l5$BQRVy^PI#iL15?HVlEd8gN9F
zuWE-O-|2vZP(>_d!N6D_yvHwNtg2U)KHY_#c%4cwDitVpJcrMtEv1`_6-|d~?3=5^
zVF=g(fBBL)copo%BP-B-xrC=G&C6xEy==hN;{lyV#o%zT=Bs$Ywrae2OR)(FP1Vp=
zWWUYbiz%+AC`yKlHN`7g5E;5$^`&m+^gs=8B1J3Yi|g*TB@yc4P@4~Vvk)-sS4IInJT3d9PgpdU1Jc6edhE3!e@)7r`p$L
zsc%&wW6tkkrzFIitK`HFsKwTO
zao}(zN=7HzqN`g=-^`9R=`7$q?0yovlx
zp48H6g+Qac+*vv#Jk&tpt6ae!lv>O-ECLMV60|4Loz7H|fU!o$
zn5U>68?MyeHJ0+<=$L-DTvwT@)&N;uG)^9u1{7{tjwxnh_O
zliw%Z`IE|e5H<8^;yI3bi#h|)F~4JXbYl|A?;RTrFWd;d)4x1wCWp>fe~xa~LYRKZE#QW6O6
zI{6|rx9k23O`#*}#>-TJY0{9BXRXFjZDYo&s3X>fNH0US`1?`v3$Gwm2yQFQtQsBOZGs2v)sCw8
zvt!H11VZgA%ZSZ|a~hsNn^sf-?|4v%02{F=qqV7fEra$nnwnb3({wXyVDu|O7bV|`
zBJVzR)@Y2`*t*3wdr_uGiOH)cxgjSTQ8;0MvqYZ
z>+toB2bCfP;01KBOP*668QmD5#kp*bV;>;SRajjYv1&yk4VZIdUDeSr~G
zD=;M=$H*6tBd@(IAvm!k1fD1%Oz`0-CP=H4C_`gB8H5a)@#eI^8nfz~z>N``V250C
z{K%0L(j9U_GJJ@4E(Yq;qw(LNN<)jzN?%{bK)kMRhx`a}F5zgOmELwvRN|~?FYVoP
zBagHt^cAS4^Lw%2OT_)Vps4f>@w;8}`;Q`1H{+uDWewNm?R^hjRxc|C=W4o+QpCk^
z$za!@RROSEX{w^t2I?xYZ~se#cga5oX;SJQ`RnU=|GwQE6r0T8xI%3zH4%}AG3U$p
zIx`X*j+u5pM->B_(Q;e$IG?1VuGc!+=Gim`h!ISNa#y*kFy=t1+3vK71$KT90Ja`u?26NhSumVNU1ThERJ=H>0|t{|p*8QjS8P{ER)|0i)QPJR!lKOe@)
z9~>KgiHLl9GV#YDgJnImvn>7z>UaCIf*idSYkG-lWDf2Gt(?%~@LGfZfFh%11p5F@
z>0y>Om;;IlfPB@m+{x%xfuRk^XSe9TRh!;{&S+>0BAXIneGE1
zLTv*KJtV()5ie`=$?NwGGGGl!N2@K(QG*VvyBBZcFn9JPCEkBQe9Q|pvIdq%K$@%c
zkery5GHNWz2ueKeYT(RuHRbii#RZU@BKi->KYo$QUa^UmJ#@*B(7d@QC(zy|nDx{#%rUW62*AFXWy~
z;QyO)G3jhYeb@G`Z8#qxUOQ{c3M)s4Y18LP{8q|eZg}BD3h@|;a_apM`0e?Ef$D;G
zLjEXf&g$55T1$9X^?7OrVdTIjoVZWQb&ba&vu9E9#CrC2^FiJglxDs?MtSF0`b)&{G0KIb
zzlX;tuaU}#lp83}=kep0s3NYb+_ryM@iMyV%_t~M>&rnd{vVNh110e#+@nl4k2Xe}
zccZJz#Z|6`apz5l|4u41sH@p7D}%r-FFJ8Je@G9(o^O;oN-Y@yNf5L~(^R2YKP&%M
zWD2;g%QsM-yIq0djdLyPJgzqnaG-KM#F&(+j0i_0A*jbG4<$oK-bBHaG2od;{&MHv
z$_ANRWqr$47)JR2kCJc(dF?#aRHYfJj2mixj!H~i&X%>g>d4~gk5eAL!T+;DV&*vI
z!B0ppQk_dnBVm26>Q>ZQ*s|i;XgVNWJlnVD&^sK(TS)W&lH*Hdl43J~IL_ng(dy8Y
zZEW?o=;1;;cdn^Jl#ICE!MSUzDsjCWR!#lNtgKrt^PNF%`xx-{7bhr3X^K4tfgE6v-r(Fw
z`SS_nH7ueNkSR6C&wJol`lC{Er{-kD4^Xq7
zv9N6q5BwYnze;5|qpQ1x!_8o^9P_%sDq|cTfjy6w(Gk(HAp_qzq!_cWtT+7vNq>=A
zKki;SY_@E4AL#dop~Q1zxdv@Ics|tBUc7pU3p&iKyIYq=ouJKQXayQe%(1?K|q!}
zI607ye3O;nQMuw(Gl2ASdYd}4Dr+hM)9v*vsyi0Kn=oo_4`hjF4M%dYbWz&YSi?#I
z@_(oBVdBC~l!qVDQm+k;?B^VYT_2(B3ghTuG%7|Ur>O4XNpBlrcHn4X!(pY>GB}U)
z5%ilVj~x5rWkdB%lvj?ue{G`ISYzNYUqxf??f_GDID^Kl
zo_`E<&+NX5rLn=<;m=W-Vt0VX*vS4b(w~g?dKTi|M*TJ%_&6qR?2DUXugg@*9>yyX1uo7Sx%d0JD)@cC$*1iOx=Gsdta6|dYDS(-_NaPy_{1yJ+Kkl+
zpEf4>3q*L$Y*0oX0b|!^w|6T-+p34qytu9EYTc4Ah~05Ir6DzqkW4J-A(_>`7;+Gt
z)gJcwvs7)yrdQS9#DP$?DRl^Bk@%SQufU_b4f2-QiPKcSwA*CZBj$er`YY>sE77fT
z?4S3i5W3qar>}nkw@@F8x#o)BMbm6~(MY>hjjbf42wOenTwBc^%*$Nna2A{3=y~UV
zfIEDBnTGY1UVuXVy_Udc_Ut6ql0X%tujVbxFuU$T*}+ZEl-gVfXP`zFTT?f~^`Mb6
z5@nleBL!<1CjoCrH>(;a7v~`rQ$`TpM^D~(9XtCWuJ^W%%OyIg1vHKi%U8!)_8d%=
zK;>mN)KyyiinC~HU2%7oi*vk_)JOT+>jrr{96o=L{+-g<$PP9C{Os`oRDaAtf;epTH~v^
z9(oVeS_)?962DPGQs7%sQ@N0~9DtJfP=~I%yv#I&9Y397+bNryXF6g~YS|{*%sJ7H
zDg{)<1iVz0jUL;*4c$7Ns41aWn6Sqmz|{*A)f#8l6a>nqdCMlJ-(85EJx$HyRIm4Y
zb8EgtCk!r`mSfU_7d<`GV;ga#?#iA(i@Ag}xDe4RL1vlz;>pvGT&61fT4o&6t*O64
zt2Pek8Ee*~J|9_btB=2w$9@MbUK3222FJF_NOIzNjPjS4NG5z{vN75%Wv_UTdTcpO
zEsBK$%>5y5>?o*bc&01gN4=)}oRU0aybiLww8?4tVMe6#4Kx^XbXCN9a^bf`6r;Qc
z_~rFel=m)YadC%C$`F*hd0(K)jZ~v*tp{QhU{0wQw6k;SX>f~+ae`OuY|&u9`G|0x
zq5w{s%v-e&+XrMTK`%AlR$=%34Hrg6L+R=s^&O~UdtuzW*0a|J`VZ6uKnbsZ
zL}VmTGJbqb;acum#R%INc4Gz&Qk1+
zBs=}z9BAV`XTX`L`veBl+3Y>Hia-t0cY_Jd1|7pgU-?OH(X;A
zC5e=xL^Uj6TN+g+TR_18btp@KuP^H}(UeFqW1o<&;
zAl^x)Jap_|R)U^PNjg);+*hcZLVZ1fBQ~8fW1zH<@m&)wp-ZNmzLYYap~^FsjyRZ7SdijnNCdVxvNlK|Vj~%#6=2bGXDII-BdHAEo}na?
z-n-Vf+2+d>=0n+oZEceFuX?eXBx=)GO}Bg5+w*H^^XoIL6-3NPPg3**X{2&}G8nc=
zE~B72x6wA%QFx?$CaqB!3ZtFHFQe_tE#1s9hW;juaQqgq8GO0zAIguj8V(*o*EkW=
zVmMuJq;!@Y+ekI#?DNQIL5D~p>ll+BjV`Og{CZ_C@fm8Y7%J5d@A!{KiRbQsNx2nr
zXAF>@
z=#*;;m?L^U28TN|Y_!l+J4OG8>bK&yp=d+*(I|1{EI2^;z$89DOF0Fi;orc(84}~#
z{P%t*y5Qc{Q0jPBfmSTzm1_vVU_`Qg8bhwc1amh}CL)uZwL7qZ+FqO`eWpX`}4gW(sx^}0Uatb>DpGb(ryD1O70tLND_hFG~sQoDQ%3hTh
zuDEkp$mwVBGOeo;G=esOYOMlgy{jiY8
zyqogi3FO%`kk6>QoALsDOoXeC-A#GtG35UDQ>qs#T#I_^G#x4j={ei(&at7_k;{)>
z>zXtT`Re7bp*i`b>7_d@AwUcKsaXq5F~9zotZ2rzYHGd%G67^&YTT};t87spGvgaV4b8~x)-aWT#ED`YJJ?->&Fn`NC+(m8b1$FQjPoAke?
zKXa{#UKd={4Lyo(7sc0N1P8*60Rd7U*mmpf8B)MlMVUE1IB();bu<^AiK)t
zt?TRO$Qj_n&D!#yB8U4s#io>6$vI`wOCBU8}Wc*Q(l=9ziE+lzSj*(2M-!f`rJrhw{(^
zq{OclcjuV)san?>Qz)D9bd0<
z+K>85)
zryqTf8NbHO&YsmRTVLOgQAp$(4?8RJGeP)<(A@`5Bni*3=2tR{(p2A~1wH&3c7Rrt
z17Qijth)7ZQe8+vT@yLw<%c6PY|>J4i$xdj@7q95D$cP6>(aJ+!}%P5RA~5p$8aG5cpIuc50&Iq#UjGM>RrT?~4-r(@y}s_09S#|88T
z{|ZLA`5Jv)P~BjixgXU|sFZ!)*&6Jg$F658|E&C_g^qKaIEd56)W#V)c+?t7*-Rd&i9jSnX-U
ze;=ScMI!x+Xn2tF*F>tjZDvMuPyh|L%wYb;LdAd-Yx1?}2`BW>B3W4R7lZ
z+1FI!!ON6~pd|9vWy-1RNX^6481R_s)w&PSp`o&ZJexv#l9YJOVO2Ow`sjZ}mm{gX
zlDY#cc+Zl$(xIL?UHXsFa`VJwk=e~WQdgZaZEwZrtVfNjK$8mAaIF)_r>7;neZ$;X
zP`&&jN~;%5?d3NzZ-pN(hV~sR`|@EZgjIQn;p-W~*)rs|i`3p`PJbU`Yvm7Ujkk3^
zs;G4x(L9us_DESp*mea~jct{ir#NLt3a!h;W?|b1{`S0s
z$YR<*(ZK%V(i*X5Ju=Hn?2>^YLZhyR43jV|suo#Bk*()(P4;rCkiSNJ|F4u=t|P((
zYFsN>t8OowxQ_b$T}z9CZR63;I;*PdXR?JMD5COQEsEW>v?1hyi&Xb^KTlF(FF1>?
z?hF}iBik`Z0c6p|^zo+o$VGH+bEmX*(jZPmwvcNB^;U6^$vuZQ_%@adb4od~^9a5>
z6(|`oNa`UgW8f02k5X6_ReWF{Zn+UC!%AHfU24>;n8%>
z7DJmhl>Qc~b_xHVH@-fSP>()%m*IsUP+mFtojTRjqCDu>YaF~2os~4}7eqSRcdtpL
zcc~T^d+GhPAlPc^s97J}0VNU8n5mFfva$*{CjprV3f0CQL)7x!cnx#2ylXYQ1}?6%
z)RB|HqfdV~&T9&Kn9-J<}_%Xsjvt?poXa|7%rF
zmXvVvjq3lGz3+^Y?5fV4TdD7@?yA1sT~%G(T^%IAd;%muU>oBHj8G$uLD+x+12z^y
z5}+p`i9saW&}lm7SeJu8KFP`eGjL&dx-k@wUIY+T)IkmMB`jGlp4TjM&ln45DIltu2kr~9IN^;Q6#p;NMXBa5C#g^)p`a&k=63F;?7PVK;g%(CVOq8}VKGg2(G9UOBzdRA-emIpe
zOT{!?pZ+?9Wa~eHK{J57A
ztf|=D>+Fr+zvaln{tI2r
zzwt$Vne&5dKCTaQqqzlzua!BZ=B@mkA5JXG&nVv?d00N{F&8%B}?C|R14El%4m
zz7Eg2wdEaM_O8a}gY`MoC_Ub2_+VRYqt9>o;Jm|x^IXTlhpE+q>g#f}AGyn#{D_|M
zpS{|PTTcu4D&JCY?
zSw)Uxvs3*plxK~GI-ssP?<70*-}xA?q3MC7tk`D#g*=@E}Uwj%_&`oW;$zuBG&r{Rt|h)`v>(usEhM)_jjsn(ov9A>*%R&)75`W
z-=5yu^`!W@{ghAe-pB0}Wxw7<#rl>16!mXH|8aWxrgp5qbi|F4Ebbjl_f%3akG|Y9
zcco?~*Keqc$fL0IxzL=Xm51eh&IN9}-4~Rmj^9c>AE@)Vt)JCDUphIY_1;@+${;6q
z-E*g18+%RVl$E&8#U;P8x9k-@!=ttHw$a0NPXBmT+n~czMn_#zIh`r#yqbz!42*gB
zMeEqrP=VJFoj&K|YF#{LgF^-$mXF+=HBJSMCD%}hTJ3rH@qTa#m$HAR;Vn+AEPU(3{FMib?U3=^LGVfOqu$8gC+p(>$rKj~Q
zvOBa_Pkhd7R;{Mz4wgL3+ScP0IhdGvM)!pzb!YZ?h80{A;iP2aM-H6#`?9AE_zSmn
zuVJso!Xth0+<;S5!b*g-GkO&4p6Yh2uYDua|1>8gC6*#p8X6mC55{MTsa(lc
zr}`vL1y9BNiZ66LU%3qT8hltBa#T1_FngH#44+p!ap9i3e)6z5-`BHbtR|{Q#m}W3
z7KJR-uTV-j%CZ*_Ff~=~)kV9qZCz7~gTtpAC!f`S(daYPxEgnyOdMtLYRKtjP09F~
zzPzS&z3C=2F*Jba$*Q!2n9A_nbA4;Hygj)p^gxblMM?KSXG$qi4QUOI(Z@aB7y2I_
zdX;$&9c~Pef15fQl^K^%b$zWbpW12NP4}JAAIOMw+KBTBZuPy@mmi%5wpFxlYYEw{
z<@fjz7wh-1Jav6(=QJ)SD3uy8u`?8SJQaM)Sjwcr7hiZ?8*9&gNZZgYF?aZs^a-ho
z4Vd+;8`!_x_ay4FcqqtCo3%?&N5KYqu8j>IA3XRP-I$Tl-IG(~ZYupdsgiB($jlF~
z*-3nZ_h@e@x+$p+qN(|ltFol%JE`!cSMF07x`+Z1!x-t`J-lY&omQP32Ni`C-fZia
zYG{H>uxH6R+1LN4R{aT8S^le3DShdcU%vU;3%`5*geEGL;(Jy6x)T&QYt7uv>JhBf1yaIcK{6{l&}A
zzxBH}U#1>$4@WAEk+M|$@*fq3F#mn@Kl1@?yZ1qDdw1F#-v5XCh4GU&^n&sv$Lh#xl3N^0`T>o2}>|NhG_zV*b9@4xWk%TK&WUkV<6`J&YL
zmDhj$^6PKCasPMEzj6Pim-RIoyggCWvXqz&ZELs0^m}hlS5r-HTfk`6@OSx^*@T%e
z*Nf8951KByRP@>_uj^YuG!lu^^HS*>uRj0Q8_&P|(kpsl(3id|MsNJ-3(-`{zWKs0
z-+K9%Z@s$~?^x0+-+bY%pHbzKcV21q=KWWG{sQ&vodMDJ`R}C9K9r)LzCHOtCo`E_
zl^xpe@O9fgo=FKU4S)Lq1FnB1Rrm5QpU^L{w}(&v%KLBp^gny~&r-?#m*4u;{nx2P
z_(wg|G9D6*!}|-iiPS*fk5^vTSEFCK4}0>~&tB2LMn4sI^m6wrn!=y|oFV8#uP>>`rXSf=;vAA#sAc~56AS0
z_ie=os{AkyiS||=6y2sjn=FX#>R48S{
zJfnW+qvXFniXMJsr6Q?-p`m>A?N8c2+@l>Cz1V0Q=@VC?3r!mz^?K{eT8D45Du-{}
zxj&jAkPgzn2CPuImlN|8ePEOU4S$vo4u8&PQ?oG~9c`?i|p+2h#1CP*EjHYFsb`}Q|j
zBcZ_a5#5jfkvsz)g`!{U-NTrTi;yoSB;3)3eVdgrrgnFDW`VJks(JZGQtpVJ`Gr7R
z@E!KcqTfA}T%$Yv4x9W@vyPHlci)~I{Z*rt-c!SUeg&gC?eE!F8Ksh4)+H}Gjjg57
z29(QWKvwzK%4w+s`;;|%XKzoxDf624sc2S1$ByH*FGRDCJx#G1^MiiHj$8Suf6o^d
zI8ApS&d*a}cw)op#P&?szw#^1r-_m2J9LAtz29N|P+7}^h@bFHv9nH@L&KL34?Oop
zvtJVGPiL6Lu#f4JG46$j4Aq@9`~EwhSWvfE6Oda#VH_ha;gRQ!yY9pV`!rk@MF$>G
z>H7qV&<3BkUu?#5VN}3femr@6&NcK@tg=5`UY$w4&hGpaKXTiW7kjx_&V2vgfnV`y
zUBc)Rk=^}sdy^H-;nhE&UGe^rppB)lqp5m^@0=?3O(+W(qSE)dRgn3GeNj+rPfv4@
z6Zk&Q-6Hpch$(7o^lk8bdhm5cBr&3^g+a3&wF^{%_K{fD?3482d~Uq!_V#Lq(q|V1
zXRXI)UhPq-_aGY8dC-M7sBcb`6FRM1@YNY-!pz4h_jexK-ceS~r?{Y3ws?Z`dfNM~19qAkO_s{DgieCHW^
z``C+!F(KXyp$%dz|-Y8J+sd(PJh8?;bwg000q_GiyVn)UU%tk8=wOu
znN76|Ma#QXIv!u$U)6P78bs0MzD*usDYN^Gr@e>QK={aB#QM{`b~K`EAhqCx27bWD
zr*I;yif(b{OFJW1!(w_U>g4FNOmEMF%*&XG0%B6fCv?AwXTf~(kw@>{ga?c+>}DlK
zFnso{XJS(4`Z;rAAAUa6)tNh=B;zBa;ubDf%dXx&zn{Q<*MfQa{R4+6?V#<$7GWKK*|6
zYki3n7E`7hk7#bAjR2aciR+}^qL|B<_}R$G;ljL{4yyINmsnC^@lt7eYT(H9H|cEF
zLR3yojA(?UTbmF@SKH|2U@XNoH*9~Nh|ZHf-`tRlswJvEal0gHD6n&t=f^6pZ{s{X
zR%rlTjzj16bBoR>+M>9
zF~q(lv1TIXK1G|4C9z+kwSUiN#3wC!cd?!LWbcHtwZoQU9W`KRFEFkraw_#Muj@~2
zYnbn@qes0x&dY{9<{OhJtzPSfM{4IS9X@}*Q)blJy7IHypqA2D3%>hmBJy^lVu#|L
z{`)!NC+Q&Z=j7jKHDz_%E~y@Qx)<&!YGOS~btzPDW>nBs{B>_`C+Ujrrh}ap*KEBO
z>`#7swl5tQg3r=iCg0#=&Q@FoT)HXKtNrezcXyvQ%Fl!kIt|MX8joC}!knVQ3diL0
z6D$6pEop4ZiS9OQ_PUu#*sM{Wc749W9LEesx^4K-En?6W#TXS>Y3%)$jh`HT8BOD!(*E}F~hXy
z?O7Jw=hy938YSKpfhm5Y%>#x!?e6nVW=3e66LgFt2mK(QdT(sZJXDPSdkiCU?yb))
zmWSq-mb*|8eD6%CcU4RjHL0+^vuB_rJS~*$+Ui+fUoB-uF;`!PuY|i~w#tim&Ba0g
z@==&?5k2d&cM~0$Fj+!zT8-yRo0|zM6ghe?f3>}9G~yut5^emz<{!(mYC=npHgua{}tXdudlpsy)u~j#l5D*)AiE)i$x00J8gHI8&3;}qeq95biQ*J
z#b;mUZ_*Myox0r=}RVxvW`P~{m(>JQ7pno=twEb#F@>ROFe|nH?
zS#zFW$}Ji0$L)L1yR(zDmu|o1J-JQ{cvfZwjnP_5
zX?2KGMJpXu*esa8(8lC9(eICk!V`B&if?|;w>P&2$7eZ|cT)wEs~s)d{j1eS(kn<{8~C#S*|h5WsfQ-S6#I5Jz8-FQ4sVw&j})(|@BGDbS(Xm>lPJ;E)G(yLXU
zc3t|_Oi-;Ei>=AGHJ)_;Kv+yiwoBZ}4AmO6?KE+e9@e))Sgfq4>t3(RIyk!?C<{9z0B`i%Pgh^`K#i$ag}zp
zDag@d{g$?&<6Sal%gaY1siOBu9-%i7ee@%}ZcL|~Zat2(E5>}v+~LMW|5O^D9m+S<$DkjD1hK2`XHU8E~wx+D-TiKBqk_I^K1vfpNVzJh@r6)wY#7
zMTbPEuL}H1C{^6!_R||@I`{CVegR+BzuV+O`?Dmq_euh<9hYv$`bgvV?}X*Lr+Df?
zZA7Q{WJ^SWQ#D2BWP29$ACP)AzgJW`+t{rOEDWJol8K$j)|~oL8po~RDBrQ{>NE)-
z>aGhMY@eE>c8$fA?C35pQohO`98_*Z&onGh;c)9@>hy}s`ltC7y2z?$?$dtyrL{WH
z<wINwcYN)4>)x*2MZs7oMWy($a5E-XI|q0+OIf$8Yclr)-tS69FDbHCm~DkZCN
zkp18$hvFG#Y9q8QmEl$Td5N!(D72fUbo_w^$K`ydC1kUtqKM&>=aPnp1LoTF1L+vI
zK@nwRPxEy>6RYdq=lu@_NB1_0zxIxC$toL+?xD+57Q#mTsw*g>@?POds=-sw&LO4@xsHmGTFdb}%^VvV)sI@a1jzNXZ?n;L{(
z96z>|kQQNzIbxPBMZlR^ZR_K%k@y%Y(^;6T2XN5
zIW$o3O*1v*xV#>ou^CSz5bM5~)m;@4M;q@O-I*>)F4g%o0&Yt=_5SHo+JED>V%GEa
z`kIT#Ijs8cnQ+ND>@3%1H??$ne3D-bXmPwL-YvBtjXFJ?ak_ZZvP>Pgo+%$lp3ZF&
zKYdr*T+V*$d-h?29mNadg*$XAGCpmjbougxaeXc&zi=UZzP^qey9cGMhqG&)Vb4BQ
za<_c`?7D|8dEh5ci{r*NDD+qre^A<(w7ldO$?-0Yr)6mgTWQZeN&%qcg2!&l%>6TBBL1Lzki-DiZAhM-(HJkzHGnXJ2d5X
zTiftAd|S=+@`zhz6r=ciDKYMJ@Z-mzgg6jLFngm$jLsM|hXr
zz>t)#h)$aD2H)kT-f54xN9j<1z;7ErkmPV~C&e2b&n%h!)lIzLD
z>poP+mWV(6T=wY7>{LZ#KOK3Z(?Vt5gMr@vARkbvLn`8C$`cpmwq|c?ubWwGk_daP
zO$)v5Uf@(z?7{U=P8!40<*IdgTj`ZF$+{o4usO`f<0hll+xye?(M*n^Zn?GT3nXp#
zt`5%I+hVq7=V%HS&k|O`DUQNk_h=jYY3953@4bPZ=H)Uyuz95ZB>rih5{tIBJXm!8
z7R^h`P(b-^#o8&wp#wHe$Y)nRdZi@ERUiM2&fi|m`b$;CQ-puV$$nlLn95o^4tR}l-
zJm#O|A2z?6c-(w4e$aWB-xOFR)U`!iJqZ53{O5EIcWHqA81t&uc#s{X^Y80}?8im&Q=53LdWcq+JksXw
zdyYIapRhlFpA*ma%f(*9SFP)jJl|E;(@|5LmPK>oIFr?KGwa%D&F@$CXCIaAmNL=z
z;;JX+ic@B~NdZ@E1e|3=&X&<6_zkUBm3wce5PmJl=qzhY+jr=siQDk4*uM;K4SI}n
z)A-Lgr{)b)wQH5VsWT-VyPxAHtGv(MCqpJl2DRyttp|>~Yq4ay97DUi$`fa3^c}BH
z(<3tvJ)h)DW76U(b#$VQ^xMru%TZT2!fxzM$9Z|h)2Q?KPx#ajH7uOFK`8fUXQTf+Yy4f-IJIqg>yWWl|
zSi8vX9VKt6Fehkhc+KZu<)8k7{bY-KbNa3~$((o8;6?4ttRHpPxBk4=Y3(SF2BFR?
zdSHF5jt&;t`!oeq-sbF|(7~!p_rc9i_PfAg9)W`cc^`GK}?
zg56Tzogea^PmO3y7^9G(%CnpDg>2X7Nf5QwlXQ%|em`EjImtr(yxjD!?oJfURP^a4
zf5s0LPE_`0)Fm@-YCkr`eoaS8>!&Qomm%g?#Zo|Watp05(Or7M1L
zHk6k4;79VOzIb=wLEwI9T;J#Uw5Iv3GOsar8qBhF_b$3$yMRJeXWIv3hjs%P)o()z
zCzcxflT$y&m*?zv_1{*8{fOF?p4uwusORjv^~uyntA;0ZqD9yd9G8^=lRmK?Y@A5
zQn5K*$Xq#FnR7LD{RrQZ-kO(xcC4pjv`%w+F6wD}zqqcMvg?wRPx88g_KV}4v?8)I
z>n$Nsv-z_r)Z|dtegE3#f)bKBXP3C6+wn4+Ds(x110jdWRdh@%X`{KiIb(=~zG8+Zwmf$9D}0)EIU+9Il5z|^ey=^i
zJtt@CVwxfV=O()*&co}*n8$UWnb#*z_|~JE%DUdfisdU;xx_-3x5EBLz+7rSy3Xzj
z=>OFlY#76|YV$T(8@2dx`-Y_Cwfc&90wtvxamVxSp0&*5;o3)jXJDpX++>v>`SQJ+
z3Xix1-?aEdLR|A(1M3ZOcy1HyLXK9m`rEfz4Fy5AhL
z!2;&rb%tl8rv)Fe)mEIdUl5p?>(0;VTnJOA{fkTbubb{4FIhtgv!H#R;k@K_b9361
zOSg{nE_vzq71~pV`x$lmM*_}Yk(K|zZJ|3k{;&AT%Lj$-aWmwRXm>j
z6(?kvY27C^oPc4fbWd7yzoU=_=efSvbni3yH~(3q)!9(nopg4#+`f=$*O`8ZdtD&6
zJ9jQEi63?MY?6QbHwvBKN4S5GF|)dvCpmKojm635xCn;%jV|Ex+?xV{=<7Pc7q|w7
zc}3g&MXvu7>cZ~fb*H2Y`QHZq)_Z>?DWP&)o5av649`4GA87Ku`3HWxYHA|1;38hE
zZTu4Vv{`oXsB`17cN*a%r{SwD=LZu_TH#&pX^TfB&n>5fc$*>VgCha+)4ughj?QK4I={*NTEz5ezx-Y9
zF4L!T`7ZaQfN9Z{evfMxGSBE7|Aku=GMT!Ue#Cv8kq19!SCipi*40}XUnO_d#k{~B
zae~MGUK{)>cS~oygJ0u*&baHCpL00^0sE>h{|)X{!6WyAYKAF0aCqtgVTgX$ys_5i
z0JC@!v^s4qR?sIm`k9E)9=O8fup?ao#({HC{Q2qyA6XiR9@E~(>oo*_8
z^DXWRLhgt5+Jd*ZkI{`|Q~Li5XbpbFeVK{Sef3w|6O7z$B&hRnb}*=ETmF+Nh0g8Q
zTnQEC=SS78hi_~h%C8m_y1)A^_gOJBul>XCxe)50*&jFqM(}Z0oyLKSWSB~=&XN0^
z+-@SaWZi!)>!3`Yx2n)xJ91wWG0*A#&XubYQAZ_S+=Pt#x;lDr&3mZQOMlAjQ}q(1
zPT>QFs-3;J@$n2R?CPaDTU_eQbj9*CzQ=xBpe!UXb0}tMk8_8I9