From d83e53d44bff26594ae07a8a28b093d486fe0412 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 02:52:36 -0700 Subject: [PATCH 01/22] Format fixes in 1990/theorem/README.md --- 1990/theorem/README.md | 69 +++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/1990/theorem/README.md b/1990/theorem/README.md index 7353b46b2..042a74cc7 100644 --- a/1990/theorem/README.md +++ b/1990/theorem/README.md @@ -9,7 +9,9 @@ USA ## To build: - make all +```sh +make all +``` [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed some bugs that impacted the usability of this program including some segfaults under modern @@ -32,7 +34,9 @@ initially. Thank you Yusuke! ## To run: - ./theorem expression x1 x2 h y1 +```sh +./theorem expression x1 x2 h y1 +``` where: @@ -46,8 +50,9 @@ NOTE: this entry will segfault on no arg specified. ## Try: - ./theorem y 0 1 0.1 1 - +```sh +./theorem y 0 1 0.1 1 +``` ## Judges' comments: @@ -70,54 +75,62 @@ left to right. (i.e., parenthesis aren't supported). Try running the program with the following args: - ./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 +```sh +./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 +``` But wait, there is more! You also get, free of charge, a reversing filter! Try: - ./theorem -r 0 0 0 0 < theorem.c > sorter.c +```sh +./theorem -r 0 0 0 0 < theorem.c > sorter.c +``` Still not impressed? The author throws in for free, a sort program! Try: - make sorter - ls | ./sorter +```sh +make sorter +ls | ./sorter +``` This program is safe for home use as well. The author has included a safety feature in case you misplace the original program source: - ./sorter -r 0 0 0 0 < sorter.c > theorem_bkp.c +```sh +./sorter -r 0 0 0 0 < sorter.c > theorem_bkp.c +``` And finally, as a special offer to users of this entry, the author provides a Fibonacci sequence generator! Try: - ./sorter 0 0 0 0 < theorem.c > fibonacci.c - make fibonacci - ./fibonacci 1 1 - ./fibonacci 2 1 +```sh +./sorter 0 0 0 0 < theorem.c > fibonacci.c +make fibonacci +./fibonacci 1 1 +./fibonacci 2 1 +``` -Program available 9 track and cartridge cassette. Gensu knife -not included! :-) +Program available on 9 track and cartridge cassette. Neither [Ginsu +knife](https://ginsu.com) nor [Swiss army +knife](https://en.wikipedia.org/wiki/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. +When this program was first shown at the 1990 Summer Usenix conference, it +received a standing ovation; a first for a contest entry. +## Author's comments: - -## Author's comments - -Differential equations are solved via the Runge-Kutta method, -which guarantees local error proportional to h^5, and total -error across a finite interval is at most a constant times h^4. +Differential equations are solved via the Runge-Kutta method, which guarantees +local error proportional to h^5, and total error across a finite interval is at +most a constant times `h^4`. 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. +Note that the sorting and reversing is limited to files with fewer than 500 +lines, each less than 99 characters long. ## Copyright and CC BY-SA 4.0 License: From 9b07c646f7cabd77f3f4cd20c60ae4b288f66b8c Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 03:54:01 -0700 Subject: [PATCH 02/22] Minor fixes + alt code in 1990/baruch Fixed formatting in README.md. Add alt code based on authors' suggestion except that the string replacement was not done because it seems like the output would be not better but worse. There's a joke in the alternate code section of the README.md file. --- 1990/baruch/Makefile | 4 +- 1990/baruch/README.md | 110 ++++++++++++++++++++++++++---------------- 1990/baruch/baruch.c | 2 +- 3 files changed, 72 insertions(+), 44 deletions(-) diff --git a/1990/baruch/Makefile b/1990/baruch/Makefile index 4b33d242c..90662dd69 100644 --- a/1990/baruch/Makefile +++ b/1990/baruch/Makefile @@ -112,8 +112,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= -ALT_TARGET= +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt ################# diff --git a/1990/baruch/README.md b/1990/baruch/README.md index 7a2dbc5a7..0962343c9 100644 --- a/1990/baruch/README.md +++ b/1990/baruch/README.md @@ -1,25 +1,59 @@ # Best Small Program - Doron Osovlanski - CADTECH - CAD/CAM Systems Ltd - 24 Ben-Yosef st. - Givat-Shmuel 51905 - Israel +Baruch Nissenbaum +Tel-Aviv University +The Faculty of Engineering +Tel-Aviv +Israel - Baruch Nissenbaum - Tel-Aviv University - The Faculty of Engineering - Tel-Aviv - Israel +Doron Osovlanski +CADTECH - CAD/CAM Systems Ltd +24 Ben-Yosef st. +Givat-Shmuel 51905 +Israel ## To build: - make all +```sh +make all +``` ## To run: - echo 4 | ./baruch - echo 7 | ./baruch +```sh +echo 4 | ./baruch +echo 7 | ./baruch +``` + +## Try: + +```sh +echo 2 | ./baruch +echo 3 | ./baruch +``` + +Why is there no output? + +### Alternate code: + +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) provided alternate code +for users using Turbo-C or MSC, based on the authors' comments below, except +that he did not change the `" #Q"` string as that showed worse looking output +instead of improved output though he has no way to test the compilers in +question. YMMV. Thank you Cody (though we all think [no +one](https://en.wiktionary.org/wiki/no_one#Pronoun) [very +few](https://en.wikipedia.org/wiki/0) +[users](https://en.wikipedia.org/wiki/Microsoft_Windows) +[here](https://www.ioccc.org) will need it :-) )! + +To compile: + +```sh +make alt +``` + +Use `baruch.alt` as you would `baruch`. + ## Judges' comments: @@ -30,44 +64,38 @@ added a final newline to the file to make unpacking easy. ## Authors' comments: -The goal of this work was to write a program that solves the -classic n-queen problem, with a board size of up to 99x99, while -keeping the program as short as possible. +The goal of this work was to write a program that solves the classic [n-queens +problem](https://en.wikipedia.org/wiki/Eight_queens_puzzle), 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 -a NxN chess board 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. +The program finds all possibilities to place N chess queens on a NxN +[chessboard](https://en.wikipedia.org/wiki/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: -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: - - No pre-processor statements - Only one, harmless, 'for' statement - No ifs - No breaks - No cases - No functions - No gotos - No structures - -In short, it contains no C language that might confuse the -innocent reader. :-) +- No pre-processor statements +- Only one, harmless, `for` statement +- No `if`s +- No `break`s +- No `case`s +- No functions outside the standard C library +- No `goto`s +- No structures +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.. -The authors' further note: +### For PC users: -For PC users: - -In order to compile the program under Turbo-C or MSC, '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". +In order to compile the program under Turbo-C or MSC, `'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: diff --git a/1990/baruch/baruch.c b/1990/baruch/baruch.c index 0399573f5..f019780c1 100644 --- a/1990/baruch/baruch.c +++ b/1990/baruch/baruch.c @@ -2,5 +2,5 @@ int v,i,j,k,l,s,a[99]; main() { for(scanf("%d",&s);*a-s;v=a[j*=v]-a[i],k=i=s*k&&++a[--i]) - ; + ;puts(""); } From d74114182d423c7ea9991d314e80c480b5331fa3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 03:57:31 -0700 Subject: [PATCH 03/22] Add readme.html to top level .gitignore + sort it The rationale behind it is that it's useful to sometimes use discount (or rdiscount) to test that the README.md file formatting is correct but readme.html is the obvious target file. This glob can be removed at a later date. Sort .gitignore file. --- .gitignore | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 2425d9218..d2d2f13bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,12 @@ -.*.sw[a-z] -.sw[a-z] -.sv[a-z] -.*.sv[a-z] -*.dSYM *.bak *.bku +*.dSYM +.*.sv[a-z] +.*.sw[a-z] .DS_Store +.sv[a-z] +.sw[a-z] +/NOTES /archive/1984/ /archive/1985/ /archive/1986/ @@ -35,6 +36,6 @@ /archive/2020/ /bugs.html /faq.html -mkentry -/NOTES iocccsize +mkentry +readme.html From a42e1c6515608e7f9f1ccddaf6a24d518489c4c9 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:00:46 -0700 Subject: [PATCH 04/22] Remove unreferenced 1990/cmills.alt.c As discussed on GitHub this is rarely needed for gets() to fgets() change (which again is useful - but problematic either way - to prevent warnings during compile, linking or execution of the program sometimes, including with this entry, output interspersed with the program's output). There was no need to modify the Makefile as the alt target was already not defined. BTW: if the compiler compiles, the linker links and the user executes does that make the compiler the jury, the linker the judge and user the executioner? :-) --- 1990/cmills/cmills.alt.c | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 1990/cmills/cmills.alt.c diff --git a/1990/cmills/cmills.alt.c b/1990/cmills/cmills.alt.c deleted file mode 100644 index 8a9b25641..000000000 --- a/1990/cmills/cmills.alt.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#define S(q)B(*e=0),q,p); -#define W(w)if((w)<22)v= -v;else v-=10;else -#define F for(r=d;r1;){if(r-d>N*3/4){B(8));F++r)*r=c[(r-d)%13];F)w= -*(g=d+rand()%N),*g= -*r,*r++=w;r=d;}for(;;){B(3),y);if(!gets(l)||(w=atoi(l))<1)exit(0);if(w&1||w>M||w>y)B(1),y=w/2&&u(5)&&(y+=(3*(h(0,1[q])==10)-1)*w/2);if(x==-21)goto -_;if(v==-21){y+=w/2;goto -_;}while(x>-17&&x<17)H(x,g)while((v==20||*p==-1[e])&&y>=w&&u(6)){y-=w;++s;for(g=e++;2[g]= -*g,g!=p;)--g;*g++= -*e;*g=' ';i:v=h(h(0,*p),*e++= -*r++);S(t)if(*p=='A'&&-1[e]!= -*p)goto -_;}if(f=y>=w&&u(7))y-=w,H(v,e)while(!f&&v<22&&u(4)){H(v,e)if(v<22)S(t)}_:x<0&&(x= --x);v<0&&(v= --v);if(v<22)if(v==x)j+=w*++f;else -if(x>21||v>x)j+=w*2*++f;if(s--){*e++=' ';*e++= -*p;*e=0;for(e=p;*e=2[e];)e++;goto -i;}y+=j;S(q)};} From 7c3f59b63381800f27a45c099a9336ac470f7f11 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:08:41 -0700 Subject: [PATCH 05/22] Format fixes in 1990/cmills/README.md --- 1990/cmills/README.md | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/1990/cmills/README.md b/1990/cmills/README.md index de3f4b89e..c85d7215a 100644 --- a/1990/cmills/README.md +++ b/1990/cmills/README.md @@ -1,10 +1,10 @@ # Best Game - Chris Mills - Wyse Technology - 3471 N. 1st St. - San Jose CA 95134 - USA +Chris Mills +Wyse Technology +3471 N. 1st St. +San Jose CA 95134 +USA ## To build: @@ -24,7 +24,7 @@ for your assistance! [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this safer by using `fgets()` instead of `gets()`. This avoids a potentially alarming warning -at linking or runtime. Thank you Cody for your assistance! +at compiling and/or linking and/or runtime. Thank you Cody for your assistance! For the original code see the [1992 archive](/archive/archive-1990.tar.bz2). @@ -42,29 +42,25 @@ For the original code see the [1992 archive](/archive/archive-1990.tar.bz2). The Makefile uses several `-D` defines. The following is is a list of the macros that may be changed: - -DM= - -DN=<52 * number of decks used> - -DX= +- `-DM=` +- `-DN=<52 * number of decks used>` +- `-DX=` The macro `V` should remain `void`. ## Author's comments: -This is a blackjack program. It does splits, doubling down, -insurance, etc. +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 `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. +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 `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. -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. +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. ## Copyright and CC BY-SA 4.0 License: From 5fd9d73306905c7f1d017f374c446f327481d3b0 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:20:29 -0700 Subject: [PATCH 06/22] Update faq.md with more recent developments Since fixes can be made via GitHub pull requests I updated the question about finding bugs in entries, making sure to note that just because someone has a fix does not mean that it'll be accepted (in fact I kind of feel guilty about the fixes I have made except for entries that no longer worked for one of the reasons noted in the FAQ entry). --- faq.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/faq.md b/faq.md index 169aee2f1..e8dcf2ce8 100644 --- a/faq.md +++ b/faq.md @@ -151,23 +151,29 @@ eval "$(/opt/homebrew/bin/brew shellenv)" ## Q: How did entry XYZZY win? It breaks rule 2! As entries have been fixed it is entirely possible that some of the entries no -longer fit within the year's size restrictions. For the original version see the -[/archive](/archive) directory where you can find all the original winning -entries. +longer fit within the year's size restrictions. Invariably the length of columns +and number of rows might also be changed. + +For the original version see the [/archive](/archive) directory where you can +find all the original winning entries. ## Q: I found a bug in a previous winner, what should I do? -We do not 'maintain' the contest winners. The code is made available on an 'AS -IS' basis. If you have a FIX for a entry, we suggest that you try and email it -to the authors and to CC: us using the instructions on the [contacting the IOCCC -Judges](contact.hml) page. +We do not 'maintain' the contest winners as such. The code is made available on an 'AS +IS' basis. If you have a FIX for an entry, we suggest that you try and email it +to the authors and to submit your fixes in a [GitHub pull +request](https://github.com/ioccc-src/temp-test-ioccc/pulls) (with ONE PULL +REQUEST *PER* FIX, please!). -IF you have a FIX, and IF the author does not object, and IF your fix looks -reasonable, we will add a web link to a copy of your email for others to see. +Note that just because you have a fix does not mean it'll be accepted. This +might be because the author objects or it doesn't fit in some way or another. Of +course if the entry does not work we'll certainly be more inclined to accept the +fix. If it is accepted we'll be happy to credit you in the entry's _README.md_ +file. If you're a previous winner we will happily link to your entries; if +you're not we can link to your website if you wish. ## Q: Are there types of entries that are submitted so frequently that the judges get tired of them? - Yes, there are types of entries that show up over and over again. The [guidelines](guidelines.html) say: From 846ff351e045fe08fb78bbc2cda4a1c31d73a91a Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:40:09 -0700 Subject: [PATCH 07/22] Typo fix in bugs.md --- bugs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bugs.md b/bugs.md index fad952958..0d559c05b 100644 --- a/bugs.md +++ b/bugs.md @@ -11,7 +11,7 @@ The following is a known list of **BUGS and (mis)FEATURES** in IOCCC winners. Can you fix/improve entries not under the INABIAF (it's not a bug it's a feature)? You are **VERY WELCOME** to try. -Please submit your fixes fix in a [GitHub pull +Please submit your fixes in a [GitHub pull request](https://github.com/ioccc-src/temp-test-ioccc/pulls) (with ONE PULL REQUEST *PER* FIX, please)! From 081876e6623be88fce8972f02b18cca179687957 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:43:18 -0700 Subject: [PATCH 08/22] Minor fixes in 1990/dds/README.md Format fixes in README.md including making unordered lists to make the rendered content easier to read and follow. I've also become aware of a problem with the way the author formatting was done in recent days in the README.md files that now have to all be fixed: there needs to be spaces after each line or else the author information will be one line which is definitely wrong. I think the only one I got this right is, ironically or not :-), my own entries, namely because I wanted to make sure that they looked okay (I did 'make sure' that some of the others did too but that was to changes that I was unsure of .. ironically leaving out one I should have known but probably just forgot). Thus many pull requests will be made unless I do it in a mass fix which I suppose is possible to save time. --- 1990/dds/README.md | 130 ++++++++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 60 deletions(-) diff --git a/1990/dds/README.md b/1990/dds/README.md index 3fbe8b5a5..02dc02511 100644 --- a/1990/dds/README.md +++ b/1990/dds/README.md @@ -1,10 +1,10 @@ # Best Language Tool - Diomidis Spinellis - Imperial College, University of London - Myrsinis 1 - GR-145 62 Kifissia - Greece +Diomidis Spinellis +Imperial College, University of London +Myrsinis 1 +GR-145 62 Kifissia +Greece ## To build: @@ -16,26 +16,28 @@ you Yusuke! [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) removed the erroneous prototype to `fopen()` and made this use `fgets()` instead of `gets()` to make -it safer and to prevent a potentially alarming warning at linking or runtime. -Thank you Cody for your assistance! +it safer and to prevent a potentially alarming warning at compiling and/or +linking and/or runtime. Thank you Cody for your assistance! ## To run - ./dds - +```sh +./dds +``` ## Try: Give the following lines as input: - - OLD LANDER.BAS - RUN + +``` +OLD LANDER.BAS +RUN +``` NOTE: this is case sensitive. ## Judges' comments: - Be sure not to run out of fuel! @@ -43,40 +45,53 @@ Be sure not to run out of fuel! This is the DDS-BASIC Interpreter (Version 1.00). -Immediate commands: +### Immediate commands: - RUN LIST NEW OLD filename - BYE SAVE filename +- RUN +- LIST +- NEW +- OLD filename +- BYE +- SAVE filename -Program commands: +### Program commands: - variable names a to z variables initialized to 0 on RUN - FOR var = exp TO exp NEXT variable - GOSUB exp RETURN - GOTO exp IF exp THEN exp - INPUT variable PRINT string - PRINT exp var = exp - REM any text END +- variable names a to z +- variables initialized to 0 on RUN +- FOR var = exp TO exp +- NEXT variable +- GOSUB exp +- RETURN +- GOTO exp +- IF exp THEN exp +- INPUT variable +- PRINT string +- PRINT exp +- var = exp +- REM any text +- END -Expressions (ranked by precedence): +### Expressions (ranked by precedence): - Bracketed expressions - number (leading 0 for octal, 0x for hex, else decimal), variable - Unary - - * / - + - - = <> - > < - <= >= - (* and + are also used for boolean AND and boolean OR) - Boolean expressions evaluate to 0 for false and 1 for true +- Bracketed expressions +- number (leading 0 for octal, 0x for hex, else decimal), variable +- Unary - +- `*` `/` +- `+` `-` +- `=` `<>` +- `>` `<` +- `<=` `>=` -Editing: +(`*` and `+` are also used for boolean AND and boolean OR) + +Boolean expressions evaluate to 0 for false and 1 for true. + +### Editing: - Line editor using line re-entry. - A line number with nothing following it, deletes the line. -Input format: +### Input format: - Free format positioning of tokens on the line. - No space is allowed before the line number. @@ -85,38 +100,33 @@ Input format: - ALL INPUT MUST BE UPPERCASE. -Limits: +### Limits: - Line numbers 1-10000 - Line length 999 characters - FOR nesting 26 - GOSUB 999 levels - Program Dynamically allocated - Expressions -32768 - 32767 for 16 bit machines, - -2147483648 - 2147483647 for 32 bit machines - -Error checking / error reports: +- Line numbers 1-10000 +- Line length 999 characters +- FOR nesting 26 +- GOSUB 999 levels +- Program Dynamically allocated +- Expressions -32768 - 32767 for 16 bit machines, -2147483648 - 2147483647 for 32 bit machines +### Error checking / error reports: No error checking is performed. It might dump core if a syntax or semantic error is encountered. +### Hosting Environment: -Hosting Environment: +ANSI C, traditional K&R C or OSF ANDF ASCII or EBCIDIC character set 48K bytes +memory. - 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 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 -80*25 screen). +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 `80*25` screen). ## Copyright and CC BY-SA 4.0 License: From 510963f2edacfc05c02d79e3178257c45a387a87 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:51:37 -0700 Subject: [PATCH 09/22] Authors format fix in 1990/baruch/README.md Each line of author information has to end with spaces or else the author information will be on a line by itself. --- 1990/baruch/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/1990/baruch/README.md b/1990/baruch/README.md index 0962343c9..f6f2bbc4d 100644 --- a/1990/baruch/README.md +++ b/1990/baruch/README.md @@ -1,16 +1,16 @@ # Best Small Program -Baruch Nissenbaum -Tel-Aviv University -The Faculty of Engineering -Tel-Aviv -Israel +Baruch Nissenbaum +Tel-Aviv University +The Faculty of Engineering +Tel-Aviv +Israel -Doron Osovlanski -CADTECH - CAD/CAM Systems Ltd -24 Ben-Yosef st. -Givat-Shmuel 51905 -Israel +Doron Osovlanski +CADTECH - CAD/CAM Systems Ltd +24 Ben-Yosef St. +Givat-Shmuel 51905 +Israel ## To build: From 138764caf8f6529cffc174dce92081800e6fecb5 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:57:53 -0700 Subject: [PATCH 10/22] Author format fix in 1990/cmills/README.md Each line of author information has to end with spaces or else the author information will be on a line by itself. --- 1990/cmills/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/1990/cmills/README.md b/1990/cmills/README.md index c85d7215a..84b67218a 100644 --- a/1990/cmills/README.md +++ b/1990/cmills/README.md @@ -1,10 +1,10 @@ # Best Game -Chris Mills -Wyse Technology -3471 N. 1st St. -San Jose CA 95134 -USA +Chris Mills +Wyse Technology +3471 N. 1st St. +San Jose CA 95134 +USA ## To build: From 8ba53b5eb458c462cb39296c8edc5402988a3f07 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:00:24 -0700 Subject: [PATCH 11/22] Format fixes in 1990/dg/README.md --- 1990/dg/README.md | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/1990/dg/README.md b/1990/dg/README.md index 760db4173..6d8476e53 100644 --- a/1990/dg/README.md +++ b/1990/dg/README.md @@ -1,44 +1,53 @@ # Best Abuse of the C Preprocessor - David Goodenough - anonymous organization - 541 Commonwealth Ave, - Newton, MA 02159 - USA +David Goodenough +anonymous organization +541 Commonwealth Ave +Newton, MA 02159 +USA ## To build: - make all +```sh +make all +``` ## To run: - echo foo bar | ./dg +```sh +echo foo bar | ./dg +``` ## Try: - echo "to C or not to C" | ./dg +```sh +echo "to C or not to C" | ./dg +``` ## Judges' comments: Some C preprocessors got confused about single quotes in certain cases. In particular, the following source line: - b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A)))))))))))))))))))))))))))))) +```c +b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A)))))))))))))))))))))))))))))) +``` sometimes has to be changed to: - b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A')))))))))))))))))))))))))))) +```c +b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A')))))))))))))))))))))))))))) +``` -if the C preprocessor botches single quotes in cpp expansions, which we have -done for the wider audience. +particularly if the C preprocessor botches single quotes in cpp expansions, +which we have done for the wider audience. ## Author's comments: -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". +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". Spoiler: (rot13 to read) From a3bb267ec0c7b92f05cd2e5146b5c8459b258108 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:10:17 -0700 Subject: [PATCH 12/22] Format fixes in 1990/jaw/README.md I did not check for typos and I believe I only fixed one. I will look for typos at a later time. --- 1990/jaw/README.md | 184 +++++++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 90 deletions(-) diff --git a/1990/jaw/README.md b/1990/jaw/README.md index 3a9dce5f5..28dc81a81 100644 --- a/1990/jaw/README.md +++ b/1990/jaw/README.md @@ -1,28 +1,29 @@ # Best Entropy-reducer - James A. Woods - Research Institute for Advanced Computer Science - MS 230-5 - NASA Ames Research Center - Moffett Field, CA 94131 - USA +James A. Woods +Research Institute for Advanced Computer Science +MS 230-5 +NASA Ames Research Center +Moffett Field, CA 94131 +USA - Karl F. Fox - Morning Star Technologies, Inc. - 1760 Zollinger Road - Columbus, OH 43221 - USA +Karl F. Fox +Morning Star Technologies, Inc. +1760 Zollinger Road +Columbus, OH 43221 +USA - Paul Eggert - Twin Sun Inc. - 360 N. Sepulveda Blvd. #2055 - El Segundo, CA 90245 - USA +Paul Eggert +Twin Sun Inc. +360 N. Sepulveda Blvd. #2055 +El Segundo, CA 90245 +USA ## To build: - make all - +```sh +make all +``` [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed the script to work properly in modern environments (to do with PATH not having '.' in it). He @@ -40,14 +41,15 @@ Endoh](/winners.html#Yusuke_Endoh). Thank you Yusuke for your implementation of To test the official C entry, one might try: - echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw +```sh +echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw +``` -which should apply the identity transformation to a minimal -holoalphabetic sentence. +which should apply the identity transformation to a minimal holoalphabetic +sentence. -NOTE: Cody notes the above will not work under macOS. The `sh shark.sh jaw.* -README.md > receive` and following commands below do work with macOS after the -fixes he made. +Cody noted the above will not work under macOS. The commands in the judges' +comments do work in macOS after the fixes he made. ## Judges' comments: @@ -55,19 +57,21 @@ fixes he made. The program, in its base form, implements two useful utilities: - atob - ascii to binary conversion - zcat - decompression filter -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 'jaw.c' embedded -within it! +- `atob` - ascii to binary conversion +- `zcat` - decompression filter + +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 'jaw.c' embedded within it! The sender must have `compress` and `btoa`. To send, try: - sh shark.sh jaw.* README.md > receive +```sh +sh shark.sh jaw.* README.md > receive +``` -The resulting file, 'receive', unpacks the input files +The resulting file, `receive`, unpacks the input files even if the receiver lacks `uncompress` and `btoa`: mkdir -p test @@ -78,7 +82,7 @@ even if the receiver lacks `uncompress` and `btoa`: ## Authors' comments: - ABSTRACT +### ABSTRACT Minimal, Universal File Bundling (or, Functional Obfuscation in a Self-Decoding Unix Shell Archive) @@ -92,63 +96,63 @@ even if the receiver lacks `uncompress` and `btoa`: [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 over- -come by planting a novel Trojan Horse in the archive header -to perform negotiation-less decoding. +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 over- +come 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 (un)bundler 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 ('compress' or 'squeeze') and an efficient bit packet- izer ('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'. +Specifically, we outline the development of an extraordinarily compact portable +(un)bundler 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 ('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 lines (or -~1100 bytes), commensurate with the size of many Internet mail headers; it +`shark` procedure overhead consumes as few as three dozen shell lines (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. -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. +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-- - And he shows them pearly white - Just a jackknife has Macheath, dear-- - And he keeps it out of sight. +> Oh, the shark has pretty teeth, dear-- +> And he shows them pearly white +> Just a jackknife has Macheath, dear-- +> And he keeps it out of sight. - [Bertolt Brecht, Threepenny Opera] +> [Bertolt Brecht, Threepenny Opera] ---------------------------------------------- +### Portability: + We have ported this program to a wide variety of systems. Among these are: - SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1') - SunOS 4.0.3 / Sun 3 - BSD 4.3 / VAX 8650 - SEIUX / Sumitomo Electric Ustation/S - Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD) - System V.? / Hitachi 2050 - System V.? / NEC EWS 4800 - UNIOS-B / Omron Luna - Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36') - Unicos / Cray 2 +- SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1') +- SunOS 4.0.3 / Sun 3 +- BSD 4.3 / VAX 8650 +- SEIUX / Sumitomo Electric Ustation/S +- Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD) +- System V.? / Hitachi 2050 +- System V.? / NEC EWS 4800 +- UNIOS-B / Omron Luna +- Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36') +- Unicos / Cray 2 + +### Obfuscation: We (the authors) feel this program is obfuscated for the following reasons: @@ -172,32 +176,32 @@ preserved at amazing cost for sheer perversity. 5. Many, many micro obfuscations below, honed over three years time, in shell as well as C. Ask about the 'tar' pit escape, the argv[0] flip, Paul's &4294967295 portability hack, the "void where prohibited by flaw" fix, the scanf() -spacesaver, shift shenanigans, signal madness, exit()ing stage left, and +space-saver, shift shenanigans, signal madness, `exit()`ing stage left, and source-to-source transformations galore. -For extra credit: +### For extra credit: Construct '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. - ------------------------ cut here for sharkmail ----------------------- - #!/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$$* - ------------------------ end of sharkmail ----------------------------- +```sh +#!/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: +### Shark history: May 1987: Karl Fox introduces 1023-byte zcat.c to USENET. It's too late for the 4th IOCCC. From bcac0596bbdb3e73bf998f07cb81d01ba6ebdc87 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:20:10 -0700 Subject: [PATCH 13/22] Add todo.md at top level This is because there have been many things numerous times where I should have noted what still needs to be done but did not. This allows me to update the list too. There can be a second list of what's done or else the list of things to do / check / fix can have sub-lists under entries of those already done. For instance under the entry checking formatting of all README.md files it might be good to have a list of years already checked. I've done a few but many more need to be done. Hopefully this list will be updated in time. This file can be deleted prior to the repo being merged into the winners repo. --- todo.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 todo.md diff --git a/todo.md b/todo.md new file mode 100644 index 000000000..36b3a86e3 --- /dev/null +++ b/todo.md @@ -0,0 +1,24 @@ +# A todo list of known things to check and/or do +*Last updated: Sun 9 Apr 2023 05:12:09 PDT* + +More things will likely be added over time and as items are done they _should +be_ removed from the list IF AND ONLY IF (!!) we are certain it is done (many +times it's thought that this was done only to find out that they are not). It is +hoped that this will be referenced and updated as this is an easy way to keep +track of things that have been done already and what have not been done (mostly +not been done). + +- Find entries with bugs and INABIAF and add to [bugs.md](/bugs.md). +- Resolve as many of the issues in [bugs.md](/bugs.md) with the exception of the +INABIAF ones. This is likely not possible but some certainly can be fixed. +- Check for typos in [1990/jaw/README.md](/1990/jaw/README.md). Many other +README.md files have to be checked for typos as well. +- Verify which README.md files have not been checked for correct formatting and +fix any issues. + + * This includes author information: not only at first column but making sure + that the lines end with spaces so that the rendered output does not end up + on one line only. + * [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) has done many and + has some kind of record of what he's done but these can be added later by + having a list of years to check. From ebd000e60c3a9f5e4c0b4db102f7b50895536d73 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:25:14 -0700 Subject: [PATCH 14/22] Fixes in 1990/pjr/README.md Format fixes. Remove judges' rot13 spoilers (or rather decipher it) since Landon told me gone are the days of spoilers. He also told me that the eventual website will have a button to click to decipher the rot13 spoilers but I'm keeping rot13 content from authors at least for now. --- 1990/pjr/README.md | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/1990/pjr/README.md b/1990/pjr/README.md index 2b1d2f5fc..7e3673135 100644 --- a/1990/pjr/README.md +++ b/1990/pjr/README.md @@ -1,20 +1,24 @@ # Most Unusual Data Structure - Peter J Ruczynski. - Pyramid Technology Ltd. - Pyramid House, - Solatron Road - Farnborough. - Hants GU14 7PL - England, U.K. +Peter J Ruczynski +Pyramid Technology Ltd. +Pyramid House +Solatron Road +Farnborough +Hants GU14 7PL +England, U.K. ## To build: - make all +```sh +make all +``` ## To run: - ./pjr +```sh +./pjr +``` ## Judges' comments: @@ -24,26 +28,28 @@ it is done? By use of pointers to functions returning a struct of pointers to functions! -Note that some compilers will be unable to compile the -expression 'X=g()...' in main due to lack of temporary -stack space. One might want to try replacing main with: +Note that some compilers will be unable to compile the expression `X=g()...` in +main() due to lack of temporary stack space. One might want to try replacing +main with: + +```c +main(){X=s().v().o().o().l().S().d().l().i().o().w().N();} +``` - main(){X=s().v().o().o().l().S().d().l().i().o().w().N();} - if this is a problem. -Spoiler: (rot13 to read) +### Spoiler: - Guvf cebtenz cevagf bhg gur fgevat: +This program prints out the string: - gur dhvpx oebja sbk whzcrq bire gur ynml qbt +> the quick brown fox jumped over the lazy dog - ol hfr bs cbvagref gb shapgvbaf ergheavat n fgehpg bs cbvagref - gb shapgvbaf! +by use of pointers to functions returning a struct of pointers +to functions! -## Author's comments +## Author's comments: Vg vf fvzcyr gb znxr gur cebtenz cevag bgure fgevatf. Rnpu nycunorgvpny punenpgre sebz n gb m vf cevagrq bhg nf vgf From a9d9250afbdd91937ccd88d5b32ee4d47d560762 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:32:07 -0700 Subject: [PATCH 15/22] Format fixes in 1990/scjones/README.md This includes moving from the author's comments the note from the judges that he had sent a note to the judges asking something about the award title along with the judges' reply. It seemed like the more appropriate place to have it. --- 1990/scjones/README.md | 86 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/1990/scjones/README.md b/1990/scjones/README.md index 96fe0fe36..1772bb1c4 100644 --- a/1990/scjones/README.md +++ b/1990/scjones/README.md @@ -1,23 +1,26 @@ # ANSI Committee's Worst Abuse of C - Larry Jones - SDRC - 2000 Eastman Dr - Milford, OH 45150 - USA +Larry Jones +SDRC +2000 Eastman Dr +Milford, OH 45150 +USA ## To build: - make all +```sh +make all +``` Modern compilers failed to compile this entry: - scjones.c:1:7: error: expected ';' after top level declarator - char*a??(??)=??< - ^ - ; - +```c +scjones.c:1:7: error: expected ';' after top level declarator +char*a??(??)=??< + ^ + ; +``` but we were able to get it to compile with modern compilers by specifying the `-ansi` flag with a tip from [Yusuke Endoh](/winners.html#Yusuke_Endoh). Thank @@ -29,43 +32,42 @@ compiler option `-trigraphs` would also have worked. ## To run: - ./scjones +```sh +./scjones +``` ## Judges' comments: -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 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. + ## Author's comments: -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, #includes the relevant -headers for the functions it uses, and 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 :-). - -[[ 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 `#include`s 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: From 88257dc77787d55b42964c747129105e7624c528 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:36:48 -0700 Subject: [PATCH 16/22] Format and typo fixes in 1990/stig/README.md --- 1990/stig/README.md | 60 ++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/1990/stig/README.md b/1990/stig/README.md index b82484aae..4f6d90a53 100644 --- a/1990/stig/README.md +++ b/1990/stig/README.md @@ -1,55 +1,55 @@ # Strangest Abuse of the Rules - Stig Hemmer - Norwegian Institute of Technology - N-7034 Trondheim-NTH - Norway +Stig Hemmer +Norwegian Institute of Technology +N-7034 Trondheim-NTH +Norway ## To build: - make all +```sh +make all +``` -## To run +## To run: - make all +```sh +make all +``` NOTE: that's not a typo or mistake but one can also do: - ./o +```sh +./o +``` ## Judges' comments We changed the alias that the author's suggested alias from a C-shell alias to a zsh alias. -Note that shst.c is renamed to stig.c in the distribution. +Note that `shst.c` is renamed to [stig.c](stig.c) in the distribution. -WARNING: This program's 'how to compile' is too specific to a particular -shell. The obfuscation of this program to more related to -shell obfuscation than C obfuscation. This type of entry will -not be permitted in future contests. +WARNING: This program's `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 comments +## Author's comments: -If you like shell programming you may also admire my -creative quoting. (I use 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!) +If you like shell programming you may also admire my creative quoting. (I use +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!) -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. +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 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 c 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. +If everything works correctly it create an executable named `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: From 5adf8b8efbdfe654c0a312eea83f3e0105a962ab Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:40:09 -0700 Subject: [PATCH 17/22] Format, typo and other fixes in 1990/tbr/README.md The typo of most importance (maybe the only typo) was that when I linked to the archive tarball I left off /archive in the link. Noted in the judges' comments that in the smaller version provided by the author the exit() returns void problem is fixed but it still uses gets(), not fgets(). I don't see the reason to do that as it'll compile and it's really only an aside and not the entry. --- 1990/tbr/README.md | 57 +++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/1990/tbr/README.md b/1990/tbr/README.md index 0e651b082..7d876e8a4 100644 --- a/1990/tbr/README.md +++ b/1990/tbr/README.md @@ -1,16 +1,16 @@ # Best Utility -Byron Rakitzis +Byron Rakitzis Princeton University 5707 Old Lodge Dr. Houston, TX 77066 USA -Sean Dorward -Princeton University -10274 Burleigh Cottage Lane -Ellicott City, MD 21043 -USA +Sean Dorward +Princeton University +10274 Burleigh Cottage Lane +Ellicott City, MD 21043 +USA ## To build: @@ -28,7 +28,7 @@ due to the warning being interspersed with the program's output. Thank you Cody for your assistance! For the original version with `gets()` see the [archive -tarball](/archive-1990.tar.bz2). +tarball](/archive/archive-1990.tar.bz2). ## To run: @@ -44,13 +44,15 @@ or ctrl-c (or kill it from another terminal :-) ). ## 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 :-) +```sh +./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 :-) +``` What happens if you try using `cd -` to return to previous directory? What about `cd` with no args? @@ -68,22 +70,25 @@ Shell source was a major inspiration for the formation of the IOCCC back in The author supplied us with a slightly smaller unformatted version of the program which we include below: - #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;} - +```c +#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;} +``` +It has the `exit()` returns void fix but not the `gets()` to `fgets()` fix +applied. ## Author's comments: -Rot13: +### Rot13: Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf naq pq. Vg syntf reebef ba snvyrq puqve'f, bcra'f, perng'f From 8b9a9e1b830d1f0838d25c68146821d746bbc416 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:42:55 -0700 Subject: [PATCH 18/22] Fix author format in 1990/theorem/README.md Since it's probably not easy to see in a diff this does indeed mean that spaces were added at the end of each line. --- 1990/theorem/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/1990/theorem/README.md b/1990/theorem/README.md index 042a74cc7..6279102ba 100644 --- a/1990/theorem/README.md +++ b/1990/theorem/README.md @@ -1,10 +1,10 @@ # Best of Show -Adrian Mariano -University of Washington -2729 72nd Ave SE -Mercer Island, WA 98040 -USA +Adrian Mariano +University of Washington +2729 72nd Ave SE +Mercer Island, WA 98040 +USA ## To build: From ec111b36f569cf868e49f6d3c478a406c978d692 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 06:01:53 -0700 Subject: [PATCH 19/22] Remove erroneous statement in 1990/jaw/README.md Originally I had thought that a command in the commands to try did not work in macOS. But I looked at the code a while back and it's only because of the errno == 0 message in macOS and the fact the entry uses perror(). I noted it's not a bug in bugs.md at the time but I did not remove that part from the README.md (the part that says it doesn't work). --- 1990/jaw/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/1990/jaw/README.md b/1990/jaw/README.md index 28dc81a81..36685d620 100644 --- a/1990/jaw/README.md +++ b/1990/jaw/README.md @@ -48,10 +48,6 @@ echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw which should apply the identity transformation to a minimal holoalphabetic sentence. -Cody noted the above will not work under macOS. The commands in the judges' -comments do work in macOS after the fixes he made. - - ## Judges' comments: From f95e8c6956aa39440a199e7362a73d8688543b81 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 06:07:08 -0700 Subject: [PATCH 20/22] Updates and fixes + add alt code in 1990/westley Fix formatting in README.md. Removed statement of judges that they fixed it for modern compilers that object to 's' added to an int for short int as this is what I did and the source that was imported had not been fixed though this might have been a simple mistake. I had not noticed this before. Update bugs.md: a known bug and one INABIAF (crashes on no arg). Added alt code with the 1s as it's instructive to show what was once allowed but is not now. --- 1990/westley/Makefile | 4 +- 1990/westley/README.md | 55 ++++++++++++------- 1990/westley/westley.alt.c | 107 +++++++++++++++++++++++++++++++++++++ bugs.md | 11 ++++ 4 files changed, 156 insertions(+), 21 deletions(-) create mode 100644 1990/westley/westley.alt.c diff --git a/1990/westley/Makefile b/1990/westley/Makefile index 20790d8d0..a305416b1 100644 --- a/1990/westley/Makefile +++ b/1990/westley/Makefile @@ -112,8 +112,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= -ALT_TARGET= +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt ################# diff --git a/1990/westley/README.md b/1990/westley/README.md index 780473d98..1b805fe24 100644 --- a/1990/westley/README.md +++ b/1990/westley/README.md @@ -1,23 +1,28 @@ # Best Layout - Brian Westley (Merlyn LeRoy on usenet) - DigiBoard, Inc. - 1026 Blair Ave. - St. Paul, MN 55104 - USA - - http://www.westley.org +Brian Westley (Merlyn LeRoy on usenet) +DigiBoard, Inc. +1026 Blair Ave. +St. Paul, MN 55104 +USA + ## To build: - make all +```sh +make all +``` ## To run: - ./westley number +```sh +./westley number +``` [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern -systems. Thank you Cody for your assistance! +systems. It had `1s` in places for a short int which was changed to just `1`. +Since it's instructional to see the differences he has provided an alternate +version with the original code. See below. Thank you Cody for your assistance! NOTE: this entry will segfault without an arg and will enter an infinite loop if input is not a positive number. @@ -25,12 +30,27 @@ input is not a positive number. ## Try: - ./westley 1 - ./westley 2 - ./westley 3 - ./westley 5 +```sh +./westley 1 +./westley 2 +./westley 3 +./westley 5 +``` -## Judges' comments +### Alternate code: + +To see how C has changed over the years Cody provided the original source in +[westley.alt.c](westley.alt.c). If you have an old enough compiler try: + + +```sh +make alt +``` + +Use `westley.alt` as you would `westley`. + + +## Judges' comments: If you would rather "Daisy" someone other than Westley, rename @@ -49,11 +69,8 @@ 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. -Some modern compilers will not accept '1s' as a short integer - for -these compilers we replaced the instances of `1s` with `1`. - -## Author's comments +## Author's comments: This is a "Picking the Daisy" simulation. Now, instead of mangling a daisy, simply run this program with the number of petals desired as diff --git a/1990/westley/westley.alt.c b/1990/westley/westley.alt.c new file mode 100644 index 000000000..5d63757cc --- /dev/null +++ b/1990/westley/westley.alt.c @@ -0,0 +1,107 @@ +char*lie; + + double time, me= !0XFACE, + + not; int rested, get, out; + + main(ly, die) char ly, **die ;{ + + signed char lotte, + + +dear; (char)lotte--; + + for(get= !me;; not){ + + 1 - out & out ;lie;{ + + char lotte, my= dear, + + **let= !!me *!not+ ++die; + + (char*)(lie= + + +"The gloves are OFF this time, I detest you, snot\n\0sed GEEK!"); + + do {not= *lie++ & 0xF00L* !me; + + #define love (char*)lie - + + love 1s *!(not= atoi(let + + [get -me? + + (char)lotte- + + +(char)lotte: my- *love - + + 'I' - *love - 'U' - + + 'I' - (long) - 4 - 'U' ])- !! + + (time =out= 'a'));} while( my - dear + + && 'I'-1l -get- 'a'); break;}} + + (char)*lie++; + + +(char)*lie++, (char)*lie++; hell:0, (char)*lie; + + get *out* (short)ly -0-'R'- get- 'a'^rested; + + do {auto*eroticism, + + that; puts(*( out + + - 'c' + +-('P'-'S') +die+ -2 ));}while(!"you're at it"); + + +for (*((char*)&lotte)^= + + (char)lotte; (love ly) [(char)++lotte+ + + !!0xBABE];){ if ('I' -lie[ 2 +(char)lotte]){ 'I'-1l ***die; } + + else{ if ('I' * get *out* ('I'-1l **die[ 2 ])) *((char*)&lotte) -= + + '4' - ('I'-1l); not; for(get=! + + +get; !out; (char)*lie & 0xD0- !not) return!! + + (char)lotte;} + + +(char)lotte; + + do{ not* putchar(lie [out + + *!not* !!me +(char)lotte]); + + not; for(;!'a';);}while( + + love (char*)lie);{ + + +register this; switch( (char)lie + + [(char)lotte] -1s *!out) { + + char*les, get= 0xFF, my; case' ': + + *((char*)&lotte) += 15; !not +(char)*lie*'s'; + + this +1s+ not; default: 0xF +(char*)lie;}}} + + get - !out; + + if (not--) + + goto hell; + + exit( (char)lotte);} diff --git a/bugs.md b/bugs.md index 0d559c05b..c019ae999 100644 --- a/bugs.md +++ b/bugs.md @@ -477,6 +477,17 @@ this entry that prevented it from working. However if not enough args are specified this program will crash. This should NOT be fixed. +## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md)) +## STATUS: INABIAF - please **DO NOT** fix + +This entry will crash without an arg. At this time this is not considered worth +fixing so it should not be fixed. + +## STATUS: known bug - please help us fix + +However a negative number will make the program enter an infinite loop. This +will be fixed in time but it's noted here for now. + # 1991 From 637a43d841339ba4abee3c8dbe6a5e1a35bb6aa7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 06:21:46 -0700 Subject: [PATCH 21/22] Fixes in 1991/ant/README.md Mostly formatting fixes but one spelling fix that I feel almost guilty about. Though programme is correct in most cases (except US English but the author is from Canada) with computers it's actually program. It just seems better to have this correct if I'm going to go through and look for typos. Besides this is a programming contest so it makes sense that it should be correct. Easy mistake to make but should it be fixed? Maybe, maybe not but I chose to anyway. --- 1991/ant/README.md | 99 +++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/1991/ant/README.md b/1991/ant/README.md index 2aad15235..67d2ff114 100644 --- a/1991/ant/README.md +++ b/1991/ant/README.md @@ -1,26 +1,32 @@ # Best Utility: - Anthony C Howe - Mortice Kern Systems Inc. #CL-23 - 35 King St. N 268 Phillip St. - Waterloo, On Waterloo, On - Canada, N2J 2W9 Canada, N2L 6G9 +Anthony C Howe +Mortice Kern Systems Inc. #CL-23 +35 King St. N 268 Phillip St. +Waterloo, On Waterloo, On +Canada, N2J 2W9 Canada, N2L 6G9 ## To build: - make all +```sh +make all +``` ## To run: - ./ant some_file +```sh +./ant some_file +``` NOTE: the file must already exist and not specifying any arg will make the program exit without doing anything. ## Try: - cp README.md hill - ./ant hill +```sh +cp README.md hill +./ant hill +``` ## Judges' comments: @@ -42,64 +48,59 @@ commands section for other commands. 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 CURSES. +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 `curses`. ### COMMANDS: - h j k l left, down, up, right cursor movement - H J K L word left, page down, page up, word right - [ ] beginning and end of line - t b top and bottom of file - i enter insert mode, formfeed to quit - x delete character under the cursor - W write buffer to file - R refresh the screen - Q quit +- h j k l left, down, up, right cursor movement +- H J K L word left, page down, page up, word right +- [ ] beginning and end of line +- t b top and bottom of file +- i enter insert mode, form-feed to quit +- x delete character under the cursor +- W write buffer to file +- R refresh the screen +- Q quit ### EXIT STATUS: - 0 success - 2 missing edit filename +- 0 success +- 2 missing edit filename ### ABOUT THIS ENTRY: -The 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. +The 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. -It is recommend that compact memory model be used on PC class -machines. Small memory model may work too provided BUF is not -too large. +It is recommend that compact memory model be used on PC class machines. Small +memory model may work too provided BUF is not too large. -The character constants '\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' (formfeed) was used to exit insert mode because -K&R C had no escape constant for the escape-key. +The character constants `'\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. My goals for this project were to learn and experiment with the Buffer Gap Scheme [Fin80][net90], write a useful and *portable* -programme, and meet the requirements of the IOCCC. I initially -planned to have a mini CURSES built-in like the IOCCC Tetris entry +program, and meet the requirements of the IOCCC. I initially +planned to have a mini `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. +`curses` library with `TERMINFO`/`TERMCAP` support. -I plan to post followups 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. +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. +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. ### REFERENCES: From ececfced3ec338bfca74ea324f8440a971f9f8dc Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 9 Apr 2023 06:38:40 -0700 Subject: [PATCH 22/22] Check 1990/jaw/README.md for typos Removed this task from todo.md, changing it to refer to just make sure all README.md files have been checked for typos. I _believe_ this means 1990 has been checked for typos except for the 1990/README.md file itself. --- 1990/jaw/README.md | 117 +++++++++++++++++++++++---------------------- todo.md | 5 +- 2 files changed, 62 insertions(+), 60 deletions(-) diff --git a/1990/jaw/README.md b/1990/jaw/README.md index 36685d620..9c8c82c7e 100644 --- a/1990/jaw/README.md +++ b/1990/jaw/README.md @@ -70,49 +70,53 @@ sh shark.sh jaw.* README.md > receive The resulting file, `receive`, 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.md +```sh +mkdir -p test +cd test +sh ../receive +cmp ../jaw.c jaw.c +cmp ../README.md README.md +``` ## Authors' comments: ### ABSTRACT - Minimal, Universal File Bundling - (or, Functional Obfuscation in a Self-Decoding Unix Shell Archive) +#### Minimal, Universal File Bundling (or, Functional Obfuscation in a Self-Decoding Unix Shell Archive) + +James A. Woods +Universities Space Research Association +NASA Ames Research Center - James A. Woods - Universities Space Research Association - NASA Ames Research Center +--- +> "Use an algorithm, go to jail." +> +> -- anon., circa 1988, pre-Morris worm era - "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 over- -come by planting a novel Trojan Horse in the archive header to perform +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 (un)bundler 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 ('compress' or -'squeeze') and an efficient bit packetizer ('btoa') are compiled on-the-fly at +Miniature versions of counterparts to a Lempel-Ziv coder (`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 lines (or `~1100` bytes), commensurate with the size of many Internet mail headers; it -amortizes favorably with message size. 'Shark' is portable across Unix +amortizes favorably with message size. `shark` is portable across Unix variants, while the underlying technique is inherently generalizable to other encoding schemes. @@ -123,12 +127,12 @@ environment. ---------------------------------------------- -> Oh, the shark has pretty teeth, dear-- -> And he shows them pearly white -> Just a jackknife has Macheath, dear-- -> And he keeps it out of sight. - -> [Bertolt Brecht, Threepenny Opera] +> Oh, the shark has pretty teeth, dear-- +> And he shows them pearly white +> Just a jackknife has Macheath, dear-- +> And he keeps it out of sight. +> +> -- Bertolt Brecht, Threepenny Opera ---------------------------------------------- @@ -137,7 +141,7 @@ environment. We have ported this program to a wide variety of systems. Among these are: -- SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1') +- SunOS 4.1 / Sun SPARCstation 1 (using both 'cc' and 'gcc 1.37.1') - SunOS 4.0.3 / Sun 3 - BSD 4.3 / VAX 8650 - SEIUX / Sumitomo Electric Ustation/S @@ -154,8 +158,8 @@ We (the authors) feel this program is obfuscated for the following reasons: -0. This is one of the few programs you'll see WHOSE VERY UTILITY DEPENDS ON ITS -OBFUSCATION! +0. This is one of the few programs you'll see _WHOSE VERY UTILITY DEPENDS ON ITS +OBFUSCATION_! 1. The contest entry may be used to send its wonderful self to anyone in the Unix world! Virus writers need not apply... @@ -164,23 +168,22 @@ Unix world! Virus writers need not apply... 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. -3. Meta-obfuscation is via obfuscated description (see ABSTRACT). +3. Meta-obfuscation is via obfuscated description (see _ABSTRACT_). 4. "Literary" allusion. Production code contains a reference to self-reference, preserved at amazing cost for sheer perversity. 5. Many, many micro obfuscations below, honed over three years time, in shell as -well as C. Ask about the 'tar' pit escape, the 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. +well as C. Ask about the 'tar' pit escape, the `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: -Construct '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. +Construct `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. ```sh #!/bin/sh @@ -199,39 +202,39 @@ rm /tmp/shark$$* ### Shark history: - May 1987: Karl Fox introduces 1023-byte zcat.c to USENET. - It's too late for the 4th IOCCC. +- May 1987: Karl Fox introduces 1023-byte zcat.c to USENET. + It's too late for the 4th IOCCC. - May 21, 1987: James A. Woods extends idea to construct self - decompressing shar Trojan horse, utilizing 'cc', 'shar', - 'zcat', & 'btoa'; size: 2303 bytes. +- May 21, 1987: James A. Woods extends idea to construct self + decompressing shar Trojan horse, utilizing 'cc', 'shar', + 'zcat', & 'btoa'; size: 2303 bytes. - May 23, 1987: 'jaw' trims 250 bytes without much thought. +- May 23, 1987: 'jaw' trims 250 bytes without much thought. - June 2, 1987: 52 lines of shell, 1991 bytes, now made with 'tar', - short-circuit C-compile at far end, dual-use main.c, - portability mods. (jaw) +- June 2, 1987: 52 lines of shell, 1991 bytes, now made with 'tar', + short-circuit C-compile at far end, dual-use main.c, + portability mods. (jaw) - Mar-May 1988: abortive run at 5th IOCCC. - jaw.c - 1529 bytes. compile line: 152 bytes. - generated funny code with execvp() to invoke shell. +- Mar-May 1988: abortive run at 5th IOCCC. + jaw.c - 1529 bytes. compile line: 152 bytes. + generated funny code with execvp() to invoke shell. - Aug 29, 1988: production version, now at 1830 bytes. +- Aug 29, 1988: production version, now at 1830 bytes. - Jan 1990: Paul Eggert does tour-de-force shark re-engineering. +- Jan 1990: Paul Eggert does tour-de-force shark re-engineering. - May 24, 1990: collaboration yields 999-byte 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. +- May 24, 1990: collaboration yields 999-byte 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. - May 1990: 'jaw' develops experimental replacement using - Dan Bernstein's high-compression 'squeeze'. +- May 1990: 'jaw' develops experimental replacement using + Dan Bernstein's high-compression 'squeeze'. To which we add: - June 1990: 'shark' wins the IOCCC, finally! :-) +- June 1990: 'shark' wins the IOCCC, finally! :-) ## Copyright and CC BY-SA 4.0 License: diff --git a/todo.md b/todo.md index 36b3a86e3..cfb0f9f4e 100644 --- a/todo.md +++ b/todo.md @@ -1,5 +1,5 @@ # A todo list of known things to check and/or do -*Last updated: Sun 9 Apr 2023 05:12:09 PDT* +*Last updated: Sun 9 Apr 2023 13:38:05 UTC* More things will likely be added over time and as items are done they _should be_ removed from the list IF AND ONLY IF (!!) we are certain it is done (many @@ -11,8 +11,7 @@ not been done). - Find entries with bugs and INABIAF and add to [bugs.md](/bugs.md). - Resolve as many of the issues in [bugs.md](/bugs.md) with the exception of the INABIAF ones. This is likely not possible but some certainly can be fixed. -- Check for typos in [1990/jaw/README.md](/1990/jaw/README.md). Many other -README.md files have to be checked for typos as well. +- Check for typos in README.md files. - Verify which README.md files have not been checked for correct formatting and fix any issues.