From 00e0bcc105fb756395f386031c7f52e25fe36f1e Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 03:02:40 -0700 Subject: [PATCH 01/21] Add table generator to 1984/mullender from author This included adding the 'a.out.h' as not all systems have it and also I wanted it as close to the original as possible so I got a copy (https://raw.githubusercontent.com/dspinellis/unix-history-repo/Research-Release/usr/include/a.out.h) from the fabulous Unix History repo (https://github.com/dspinellis/unix-history-repo) which I highly recommend anyone interested in the evolution of Unix to check out! ... and yes: the repo is under the account of Diomidis Spinellis who is a previous IOCCC winner! To generate the tool run `make gentab'. Note that keeping the short ints short generates a lot of negative numbers but this might or might not be a problem: the original mullender.c has a negative number for instance. Updated .gitignore and README.md files. --- 1984/mullender/.gitignore | 1 + 1984/mullender/Makefile | 5 ++++ 1984/mullender/README.md | 28 ++++++++++++++++++-- 1984/mullender/a.out.h | 33 ++++++++++++++++++++++++ 1984/mullender/gentab.c | 54 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 1984/mullender/a.out.h create mode 100644 1984/mullender/gentab.c diff --git a/1984/mullender/.gitignore b/1984/mullender/.gitignore index 85c8b08ba..14a439de4 100644 --- a/1984/mullender/.gitignore +++ b/1984/mullender/.gitignore @@ -1,2 +1,3 @@ mullender mullender.alt +gentab diff --git a/1984/mullender/Makefile b/1984/mullender/Makefile index 38f359ecc..f1fab7dff 100644 --- a/1984/mullender/Makefile +++ b/1984/mullender/Makefile @@ -131,6 +131,10 @@ ${PROG}: ${PROG}.c @echo "than a Vax-11 or pdp-11." ${CC} ${CFLAGS} $< -o $@ ${LIBS} +gentab: gentab.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + + # alternative executable # alt: data ${ALT_TARGET} @@ -164,6 +168,7 @@ clean: clobber: clean ${RM} -f ${TARGET} ${ALT_TARGET} ${RM} -f core + ${RM} -f gentab @-if [ -e sandwich ]; then \ ${RM} -f sandwich; \ echo 'ate sandwich'; \ diff --git a/1984/mullender/README.md b/1984/mullender/README.md index ed1a8de61..39737e044 100644 --- a/1984/mullender/README.md +++ b/1984/mullender/README.md @@ -17,11 +17,11 @@ make all ./mullender ``` -> NOTE: If your machine is not a Vax-11 or pdp-11, this program will +> NOTE: If your machine is not a VAX-11 or PDP-11, this program will > not execute correctly. In later years, machine dependent > code was discouraged. -### Alternative code: +### Alternate code: [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) added the alternative code which lets you run this on other systems. He notes though that this was @@ -95,6 +95,30 @@ couldn't! :-) BTW: this remains my (Landon Curt Noll's) all time favorite entries! +Cody found the remarks from [Sjoerd Mullender](/winners.html#Sjoerd_Mullender) +and added the program that was used by the authors to generate the array that he +referred to. Because [a.out.h](a.out.h) is not available in all systems (like macOS) and +more importantly because he wanted it to be as close to as the original as +possible he used a copy of + +in the *fabulous* [Unix History +Repo](https://github.com/dspinellis/unix-history-repo/tree/Research-Release). + +This tool can be built by running: + + +```sh +make gentab +``` + +Cody notes that it does not appear to work in modern systems (unbalanced braces) +or something else is wrong but given that this was done a long time ago on a now +archaic system maybe that is why. He also noted that if the `short`s are not +changed to just `int` it prints out a lot of negative numbers but since +[mullender.c](mullender.c) has a negative number he kept it as is. + +Thank you Cody! + ## Author's remarks: These remarks, found at diff --git a/1984/mullender/a.out.h b/1984/mullender/a.out.h new file mode 100644 index 000000000..75e2ba9fa --- /dev/null +++ b/1984/mullender/a.out.h @@ -0,0 +1,33 @@ +struct exec { /* a.out header */ + int a_magic; /* magic number */ + unsigned a_text; /* size of text segment */ + unsigned a_data; /* size of initialized data */ + unsigned a_bss; /* size of unitialized data */ + unsigned a_syms; /* size of symbol table */ + unsigned a_entry; /* entry point */ + unsigned a_unused; /* not used */ + unsigned a_flag; /* relocation info stripped */ +}; + +#define A_MAGIC1 0407 /* normal */ +#define A_MAGIC2 0410 /* read-only text */ +#define A_MAGIC3 0411 /* separated I&D */ +#define A_MAGIC4 0405 /* overlay */ + +struct nlist { /* symbol table entry */ + char n_name[8]; /* symbol name */ + int n_type; /* type flag */ + unsigned n_value; /* value */ +}; + + /* values for type flag */ +#define N_UNDF 0 /* undefined */ +#define N_ABS 01 /* absolute */ +#define N_TEXT 02 /* text symbol */ +#define N_DATA 03 /* data symbol */ +#define N_BSS 04 /* bss symbol */ +#define N_TYPE 037 +#define N_REG 024 /* register name */ +#define N_FN 037 /* file name symbol */ +#define N_EXT 040 /* external bit, or'ed in */ +#define FORMAT "%06o" /* to print a value */ diff --git a/1984/mullender/gentab.c b/1984/mullender/gentab.c new file mode 100644 index 000000000..069cd89e7 --- /dev/null +++ b/1984/mullender/gentab.c @@ -0,0 +1,54 @@ +#include +#include +#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"); + } +} From 43198b14a4729d34908017025ab383e90fc4d826 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 03:15:24 -0700 Subject: [PATCH 02/21] Add initial tmp/author-wins.csv As Landon noted on GitHub: One of the key elements that we are missing from the SQL command set is a way to tie a winning author handle to the entry handles.. We think what is needed is an CVS file, perhaps, tmp/author-wins.csv that connects the author handle with the winning entries that they won. The proposed tmp/author-wins.csv will be used to generate the list of winning entries that a given author has submitted. This will be used to generate the per-author JSON files. As I just wanted to start it and I've not given any thought whatever at how to generate it (except very briefly yesterday morning) I've only for now included what Landon did. Once I've generated it all it'll be sorted maybe by year or maybe by surname: that's to be determined later but this is a nice start at least. --- tmp/author-wins.csv | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tmp/author-wins.csv diff --git a/tmp/author-wins.csv b/tmp/author-wins.csv new file mode 100644 index 000000000..a33bec204 --- /dev/null +++ b/tmp/author-wins.csv @@ -0,0 +1,6 @@ +Ondrej_Adamovsky,2019_adamovsky, +Jack_Applin,1985_applin,1986_applin,1988_applin, +Cody_Boone_Ferguson,2018_ferguson,2020_ferguson1,2020_ferguson2, +David_Korn,1987_korn, +Brian_Westley,1987_westley,1988_westley,1989_westley,1990_westley,1991 westley,1992_westley,1994_westley,1996_westley,2001_westley, +Matt_Zucker,2011_zucker, From 9419f9602833c446a7b9111eafb3de0d07c6a28a Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 05:45:46 -0700 Subject: [PATCH 03/21] Add script to extract winner handles This is the first step in making the new CSV file that identifies which entries each author won. To get a list of all winning handles run bin/extract_winner_handles.sh ...which is a very simple pipeline (that could probably be simplified further) acting on winners.html. --- bin/extract_winner_handles.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 bin/extract_winner_handles.sh diff --git a/bin/extract_winner_handles.sh b/bin/extract_winner_handles.sh new file mode 100755 index 000000000..ee344667e --- /dev/null +++ b/bin/extract_winner_handles.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +grep -o '' winners.html |sed -e 's,//g' + From 1568b0efc63173cc65ac1fda0a5a0fc63d510201 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 07:42:24 -0700 Subject: [PATCH 04/21] Sort author-wins.csv --- tmp/author-wins.csv | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tmp/author-wins.csv b/tmp/author-wins.csv index a33bec204..d349eae84 100644 --- a/tmp/author-wins.csv +++ b/tmp/author-wins.csv @@ -1,6 +1,7 @@ -Ondrej_Adamovsky,2019_adamovsky, -Jack_Applin,1985_applin,1986_applin,1988_applin, +Brian_Westley,1987_westley,1988_westley,1989_westley,1990_westley,1991 westley,1992_westley,1994_westley,1996_westley,2001_westley, Cody_Boone_Ferguson,2018_ferguson,2020_ferguson1,2020_ferguson2, David_Korn,1987_korn, -Brian_Westley,1987_westley,1988_westley,1989_westley,1990_westley,1991 westley,1992_westley,1994_westley,1996_westley,2001_westley, +Don_Yang,2015_yang,2018_yang,2019_yang,2020_yang, +Jack_Applin,1985_applin,1986_applin,1988_applin, Matt_Zucker,2011_zucker, +Ondrej_Adamovsky,2019_adamovsky, From 2ac68714321a2d804363d959dec4df3bb9ec189d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 07:54:40 -0700 Subject: [PATCH 05/21] Add tmp/winner-handles.csv This file has a list of winner handles like author-wins.csv but it has every winner handle just without the entries they won. This might not be necessary but it might also be helpful with attaching the winning handles to the winner handles. --- tmp/winner-handles.csv | 186 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 tmp/winner-handles.csv diff --git a/tmp/winner-handles.csv b/tmp/winner-handles.csv new file mode 100644 index 000000000..403578a87 --- /dev/null +++ b/tmp/winner-handles.csv @@ -0,0 +1,186 @@ +Brian_Westley,1987_westley,1988_westley,1989_westley,1990_westley,1991 westley,1992_westley,1994_westley,1996_westley,2001_westley, +Cody_Boone_Ferguson,2018_ferguson,2020_ferguson1,2020_ferguson2, +David_Korn,1987_korn, +Don_Yang,2015_yang,2018_yang,2019_yang,2020_yang, +Jack_Applin,1985_applin,1986_applin,1988_applin, +Matt_Zucker,2011_zucker, +Ondrej_Adamovsky,2019_adamovsky, +Aaron_Grothe +Adar_Zeitak +Adrian_Cable +Adrian_Mariano +Aidan_Thornton +Alan_De_Smet +Albert_van_der_Horst +Alex_Deckmyn +Alexander_Prishchepov +Anders_Gavare +Andrea_Marangoni +Andreas_Gustafsson +Andrew_Shapiro +Andy_Sloane +Anthony_C_Howe +Anton_Algmyr +Arch_D_Robison +Arne_Heizmann +Baruch_Nissenbaum +Bas_de_Bakker +Ben_Lynn +Bernd_Meyer +Brent_Burley +Bruce_Holloway +Byron_Rakitzis +Carl_Banks +Carl_Shapiro +Carlos_Duarte +Cel_Skeggs +Chris_King +Christian_Dupont +Christopher_Mills +Christopher_Night +Col_G_L_Sicherman +Craig_Schneiderwent +Daniel_Fischer +Daniel_Vik +Dave_Burton +Dave_Decot +David_Applegate +David_Gibson +David_Goodenough +David_Madore +David_Van_Brackle +Dean_Swift +Derek_Anderson +Diomidis_Spinellis +Dominik_Muth +Don_Dodson +Doron_Osovlanski +Doug_Beardsley +E_Jay_Berkenbilt +Ed_Luke +Ed_Lycklama +Edward_Giles +Edward_Rosten +Eric_Marshall +Eryk_Kopczynski +Esko_Nuutila +Etienne_Duble +Fabrice_Bellard +Ferenc_Deak +Francois_Boutines +Frans_van_Dorsselaer +Freek_Wiedijk +Garry_Glendown +Gavin_Barraclough +Gavin_Buttimore +Gil_Dogon +Glyn_Anderson +Gopi_Reddy +Gregor_Richards +Heather_Downs +Ian_Collier +Ian_Phillipps +Ilya_Kurdyukov +Immanuel_Herrmann +J_David_Lowe +James_A_Woods +James_Bonfield +Jan_Stein +Jari_Arkko +Jason_Orendorff +Jay_Vosburgh +Jeff_Newbern +Jeff_Weisberg +Jens_Schweikhardt +Jetro_Lauha +Jim_Hague +John_Dalbec +John_Tromp +John_Williams +Jon_Thingvold +Jonathan_Hoyle +Joshua_Karns +Jyrki_Holopainen +Ken_Huffman +Kevin_Pulo +Kimmo_Fredriksson +Larry_Jones +Larry_Wall +Laurion_Burchall +Lennart_Augustsson +Leonid_A_Broukhis +Lord_Zarbon +Maarten_Litmaath +Marcin_Ciura +Mark_Biggar +Mark_Isaak +Mark_Plummer +Mark_Schnitzius +Mary_Ann_Horton +Maurizio_Monge +Mauro_Persano +Michael_Ash +Michael_Birken +Michael_H_Pawka +Michael_Savastio +Mike_Laman +Moxen_N_Briddlebane +NATORI_Shin +Nathan_Otterness +Nathan_Sidwell +Neil_Mix +Nicholas_Carlini +Nick_Johnson +Nicolas_Ollinger +Ora_Lassila +Oscar_Toledo +Oskar_von_der_Luehe +Paul_Dale +Paul_E_Black +Paul_Eggert +Paul_Heckbert +Peter_Eastman +Peter_J_Ruczynski +Peter_Klausler +Philip_Blakely +Qiming_HOU +Raphael_Meyer +Raymond_Cheong +Robbert_van_Renesse +Robert_Heckendorn +Roemer_B_Lievaart +Ron_McFarland +Sandro_Maffiodo +Scott_Vokes +Sean_Barrett +Sean_Dorward +Sebastian_Deorowicz +Selene_Makarios +Seonghoon_Kang +Shinichiro_Hamaji +Sjoerd_Mullender +Spencer_Hines +Steinar_Hamre +Stephen_Sykes +Stig_Hemmer +Szabolcs_Borsanyi +Szymon_Rusinkiewicz +Taketo_Konno +Teemu_Rantanen +Tero_Kivinen +Thaddaeus_Frogley +Thomas_A_Fine +Thomas_P_John +Thomas_Stewart +Thor_Eldby +Timo_Poikola +Tony_Finch +Tsukasa_Hamano +Uri_Goren +V_Chia +Vern_Paxson +Vincent_Weaver +Walter_Bright +Yusuke_Endoh +_tsoj +bsoup From e23db83ae6bb0742698581a69a2c0ecc3a21edde Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 08:14:32 -0700 Subject: [PATCH 06/21] Get 2014/skeggs to compile The problem was that the CDEFINE was missing 's: the define is an actual string so it needs the 's surrounding the "s otherwise the code will not compile. I didn't have a chance to really look at the compilation error but I noticed in Yusuke Endoh's analysis that he compiled it slightly different than the Makefile. It became clear at that point what was going on. He added -ldl but this should not be necessary so I did not add it to the Makefile. --- 2014/skeggs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2014/skeggs/Makefile b/2014/skeggs/Makefile index 4cc43f2aa..8f5237b1f 100644 --- a/2014/skeggs/Makefile +++ b/2014/skeggs/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DCC="${CC} -fPIC" +CDEFINE= -DCC='"${CC} -fPIC"' # Include files that are needed to compile # From c6de11e83ec87fd6e44e90bf8a954078a80663f2 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 09:08:05 -0700 Subject: [PATCH 07/21] Fix 1986/marshall/Makefile about compilers I got the entry to work with clang quite a while back but I never removed the comment saying that the entry might have problems with some compilers. I suppose some might still but clang is pretty strict so it probably is okay. --- 1986/marshall/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/1986/marshall/Makefile b/1986/marshall/Makefile index 9c0dfec7c..d9068b441 100644 --- a/1986/marshall/Makefile +++ b/1986/marshall/Makefile @@ -130,7 +130,6 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: This entry uses non-standard args to main() that do not work with modern compilers." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable From 5933d587736818469601447911ada557a8c42e97 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 09:37:47 -0700 Subject: [PATCH 08/21] Fix 1993/jonth/Makefile about compilers I got the entry to compile quite a while back (Yusuke Endoh fixed the X code) but I never removed the comment saying that the entry might have problems with modern compilers. --- 1993/jonth/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/1993/jonth/Makefile b/1993/jonth/Makefile index 0473b57f3..e8cc9660e 100644 --- a/1993/jonth/Makefile +++ b/1993/jonth/Makefile @@ -131,7 +131,6 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.tmp.c - @echo "NOTE: This entry might not compile when using modern compilers." ${CC} ${CFLAGS} $< -o $@ ${LIBS} ${PROG}.tmp.c: ${PROG}.c From 53dea012ebe6d361eaaff0a1e2072c1eaa25a799 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 09:59:48 -0700 Subject: [PATCH 09/21] Fix compilation of 2018/burton2 I forgot about the DATA variable in the Makefile when changing the discrepancies file to be a markdown file. --- 2018/burton2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2018/burton2/Makefile b/2018/burton2/Makefile index 5674d7e69..9d62e68f5 100644 --- a/2018/burton2/Makefile +++ b/2018/burton2/Makefile @@ -120,7 +120,7 @@ TARGET= ${PROG} ALT_OBJ= ALT_TARGET= -EXTRA_DATA= ansi c++11 c++14 c++98 c11 c99 discrepancies \ +EXTRA_DATA= ansi c++11 c++14 c++98 c11 c99 discrepancies.md \ test01.c test02.c test03.c test04.c test05.c test06.c test07.c \ test08.c test09.c test10.c test11.c test12.c test13.c test14.c \ iocccbug01.c iocccbug02.c iocccbug03.c iocccbug04.c iocccbug05.c \ From 887d13e8476c292a63b3f779aeec8fb4ba1fa2e3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 15 May 2023 10:04:17 -0700 Subject: [PATCH 10/21] Fix 2012/tromp compilation Here too I forgot to update the DATA variable in the Makefile after renaming a file (to be a markdown file). --- 2012/tromp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2012/tromp/Makefile b/2012/tromp/Makefile index e5aa7851e..410cfcbf0 100644 --- a/2012/tromp/Makefile +++ b/2012/tromp/Makefile @@ -113,7 +113,7 @@ ENTRY= tromp PROG= ${ENTRY} # OBJ= ${PROG}.o -DATA= how13 primes.blc uni.blc uni8.Blc bf.Blc hw.bf deflate.Blc inflate.Blc \ +DATA= how.md primes.blc uni.blc uni8.Blc bf.Blc hw.bf deflate.Blc inflate.Blc \ parse.Blc symbolic.Blc primes.pl TARGET= ${PROG} ${PROG}64 # From e4416b949a0a513c7776f6a632095d12f498ed3d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 16 May 2023 03:01:49 -0700 Subject: [PATCH 11/21] Markdownify and typo fix CONTRIBUTING.md I'll just add for fun: I had never heard of the word markdownify but I guessed that someone has used it before and indeed some have. I guess it's time to add to text replacement and the vim spellfile! --- CONTRIBUTING.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25a94edd4..4a4f3b6a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,21 +2,28 @@ ## Submit to the IOCCC -0. Verify that the IOCCC is open for submissions. -1. If the IOCCC is open, you need to register as a contestant. -See: how to enter for how to register. +0. Verify that the [IOCCC is open](https://www.ioccc.org/index.html#enter) for +submissions. + +1. If the IOCCC is open, you need to register as a contestant. See [how to +enter](https://www.ioccc.org/index.html#enter) for how to register. + 2. Once you have been registered, you will receive an email message for how to -prepare your entries for submission, -and how to upload the compressed tarballs to our submission portal. -3. Once the IOCCC closes, -the judges will select the winning entries, -announce them on the @IOCCC mastodon feed, -notify the winners via email using their previously registered email address, -and upload the winning code to the ioccc-src/winner repo -which in turn will cause them to be displayed on the IOCCC winners page. +prepare your entries for submission, and how to upload the compressed tarballs +to our submission portal. + +3. Once the [IOCCC](https://www.ioccc.org/index.html#enter) closes, the judges +will select the [winning entries](https://www.ioccc.org/years.html) announce them +on the [@IOCCC mastodon feed](https://fosstodon.org/@ioccc), notify the winners +via email using their previously registered email address, and upload the +winning code to the [winner repo](https://github.com/ioccc-src/winner) repo +which in turn will cause them to be displayed on the [IOCCC winning entries +page](https://www.ioccc.org/years.html). ## Updating your winning entries -If you are an IOCCC winner, you may update your entries (meta-data as well as source code) -by using a GitHub pull request -against the master branch of the ioccc-src/winner repo. +If you are an IOCCC winner, you may update your entries (metadata as well as +source code and any extra files) by opening a [GitHub pull +request](https://github.com/ioccc-src/winner/pulls) against the master +[branch](https://github.com/ioccc-src/winner/branches) of the [ioccc-src/winner +repo](https://github.com/ioccc-src/winner) repo. From 060402bf2d8b16fc0294d2e30da5fb03f793c0d1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 16 May 2023 03:08:53 -0700 Subject: [PATCH 12/21] Add tmp/winning_handles.txt find . -name '.id' -print0 | xargs -0 cat|sort > tmp/winning_handles.txt This also seems like it might be useful for the issue of identifying the winning entries per author. Once that file is generated (how to do that is still TBD) this file as well as some of the ones generated yesterday can be deleted. --- tmp/winning_handles.txt | 321 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100644 tmp/winning_handles.txt diff --git a/tmp/winning_handles.txt b/tmp/winning_handles.txt new file mode 100644 index 000000000..431ca3d89 --- /dev/null +++ b/tmp/winning_handles.txt @@ -0,0 +1,321 @@ +1984_anonymous +1984_decot +1984_laman +1984_mullender +1985_applin +1985_august +1985_lycklama +1985_shapiro +1985_sicherman +1986_applin +1986_august +1986_bright +1986_hague +1986_holloway +1986_marshall +1986_pawka +1986_stein +1986_wall +1987_biggar +1987_heckbert +1987_hines +1987_korn +1987_lievaart +1987_wall +1987_westley +1988_applin +1988_dale +1988_isaak +1988_litmaath +1988_phillipps +1988_reddy +1988_robison +1988_spinellis +1988_westley +1989_fubar +1989_jar.1 +1989_jar.2 +1989_ovdluhe +1989_paul +1989_robison +1989_roemer +1989_tromp +1989_vanb +1989_westley +1990_baruch +1990_cmills +1990_dds +1990_dg +1990_jaw +1990_pjr +1990_scjones +1990_stig +1990_tbr +1990_theorem +1990_westley +1991_ant +1991_brnstnd +1991_buzzard +1991_cdupont +1991_davidguy +1991_dds +1991_fine +1991_rince +1991_westley +1992_adrian +1992_albert +1992_ant +1992_buzzard.1 +1992_buzzard.2 +1992_gson +1992_imc +1992_kivinen +1992_lush +1992_marangon +1992_nathan +1992_vern +1992_westley +1993_ant +1993_cmills +1993_dgibson +1993_ejb +1993_jonth +1993_leo +1993_lmfjyh +1993_plummer +1993_rince +1993_schnitzi +1993_vanb +1994_dodsond1 +1994_dodsond2 +1994_horton +1994_imc +1994_ldb +1994_schnitzi +1994_shapiro +1994_smr +1994_tvr +1994_weisberg +1994_westley +1995_cdua +1995_dodsond1 +1995_dodsond2 +1995_esde +1995_garry +1995_heathbar +1995_leo +1995_makarios +1995_savastio +1995_schnitzi +1995_spinellis +1995_vanschnitz +1996_august +1996_dalbec +1996_eldby +1996_gandalf +1996_huffman +1996_jonth +1996_rcm +1996_schweikh1 +1996_schweikh2 +1996_schweikh3 +1996_westley +1998_banks +1998_bas1 +1998_bas2 +1998_chaos +1998_df +1998_dlowe +1998_dloweneil +1998_dorssel +1998_fanf +1998_schnitzi +1998_schweikh1 +1998_schweikh2 +1998_schweikh3 +1998_tomtorfs +2000_anderson +2000_bellard +2000_bmeyer +2000_briddlebane +2000_dhyang +2000_dlowe +2000_jarijyrki +2000_natori +2000_primenum +2000_rince +2000_robison +2000_schneiderwent +2000_thadgavin +2000_tomx +2001_anonymous +2001_bellard +2001_cheong +2001_coupard +2001_ctk +2001_dgbeards +2001_herrmann1 +2001_herrmann2 +2001_jason +2001_kev +2001_ollinger +2001_rosten +2001_schweikh +2001_westley +2001_williams +2004_anonymous +2004_arachnid +2004_burley +2004_gavare +2004_gavin +2004_hibachi +2004_hoyle +2004_jdalbec +2004_kopczynski +2004_newbern +2004_omoikane +2004_schnitzi +2004_sds +2004_vik1 +2004_vik2 +2005_aidan +2005_anon +2005_boutines +2005_chia +2005_giljade +2005_jetro +2005_klausler +2005_mikeash +2005_mynx +2005_persano +2005_sykes +2005_timwi +2005_toledo +2005_vik +2005_vince +2006_birken +2006_borsanyi +2006_grothe +2006_hamre +2006_meyer +2006_monge +2006_night +2006_sloane +2006_stewart +2006_sykes1 +2006_sykes2 +2006_toledo1 +2006_toledo2 +2006_toledo3 +2011_akari +2011_blakely +2011_borsanyi +2011_dlowe +2011_eastman +2011_fredriksson +2011_goren +2011_hamaji +2011_hou +2011_konno +2011_richards +2011_toledo +2011_vik +2011_zucker +2012_blakely +2012_deckmyn +2012_dlowe +2012_endoh1 +2012_endoh2 +2012_grothe +2012_hamano +2012_hou +2012_kang +2012_konno +2012_omoikane +2012_tromp +2012_vik +2012_zeitak +2013_birken +2013_cable1 +2013_cable2 +2013_cable3 +2013_dlowe +2013_endoh1 +2013_endoh2 +2013_endoh3 +2013_endoh4 +2013_hou +2013_mills +2013_misaka +2013_morgan1 +2013_morgan2 +2013_robison +2014_birken +2014_deak +2014_endoh1 +2014_endoh2 +2014_maffiodo1 +2014_maffiodo2 +2014_morgan +2014_sinon +2014_skeggs +2014_vik +2014_wiedijk +2015_burton +2015_dogon +2015_duble +2015_endoh1 +2015_endoh2 +2015_endoh3 +2015_endoh4 +2015_hou +2015_howe +2015_mills1 +2015_mills2 +2015_muth +2015_schweikhardt +2015_yang +2018_algmyr +2018_anderson +2018_bellard +2018_burton1 +2018_burton2 +2018_ciura +2018_endoh1 +2018_endoh2 +2018_ferguson +2018_giles +2018_hou +2018_mills +2018_poikola +2018_vokes +2018_yang +2019_adamovsky +2019_burton +2019_ciura +2019_diels-grabsch1 +2019_diels-grabsch2 +2019_dogon +2019_duble +2019_endoh +2019_giles +2019_karns +2019_lynn +2019_mills +2019_poikola +2019_yang +2020_burton +2020_carlini +2020_endoh1 +2020_endoh2 +2020_endoh3 +2020_ferguson1 +2020_ferguson2 +2020_giles +2020_kurdyukov1 +2020_kurdyukov2 +2020_kurdyukov3 +2020_kurdyukov4 +2020_otterness +2020_tsoj +2020_yang From 6c53a08b7da59a03a32468a6882223b10d4ddceb Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 16 May 2023 03:12:44 -0700 Subject: [PATCH 13/21] Fix 1993/Makefile to compile 1993/ant When the idea of having the winning entry directory names match the name of the authors was decided to be a bad idea after all I forgot to update the 1993 Makefile with Anthony Howe's entry so that it tried to cd to 1993/howe and not 1993/ant. This caused a compilation error and prevented 1993/ant from being compiled. Very few entries do not compile now though that does not mean that all that compile work - yet at least. Some that don't compile never will: - 1988/spinellis will never compile with clang. I added alt code for clang. - 1993/lmfjyh will not compile except for gcc == (or < ?) 2.3.3 as it relies on a bug in gcc that was fixed in version 2.3.3. This entry unfortunately creates a bogus file called: '";main(){puts("Hello World!");}char*C=".c' though at least it's excluded in .gitignore ('"*'). The fact this file is generated is still an issue though and perhaps the entry should be made alt code and the original could be an #error if gcc >= 2.3.3? - 1994/westley is not supposed to compile as depending on the compiler flags it plays a game! - 2001/anonymous/anonymous.ten.c has to be compiled with -m32 and not all platforms are able to do this (glaring at macOS here). - Similarly to 2001/anonymous/anonymous.ten.c this too has to be compiled with -m32 and not all platforms permit code to be compiled as 32-bit. - 2004/gavin cannot be linked in some architectures / platforms like macOS. I actually have a fix I came up with the other day that lets it compile with macOS but it doesn't do anything either (I have one theory why that is). I might add this to the repo just so it can at least compile (via make alt). Even so this entry has some problems for modern systems including architecture. - One file in 2015/yang does not compile but I believe this to be the Makefile. I'll fix this in a near future commit if that is indeed the case. All other entries compile (many did not but I fixed many - including removing the need for -traditional-cpp; Landon also fixed a few and so did Yusuke Endoh)! Not all of those work however (in all platforms or at all). I have not tested all either. I am still in the process of this but these are of lower priority for the moment (though I might address some before the higher priority tasks if I don't feel up to said tasks but do feel up to these). This means we've made tremendous progress in issue #1! --- 1993/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1993/Makefile b/1993/Makefile index 9817da871..fd99fb42c 100644 --- a/1993/Makefile +++ b/1993/Makefile @@ -41,7 +41,7 @@ include ../var.mk # IOCCC winners ############### # -WINNERS= cmills dgibson ejb howe jonth leo lmfjyh plummer rince schnitzi vanb +WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb YEAR= 1993 From 6c07cc538d0e38e756574c139012b83ca8752a4f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 16 May 2023 03:36:20 -0700 Subject: [PATCH 14/21] Clean up 1993/lmfjyh on compilation error Now if the compilation fails (it relies on a bug in gcc version < 2.3.3) the bogus file is removed. It is not possible to check the gcc version in the source code because the file is copied from lmfjyh.c in the Makefile prior to the compilation. Well it's possible to check the gcc version but it's too late at that point - the file would have already been made :-) This prevents the user form having to do quoting of the file (risking making a mistake) or using -find . -inum ... -delete after obtaining the inode (ls -li). --- 1993/lmfjyh/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/1993/lmfjyh/Makefile b/1993/lmfjyh/Makefile index f3c79aca5..5502f2372 100644 --- a/1993/lmfjyh/Makefile +++ b/1993/lmfjyh/Makefile @@ -133,7 +133,8 @@ ${PROG}: ${PROG}.c ${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c ${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c ${CC} ${CFLAGS} \ - \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c -o $@ ${LIBS} + \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c -o $@ ${LIBS} || \ + ${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c # alternative executable # From f49ec223065883a26ee987e29127458314988c50 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 16 May 2023 04:54:57 -0700 Subject: [PATCH 15/21] Improve 2001/anonymous/README.md and try.me.sh Fix typo fix and format fix in 2001/anonymous/README.md. Improve try.me.sh: test compile as 32-bit anonymous.ten.c and exit if it cannot be done as it will otherwise not truly work right. I also observed that this _might_ not be fixed completely. The binary _is_ modified and _does_ run after execution, will crash on 64-bit binaries (and it's not supposed to work on 64-bit binaries and probably anything other than 32-bit ELF binaries) but the author comments are not entirely clear to me. It might be that the program is supposed to be run. At the same time though the compilation is unclear to me too: the entry itself need not be compiled and the binary isn't compiled either (is it supposed to be?) so why is it there? The program is at least partially fixed in that it used to crash no matter what and it does in any case modify the binary which was supposed to be done (and this is why I'm still unsure about why it does anything with compilation). Perhaps it's time to bring back the C pre-processed code but I will find more out in the coming days I hope and if necessary I will add this entry back to bugs.md and then look at fixing it after some higher priority things are finished. The higher priority thing in particular has to do with issue #4 but I have a number of already modified files that I would like to get committed before I continue on that to make my repo a clean state. I might or might not do that before but it might be that there are numerous commits prior to the CSV file being worked on again. --- 2001/anonymous/README.md | 76 ++++++++++++++++++++++++---------------- 2001/anonymous/try.me.sh | 50 +++++++++++++++----------- 2 files changed, 74 insertions(+), 52 deletions(-) diff --git a/2001/anonymous/README.md b/2001/anonymous/README.md index 51174e1d7..7b0394fd7 100644 --- a/2001/anonymous/README.md +++ b/2001/anonymous/README.md @@ -73,7 +73,8 @@ something funny if you run it on itself as well but see below :-) ./try.me.sh ``` -What happens if the x86 program has already been modified by this program? +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](anonymous.c)? Can you recompile it okay? What if you run it on `anonymous` itself? Can you run the @@ -90,37 +91,49 @@ 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](https://www.bbc.co.uk/teach/school-radio/nursery-rhymes-ten-green-bottles/zncyt39) program, already compiled -for the x86. The program 'ten', and its source (dull) are given as info -files. Warning: note that the translator screws around with the binary -you run on it, *will* corrupt the binary to some extent, and may leave -any program you run on it unusable. +I have included a simple [10 Green +Bottles](https://www.bbc.co.uk/teach/school-radio/nursery-rhymes-ten-green-bottles/zncyt39) +[program](anonymous.ten.c) (try `make anonymous.ten`), meant to be compiled in 32-bit. +The program `anonymous.ten`, and its source (dull) are included as data +files. -The build script should give an example command to run. +### Warning + +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. ### Features -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, -'ten'. +[Basic Block](https://en.wikipedia.org/wiki/Basic_block) +[Cache](https://en.wikipedia.org/wiki/Cache_(computing)): 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](anonymous.ten.c) which must be compiled as a 32-bit +binary. ### Target Library Linking: -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. +The program runs [dynamically +linked](https://en.wikipedia.org/wiki/Dynamic_linker) [ELF +binaries](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format), and +when the subject program attempts to make a call to a standard +[library](https://en.wikipedia.org/wiki/Library_(computing)), 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. ### Automatic Endian Detection/Reversal: -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 +There are various problems raised when attempting to run little +[endian](https://en.wikipedia.org/wiki/Endianness) +[x86](https://en.wikipedia.org/wiki/X86) code on a big endian chip, such as a +[PPC](https://en.wikipedia.org/wiki/PowerPC). These problems are dealt with in a manner that is entirely transparent to the user. ### Configuration: @@ -145,7 +158,7 @@ compiling the program without any optimization will allow it to run ### Obfuscation -The most obvious part of the obfuscation is probably the mess of defines at the +The most obvious part of the obfuscation is probably the mess of `#define`s 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 @@ -160,8 +173,8 @@ Buried under all this, and the fact that the entire program is just a call to `exit()`, 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 to pairs of functions of which only one has -local variables which shadow global variables; so one modifies the +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. There is also quite a nice trick where I wave a magic wand, and a chunk of code @@ -173,12 +186,13 @@ on to the next line of code. ### Limitations -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. +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](https://en.wikipedia.org/wiki/Loader_(computing)) does not really load +the [ELF binary](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format), +the target [library linking](https://en.wikipedia.org/wiki/Linker_(computing)) +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. diff --git a/2001/anonymous/try.me.sh b/2001/anonymous/try.me.sh index 4cc1af804..4d3163537 100755 --- a/2001/anonymous/try.me.sh +++ b/2001/anonymous/try.me.sh @@ -1,24 +1,32 @@ #!/usr/bin/env bash make clobber -make all 2>/dev/null -echo "$ cp anonymous.ten anonymous.ten.bak" 1>2 -cp anonymous.ten anonymous.ten.bak -echo "$ ./anonymous anonymous.ten" 1>&2 -./anonymous anonymous.ten -echo "$ ./anonymous.ten" 1>&2 -./anonymous.ten -echo "$ diff -s anonymous.ten anonymous.ten.bak" 1>&2 -diff -s anonymous.ten anonymous.ten.bak -echo "$ od anonymous.ten > ten.od" 1>&2 -od anonymous.ten > ten.od -echo "$ od anonymous.ten.bak > ten.bak.od" 1>&2 -od anonymous.ten.bak > ten.bak.od -echo "$ diff ten.bak.od ten.od" 1>&2 -diff ten.bak.od ten.od -echo "$ ./anonymous.ten > ten.txt" 1>&2 -./anonymous.ten > ten.txt -echo "$ ./anonymous.ten.bak > ten.bak.txt" 1>&2 -./anonymous.ten.bak > ten.bak.txt -echo "$ diff -s ten.txt ten.bak.txt" 1>&2 -diff -s ten.txt ten.bak.txt + +if [[ $(make anonymous.ten >/dev/null 2>&1) ]]; then + + make anonymous 2>/dev/null + echo "$ cp anonymous.ten anonymous.ten.bak" 1>&2 + cp anonymous.ten anonymous.ten.bak + echo "$ ./anonymous anonymous.ten" 1>&2 + ./anonymous anonymous.ten + echo "$ ./anonymous.ten" 1>&2 + ./anonymous.ten + echo "$ diff -s anonymous.ten anonymous.ten.bak" 1>&2 + diff -s anonymous.ten anonymous.ten.bak + echo "$ od -t x1 anonymous.ten > ten.od" 1>&2 + od -t x1 anonymous.ten > ten.od + echo "$ od -t x1 anonymous.ten.bak > ten.bak.od" 1>&2 + od -t x1 anonymous.ten.bak > ten.bak.od + echo "$ diff ten.bak.od ten.od" 1>&2 + diff ten.bak.od ten.od + echo "$ ./anonymous.ten > ten.txt" 1>&2 + ./anonymous.ten > ten.txt + echo "$ ./anonymous.ten.bak > ten.bak.txt" 1>&2 + ./anonymous.ten.bak > ten.bak.txt + echo "$ diff -s ten.txt ten.bak.txt" 1>&2 + diff -s ten.txt ten.bak.txt +else + echo + echo "cannot compile anonymous.ten.c as 32-bit, sorry." + exit 1 +fi From d3cdf798e4e9d897c1b83d55dc4de94cdfac0b37 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 17 May 2023 04:29:16 -0700 Subject: [PATCH 16/21] Minor update to bugs.md for 1996/jonth --- bugs.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bugs.md b/bugs.md index 3a2156bd1..0edf30e3b 100644 --- a/bugs.md +++ b/bugs.md @@ -955,8 +955,9 @@ that? According to `lldb` it is: (XID (*)(...)) $0 = 0x00000001003cd374 (libX11.6.dylib`XCreateWindow) ``` -so `w == XCreateWindow()`. But it never actually finishes its call; modifying -the code a bit and we see that it crashes before it returns: +so `w == XCreateWindow()` (which can also be seen in the code). But it never +actually finishes its call; modifying the code a bit and we see that it crashes +before it returns: ``` @@ -1178,6 +1179,7 @@ that version 2.95 works but maybe others do as well. Do you have a fix? We would appreciate your help! Do you have a fix for 64-bit compilation? Please provide it! + ## [2001/kev](2001/kev/kev.c) ([README.md](2001/kev/README.md) ## STATUS: INABIAF - please **DO NOT** fix From 49d1e9223d1b2cb6ebcffe2ffb0b431a30760467 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 17 May 2023 04:43:06 -0700 Subject: [PATCH 17/21] Updates to 2001/anonymous As it's uncertain (both to Landon and me) whether it's supposed to execute programs it is run on or only modify it which it does (if 32-bit ELF - which is the only kind it's supposed to act on) with my fix (see README.md for commit ids) I have added a new bug status: STATUS: might not be completely functional - can you confirm? and added this new status to this entry. When or if we figure out the functional status we will remove (if completely functional or we figure out what's wrong and fix it which of course is the ideal case) or change (if it is not completely functional) the status. If anyone knows the functionality status *please* let us know! I also updated the try.me.sh script to be quiet on make clobber so that if -m32 does not work nothing but the error message will be shown and if it does work only the commands and output of the commands will be shown. In other words make commands are not shown. --- 2001/anonymous/README.md | 13 ++++++++++--- 2001/anonymous/try.me.sh | 3 +-- bugs.md | 36 +++++++++++++++++++++++++++++------- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/2001/anonymous/README.md b/2001/anonymous/README.md index 7b0394fd7..82cec013a 100644 --- a/2001/anonymous/README.md +++ b/2001/anonymous/README.md @@ -19,9 +19,9 @@ make supplementary program and the program itself, both of which segfaulted. He managed to do this with linux but it will not work with macOS (see [bugs.md](/bugs.md) for why this is); this is not a bug but a feature inherent -in what it does. He said this took serious debugging and skill (shameless self -promotion but it's true :-) ) and we thank him _very much_! But what needed to -be changed? Although it took a fair bit of debugging it turns out all that +in what it does. + +Although it took a fair bit of debugging it turns out all that needed to be changed was: - `#include ` for `mmap()`. @@ -47,6 +47,13 @@ git diff c48629017117379a52b1a512ef8f2593ca9569c8..efdee208a2bc650256637b9357ddf git diff efdee208a2bc650256637b9357ddfd0de82d2f41..e9a3f77ea3b209e63ac3f9c06bb84ad86e5ea706 anonymous.c ``` +There's an another important point in [bugs.md](/bugs.md) about this entry, +however, in that we're not sure if the entry was supposed to run the program or +not as there is some inconsistency in the author's comments which we think might +have been intentional. + +Thank you Cody for your assistance! + ### WARNING on note from the author The author suggested that this will somewhat destroy the binaries this touches diff --git a/2001/anonymous/try.me.sh b/2001/anonymous/try.me.sh index 4d3163537..1df9c1838 100755 --- a/2001/anonymous/try.me.sh +++ b/2001/anonymous/try.me.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -make clobber +make clobber >/dev/null 2>&1 if [[ $(make anonymous.ten >/dev/null 2>&1) ]]; then @@ -26,7 +26,6 @@ if [[ $(make anonymous.ten >/dev/null 2>&1) ]]; then echo "$ diff -s ten.txt ten.bak.txt" 1>&2 diff -s ten.txt ten.bak.txt else - echo echo "cannot compile anonymous.ten.c as 32-bit, sorry." exit 1 fi diff --git a/bugs.md b/bugs.md index 0edf30e3b..039bf54c3 100644 --- a/bugs.md +++ b/bugs.md @@ -191,8 +191,18 @@ NOTE: we're still locating entries and working on fixes with this status so we'r ready for help. We will remove this when we are. Entries with this status might or might not have a bug possibly depending on the -system. In these entries we don't have the appropriate systems to test and fix -any problems. +system. In these entries it's unknown if there is a bug and sometimes it's +because we do not remember and sometimes we don't have the appropriate system or +environment to test and fix any possible problems. + +## STATUS: might not be completely functional - can you confirm? + +NOTE: we're still locating entries and working on fixes with this status so we're not yet +ready for help. We will remove this when we are. + +Although these entries _appear_ to work for one or more reasons we're unsure if +they are completely functional. Can you confirm this? Please let us know so we +can fix it! ## STATUS: probable bug (possibly depending on system) - please help test and if necessary fix @@ -1093,14 +1103,26 @@ fire](https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing))! :-) ). # 2001 ## [2001/anonymous](2001/anonymous/anonymous.c) ([README.md](2001/anonymous/README.md)) +## STATUS: might not be completely functional - can you confirm? + +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed a segfault in +both the entry and the supplementary program (both segfaulted) and it appears to +work in that it does do what the author suggests. However there is an +inconsistency in remarks about whether it should _execute_ the program it's run +on after modification or if it should _only modify_ it. With Cody's fix it +modifies the program, only works on 32-bit ELF binaries (by design) and the +binary still works but we do not know if it's supposed _additionally_ run it. +Can you confirm? Please let us know! + + ## STATUS: INABIAF - please **DO NOT** fix [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this so that it -works in modern systems but he notes that the program -[anonymous.ten.c](2001/anonymous/anonymous.ten.c) **MUST** be compiled as a -32-bit ELF binary! This because the program acts on 32-bit ELF binaries. If you -cannot use `-m32` on this file the program **will** almost certainly crash but -in no case will it work properly. +works (it segfaulted - but see above) in modern systems but he notes that the +program [anonymous.ten.c](2001/anonymous/anonymous.ten.c) **MUST** be compiled +as a 32-bit ELF binary! This is because the program only works on 32-bit ELF +binaries. If you cannot use `-m32` on the files it acts on the program **will** +almost certainly crash but in no case will it work properly. This means that for macOS it will not work. Why will this not work in macOS? Because Apple saw to it to make it very hard to compile 32-bit binaries (thanks From b28c34c93a4c942c0419f05f78a468ecf86d8779 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 17 May 2023 05:09:26 -0700 Subject: [PATCH 18/21] Typo and format fix 1995/README.md Funny and ironic fact: due to cold hands (unfortunately fan is on but I can't turn it off due to a cat between my legs) when I created a new branch for this (which has typo fixes) I initially left off a 9 in 1995. So there was almost a tpyo for a tpyo fix cmoimt. --- 1995/README.md | 116 +++++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/1995/README.md b/1995/README.md index f44ada07f..2fab13124 100644 --- a/1995/README.md +++ b/1995/README.md @@ -1,73 +1,75 @@ -1995 marked the "The Twelfth International Obfuscated C Code Contest" +# 1995 marked the "The Twelfth International Obfuscated C Code Contest" Look at the README.md file for the given winner for information -on how to compile the winner and how to run the winning program. -Look at the winning source and try to figure how it does what it does! -You may then wish to look at the Author's remarks for even more details. +on how to compile and run the winning program. Look at the winning source and +try to figure how it does what it does! You may then wish to look at the +`Author's remarks` section for even more details. -The IOCCC has an official home page: +The IOCCC has an official home page, , which contains +previous winning entries, information about the judges, announcements and much +more. - http://www.ioccc.org +Use `make` to compile entries. It is possible that on BSD or non-Unix +systems the `Makefile` needs to be changed. See the `Makefile` for details. -containing previous winning entries, information about the judges, -announcements and much more. - -Use make to compile entries. It is possible that on BSD or non-unix -systems the makefile needs to be changed. See the Makefile for details. - -Read over the makefile for compile/build issues. Your system may +Read over the `Makefile` for compile/build issues. Your system may require certain changes (add or remove a library, add or remove a -#define). +`#define`). -This year Sriram Srinivasan joined the judging. +This year [Sriram Srinivasan](http://www.malhar.net/sriram/) joined the judging. -The moderator of comp.unix.wizards did not feel that the IOCCC was "wizardly" -enough to be posted to comp.unix.wizards - we will no longer post the -winners to this newsgroup - we'll let you the reader decide for yourself the -wizardlyness of these entries. +The moderator of +[comp.unix.wizards](https://groups.google.com/g/comp.unix.wizards) did not feel +that the IOCCC was "wizardly" enough to be posted to comp.unix.wizards - we will +no longer post the winners to this newsgroup - we'll let you the reader decide +for yourself the wizardry of these entries. -This year there were several people who won more than once -and several previous winners who won this year. The judging was done -without knowledge of the names of the submitters - multiple winners were -a coincidence. Since we tend to discount entries that are similar to -previous winners, these people have had to come with original ideas to -stay in the winners circle. +This year there were several people who won more than once and several [previous +winners](/winners.html) as well. The judging was done without knowledge of the +names of the submitters - multiple winners were a coincidence. Since we tend to +discount entries that are similar to previous winners, these people had to come +with original ideas to stay in the winners circle. -We wish to thank CAIP at Rutgers University for the use of their machines. +We wish to thank [CAIP at Rutgers +University](https://catalogs.rutgers.edu/generated/nb-grad_0305/pg20199.html) +for the use of their machines. -A few notes regarding future contests -------------------------------------- +## A few notes regarding future contests -Due to changes in the Usenix conference calendar, the 1996 contest will -be delayed. Because there will be no Summer 1996 Usenix conference, -the 1996 IOCCC winners will be announced at the Jan 1997 Usenix -conference. +Due to changes in the [USENIX +conference](https://www.usenix.org/conferences/all) calendar, the [1996 +contest](/years.html#1996) will be delayed. Because there will be no Summer +1996 USENIX conference, the 1996 IOCCC winners will be announced at the Jan 1997 +USENIX conference. -The 1996 contest will not open until sometime in October 1996, and will -close sometime around the end of December 1996. The rules for the 1996 -contest have not been formed at this time and are not expected to be -ready for distribution until late September 1996. +The 1996 contest will not open until sometime in October 1996, and will close +sometime around the end of December 1996. The [rules for the 1996 +contest](/1996/rules.txt) have not been formed at this time and are not expected +to be ready for distribution until late September 1996. -Be sure to wait until the 1996 rules are posted before submitting entries. -Rules differ from year to year, sometimes in significant ways. +Be sure to wait until the [1996 rules](/1996/rules.txt) are posted before +submitting entries. Rules differ from year to year, sometimes in significant +ways. Please send us comments and suggestions what we have expressed above. Also include anything else that you would like to see in future contests. Send such email to: - ...!{sun,pacbell,uunet,pyramid}!hoptoad!judges - judges@toad.com - +``` +...!{sun,pacbell,uunet,pyramid}!hoptoad!judges +judges@toad.com +``` If you use, distribute or publish these entries in some way, please drop us a line. We enjoy seeing who, where and how the contest is used. -If you have problems with any of the entries, AND YOU HAVE A FIX, please -email the fix (patch file or the entire changed file) to the above address. +If you have problems with any of the entries, AND IF YOU HAVE A FIX, please +submit a [GitHub pull +request](https://github.com/ioccc-src/temp-test-ioccc/pulls) (with ONE PULL +REQUEST *PER* FIX, please). -Credits -------- +## Credits We would like to thank Barbara Frezza for her role as official chef of the contest. Landon Noll, Larry Bassel and Sriram Srinivasan @@ -75,7 +77,7 @@ appreciated the opportunity to serve as official taste testers. And as usual, the food was excellent. The official menus of the 1995 Obfuscated C Contest dinners were: -Session One: +### Session One: Antipasti: Crudites, olive selection, pickles, cheese selection Soup: Homemade mushroom and green onion soup @@ -84,7 +86,7 @@ Salad: artichoke, red bell peppers, Italian onions, cucumbers Main Course: Pizzas, with a variety of toppings Dessert: Chocolate torte -Session Two: +### Session Two: Antipasti: crudites, olives, roasted red peppers, cheese selection Salad: Mixed greens with vinaigrette @@ -95,16 +97,16 @@ Dessert: Cookie selection, featuring chocolate chocolate chip cookies and chocolate butter cookies -Session Three +### Session Three Antipasti: Crudites, olive selection Salad: Mixed greens with mustard vinaigrette -Main Course: Broiled salmon with lemmon pepper mayonnaise, chard, mixture +Main Course: Broiled salmon with lemon pepper mayonnaise, chard, mixture of white and wild rices Bread: Cheese bread with herbs -Dessert: Chocolate cheesecake (Coutesy of Elizabeth Watson) +Dessert: Chocolate cheesecake (Courtesy of Elizabeth Watson) -Session Four: +### Session Four: Antipasti: Crudites, olive selection, roasted red peppers, cheese selection Bread: Sourdough @@ -114,29 +116,29 @@ Main Course: Surf and Turf--Grilled steaks of salmon and New York steak wild rice Dessert: Chocolate mousse -Session Five: +### Session Five: Antipasti: Crudites, olive selection, pickles Salad: Mixed spring greens with mustard vinaigrette -Main Course: Linguini with a cream sauce of Shiitaki mushrooms and smoked +Main Course: Linguini with a cream sauce of shiitake mushrooms and smoked salmon Bread: Garlic bread -Dessert: Flourless chocolate torte +Dessert: Flour-less chocolate torte -Session Six: +### Session Six: Antipasti: Carrot and celery sticks with cheese spread, olive selection, pickles Bread: Focaccia with black olives and mozzarella cheeses Salad: Mixed spring greens with flowers and mustard vinaigrette Soup: Homemade butternut squash soup with mushrooms -Main Course: Cracked dungeness crab with lemon mayonnaise, broccoli, +Main Course: Cracked Dungeness crab with lemon mayonnaise, broccoli, mixture of white and brown rice Dessert: Key lime pie =-= -Copyright (c) 1996, Landon Curt Noll, Larry Bassel & Sriram Srinivasan. +Copyright (c) 1995, Landon Curt Noll, Larry Bassel & Sriram Srinivasan. All Rights Reserved. Permission for personal, educational or non-profit use is granted provided this this copyright and notice are included in its entirety and remains unaltered. All other uses must receive prior permission in writing From d99053cc445566fe17037c7a1609fc4de493b51a Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 17 May 2023 05:23:06 -0700 Subject: [PATCH 19/21] Add note about typoglycaemia in 2020/kurdyukov3 --- 2020/kurdyukov3/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/2020/kurdyukov3/README.md b/2020/kurdyukov3/README.md index 33fe32747..a0d0a503f 100644 --- a/2020/kurdyukov3/README.md +++ b/2020/kurdyukov3/README.md @@ -47,6 +47,13 @@ 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](https://www.mrc-cbu.cam.ac.uk/personal/matt.davis/Cmabrigde/) +(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). + ## Author's remarks: ### Letter Mixer ### From e17d204c2edeebf90ef322bd39c70406262f29f7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 17 May 2023 05:58:12 -0700 Subject: [PATCH 20/21] Add country code to winners.csv for Don Dodson --- tmp/winners.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmp/winners.csv b/tmp/winners.csv index 4811fbcec..da5fd7de3 100644 --- a/tmp/winners.csv +++ b/tmp/winners.csv @@ -59,7 +59,7 @@ deckmyn,Alex Deckmyn,Alex_Deckmyn,null,alex.deckmyn@gmail.com,BE,null,null,null, decot,Dave Decot,Dave_Decot,null,null,null,null,null,null, deorowicz,Sebastian Deorowicz,Sebastian_Deorowicz,http://sun.aei.polsl.pl/~sdeor/,sdeorowicz@gmail.com,null,null,null,null, diels-grabsch,Volker Diels-Grabsch,Volker_Diels-Grabsch,https://njh.eu,v@njh.eu,DE,null,null,null, -dodson,Don Dodson,Don_Dodson,http://www.neta.com/~dodson/,null,null,null,null,null, +dodson,Don Dodson,Don_Dodson,http://www.neta.com/~dodson/,null,US,null,null,null, dogon,Gil Dogon,Gil_Dogon,null,gil.jade@gmail.com,IL,null,null,null, dorsselaer,Frans van Dorsselaer,Frans van Dorsselaer,null,frans@biabv.com,null,null,null,null, dorward,Sean Dorward,Sean_Dorward,null,null,null,null,null,null, From a3717aeadc5bac2fa41a4dcc49672ba872731b56 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 17 May 2023 06:01:01 -0700 Subject: [PATCH 21/21] Add missing handles to winner-handles.csv This also removes winning entries from the few that were there but this is important for some ideas I have had on how to generate the target file though that might not be done today. --- tmp/winner-handles.csv | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/tmp/winner-handles.csv b/tmp/winner-handles.csv index 403578a87..bb33a7760 100644 --- a/tmp/winner-handles.csv +++ b/tmp/winner-handles.csv @@ -1,10 +1,3 @@ -Brian_Westley,1987_westley,1988_westley,1989_westley,1990_westley,1991 westley,1992_westley,1994_westley,1996_westley,2001_westley, -Cody_Boone_Ferguson,2018_ferguson,2020_ferguson1,2020_ferguson2, -David_Korn,1987_korn, -Don_Yang,2015_yang,2018_yang,2019_yang,2020_yang, -Jack_Applin,1985_applin,1986_applin,1988_applin, -Matt_Zucker,2011_zucker, -Ondrej_Adamovsky,2019_adamovsky, Aaron_Grothe Adar_Zeitak Adrian_Cable @@ -19,6 +12,10 @@ Andrea_Marangoni Andreas_Gustafsson Andrew_Shapiro Andy_Sloane +Anonymous_1984 +Anonymous_2004 +Anonymous_2005 +Anonymous_2015 Anthony_C_Howe Anton_Algmyr Arch_D_Robison @@ -28,6 +25,7 @@ Bas_de_Bakker Ben_Lynn Bernd_Meyer Brent_Burley +Brian_Westley Bruce_Holloway Byron_Rakitzis Carl_Banks @@ -38,15 +36,18 @@ Chris_King Christian_Dupont Christopher_Mills Christopher_Night +Cody_Boone_Ferguson Col_G_L_Sicherman Craig_Schneiderwent Daniel_Fischer +Daniel_J._Bernstein Daniel_Vik Dave_Burton Dave_Decot David_Applegate David_Gibson David_Goodenough +David_Korn David_Madore David_Van_Brackle Dean_Swift @@ -54,6 +55,7 @@ Derek_Anderson Diomidis_Spinellis Dominik_Muth Don_Dodson +Don_Yang Doron_Osovlanski Doug_Beardsley E_Jay_Berkenbilt @@ -68,7 +70,7 @@ Etienne_Duble Fabrice_Bellard Ferenc_Deak Francois_Boutines -Frans_van_Dorsselaer +Frans van Dorsselaer Freek_Wiedijk Garry_Glendown Gavin_Barraclough @@ -83,6 +85,7 @@ Ian_Phillipps Ilya_Kurdyukov Immanuel_Herrmann J_David_Lowe +Jack_Applin James_A_Woods James_Bonfield Jan_Stein @@ -101,6 +104,7 @@ Jon_Thingvold Jonathan_Hoyle Joshua_Karns Jyrki_Holopainen +Karl_F._Fox Ken_Huffman Kevin_Pulo Kimmo_Fredriksson @@ -117,6 +121,7 @@ Mark_Isaak Mark_Plummer Mark_Schnitzius Mary_Ann_Horton +Matt_Zucker Maurizio_Monge Mauro_Persano Michael_Ash @@ -132,6 +137,7 @@ Neil_Mix Nicholas_Carlini Nick_Johnson Nicolas_Ollinger +Ondrej_Adamovsky Ora_Lassila Oscar_Toledo Oskar_von_der_Luehe @@ -143,6 +149,7 @@ Peter_Eastman Peter_J_Ruczynski Peter_Klausler Philip_Blakely +Pierre-Philippe_Coupard Qiming_HOU Raphael_Meyer Raymond_Cheong @@ -174,13 +181,17 @@ Thomas_P_John Thomas_Stewart Thor_Eldby Timo_Poikola +Tom_Torfs Tony_Finch Tsukasa_Hamano Uri_Goren V_Chia Vern_Paxson Vincent_Weaver +Volker_Diels-Grabsch Walter_Bright Yusuke_Endoh -_tsoj +Yves-Marie_Morgan bsoup +tsoj +winner_handle