Update 2012/zeitak test script + how to view code

This involves a couple java files being added to the repo both with a
joke included (to make it more fun).

The instructions of how to view the code are to make the layout correct
(at least for those who use vim (vi too? Been too long now)).

This commit will require a manifest update which will happen no later
than this weekend but it might happen sooner.
This commit is contained in:
Cody Boone Ferguson committed 2024-02-20 06:31:03 -08:00
1 parent 2ec8428ffd
commit d0e84ad655
5 files changed
+46 -16

No files matched your search

+20 -10
View File
@@ -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
+5
View File
@@ -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)
{
}
+5
View File
@@ -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)
{
}
+5 -1
View File
@@ -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"
+11 -5
View File
@@ -3859,12 +3859,18 @@ does this for the few who might use Windows.
## <a name="2012_zeitak"></a>[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.
# <a name="2013"></a>2013