diff --git a/2012/zeitak/README.md b/2012/zeitak/README.md index a34b78f42..de84049c9 100644 --- a/2012/zeitak/README.md +++ b/2012/zeitak/README.md @@ -11,11 +11,12 @@ code](#alternate-code) below. ## To use: ```sh -./zeitak < file.c +./zeitak < file ``` -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. +where `file` is the file to be checked for nesting errors. For example, you may +try [incorrect.c](incorrect.c) and the program itself. You may also run it on +text files that are not code. ## Try: @@ -24,15 +25,15 @@ try [incorrect.c](incorrect.c) and the program itself. make test ``` -NOTE: it prints an error and exits on the first nesting error so it will not -detect multiple issues! +NOTE: the program prints an error and exits on the first nesting error so it +will not detect multiple issues. ## Alternate code: -This version, [zeitak.alt.c](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. +The alternate code, [zeitak.alt.c](zeitak.alt.c), is a version that was slightly +deobfuscated by the author. You may find reading it helpful in your attempt to +understand this extremely subtle entry. ### Alternate build: @@ -51,11 +52,19 @@ Use `zeitak.alt` as you would `zeitak` above. 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. +The judges spent a considerable amount of time analyzing this entry. At one point we spent [18 minutes](https://web.archive.org/web/20130925190722/https://twitter.com/ioccc/status/252162898800033792) -just to understand 18 key characters of this code. +just to understand _18 key **characters**_ of this code. + +NOTE: if you use vim to view the code, make sure to do: + +``` +:set tabstop=4 +``` + +in command mode, before looking at the code, to see the correct layout. ## Author's remarks: @@ -89,6 +98,7 @@ printf(")"); * Doesn't get confused by the [1984/anonymous](/1984/anonymous/anonymous.c) entry! + #### Mis-Features * Escapes (e.g. `\"`) are ignored, so the following line will produce diff --git a/2012/zeitak/correct.java b/2012/zeitak/correct.java new file mode 100644 index 000000000..37a2eb866 --- /dev/null +++ b/2012/zeitak/correct.java @@ -0,0 +1,5 @@ +// (( zeitak reports that this is correct but is that actually true when this is +// java? :-) ) +public static void main(String[] args) +{ +} diff --git a/2012/zeitak/incorrect.java b/2012/zeitak/incorrect.java new file mode 100644 index 000000000..00d21d4db --- /dev/null +++ b/2012/zeitak/incorrect.java @@ -0,0 +1,5 @@ +// zeitak reports that this is incorrect but is that actually surprising when +// this is java? :-) But what makes it incorrect? +public static void main(String[] args) +{ +} diff --git a/2012/zeitak/test.sh b/2012/zeitak/test.sh index 81ff65b5d..8f47f2c74 100755 --- a/2012/zeitak/test.sh +++ b/2012/zeitak/test.sh @@ -25,7 +25,7 @@ zeitak() return fi - read -r -n 1 -p "Press any key to run show $1 (space = next page, q = quit): " + read -r -n 1 -p "Press any key to show $1 (space = next page, q = quit): " echo 1>&2 less -rEXFK "$1" read -r -n 1 -p "Press any key to test $1 for nesting errors: " @@ -61,4 +61,8 @@ zeitak incorrect.1.quote.c 10 zeitak incorrect.txt 10 +zeitak incorrect.java 10 + +zeitak correct.java 3 + exit "$ERROR" diff --git a/thanks-for-help.md b/thanks-for-help.md index b31a82268..7ee2aaefa 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -3859,12 +3859,18 @@ does this for the few who might use Windows. ## [2012/zeitak](/2012/zeitak/zeitak.c) ([README.md](/2012/zeitak/README.md])) -[Cody](#cody) added the `make test` rule and the [test.sh](/2012/zeitak/test.sh) along -with a number of files that will correctly be flagged as incorrect (including -a text file to show that it's not that it parses C but rather just matching -pairs though that's probably obvious) and also some that are correct including +[Cody](#cody) [test.sh](/2012/zeitak/test.sh) script and the `make test` rule +that uses the script along with a number of files that will correctly be flagged +as incorrect (including a text file and a java file, with a joke, to show that +it's not that it parses C but rather just matching pairs though that's probably +obvious) and some correctly nested files were also added including [1984/anonymous](/1984/anonymous/README.md) (as the author explicitly mentioned -it). +it) and a java file as well with another joke. + +A minor point is that the author noted that one should +look at the program source with tab space of 4 characters so Cody added the +command to do this in vim for those who use it, in the judges' remarks, to make +it easier for those who do not know how, and to make it more obvious to try it. # 2013