diff --git a/2012/zeitak/README.md b/2012/zeitak/README.md index 5afa0331c..cd1188201 100644 --- a/2012/zeitak/README.md +++ b/2012/zeitak/README.md @@ -15,8 +15,8 @@ make ./zeitak < file.c ``` -where file.c is the file to be checked for nesting errors. For example, you may -try incorrect.c and the program itself. +where `file.c` is the file to be checked for nesting errors. For example, you may +try [incorrect.c](incorrect.c) and the program itself. ## Try: @@ -25,10 +25,13 @@ try incorrect.c and the program itself. ./zeitak < incorrect.c ``` +NOTE: it prints an error and exits on the first nesting error so it will not +detect multiple issues! + ### Alternate code -An alternate version of this entry, `zeitak.alt.c`, is provided. -The file `zeitak.alt.c` provides a version that has been slightly +An alternate version of this entry, [zeitak.alt.c](zeitak.alt.c), is provided. +The file [zeitak.alt.c](zeitak.alt.c) provides a version that has been slightly deobfuscated. You may find reading that file helpful in your attempt to understand this extremely subtle entry. @@ -40,13 +43,14 @@ make alt Use `zeitak.alt` as you would `zeitak` above. -## Judges' remarks +## Judges' remarks: 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](https://twitter.com/ioccc/status/252162898800033792) +[18 +minutes](https://web.archive.org/web/20130925190722/https://twitter.com/ioccc/status/252162898800033792) just to understand 18 key characters of this code. ## Author's remarks @@ -58,8 +62,8 @@ 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 (, [, or { has a matching closing one and -vice versa. It also checks that every " or ' is closed. +checks that every opening `(`, `[`, or `{` has a matching closing one and +vice versa. It also checks that every `"` or `'` is closed. 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 @@ -74,7 +78,7 @@ around it's position. printf(")"); -* Doesn't get confused by the 1984/anonymous entry! +* Doesn't get confused by the [1984/anonymous](/1984/anonymous/anonymous.c) entry! #### Mis-Features @@ -92,14 +96,14 @@ even more limited source, that is: * Without any digits. * Without any character constants. * Without using functions from headers other than stdio. -* Without any control-flow keywords (not even the ?: operator). +* Without any control-flow keywords (not even the `?:` operator). * Without any arithmetic or logic operators! 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. -Additional obfuscations include: +##### Additional obfuscations include: * Extensive reuse of identifiers: Macros share names with variables, inner curly braces scopes contain variables with names identical to those in the @@ -109,16 +113,15 @@ Additional obfuscations include: * Mostly one-letter identifiers. * Complex recursion: A function might call itself once, twice, or not at all. -#### Compilation/Running Notes +#### Compilation/Portability/Running Notes * The program requires `char` to be one byte and pointers to be at least two bytes long. * The program was tested on the following platforms: - -** Ubuntu 9.04 32-bit with GCC -** Windows 7 32-bit with GCC -** Windows 7 32-bit with OpenWatcom + - Ubuntu 9.04 32-bit with GCC + - Windows 7 32-bit with GCC + - Windows 7 32-bit with OpenWatcom ## Copyright and CC BY-SA 4.0 License: