From 3ddbac9e6be83611a8589032d2c0235deda43183 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Fri, 12 Apr 2024 11:45:50 -0700 Subject: [PATCH] improve how markdown code language is commented We added a space between the markdown triple code mark and language that was enclosed in HTML comments. So a line of the form: ```` ``` ```` became: ```` ``` ```` This was done to **help** some code see that the HTML comment string was not a markdown code specifier. Not all code understands this after this changed. For example, `pandoc(1)` still forms HTML classes of the form "<!---c-->" when it encounters the above mentioned change. We also fixed a problem with `2019/dogon/README.md` regarding a markdown code block. We also fixed a problem with `2020/yang/README.md` regarding a markdown code block. --- 1984/anonymous/README.md | 8 +- 1984/decot/README.md | 14 +-- 1984/laman/README.md | 10 +- 1984/mullender/README.md | 24 ++-- 1985/applin/README.md | 4 +- 1985/august/README.md | 8 +- 1985/lycklama/README.md | 14 +-- 1985/shapiro/README.md | 10 +- 1985/sicherman/README.md | 14 +-- 1986/applin/README.md | 6 +- 1986/august/README.md | 4 +- 1986/bright/README.md | 6 +- 1986/hague/README.md | 6 +- 1986/holloway/README.md | 4 +- 1986/marshall/README.md | 8 +- 1986/marshall/compilers.md | 4 +- 1986/pawka/README.md | 4 +- 1986/stein/README.md | 6 +- 1986/wall/README.md | 4 +- 1987/biggar/README.md | 6 +- 1987/heckbert/README.md | 8 +- 1987/hines/README.md | 6 +- 1987/korn/README.md | 12 +- 1987/lievaart/README.md | 6 +- 1987/wall/README.md | 8 +- 1987/westley/README.md | 4 +- 1988/applin/README.md | 6 +- 1988/dale/README.md | 6 +- 1988/isaak/README.md | 10 +- 1988/litmaath/README.md | 14 +-- 1988/phillipps/README.md | 2 +- 1988/reddy/README.md | 6 +- 1988/robison/README.md | 8 +- 1988/spinellis/README.md | 12 +- 1988/westley/README.md | 16 +-- 1989/fubar/README.md | 6 +- 1989/jar.1/README.md | 10 +- 1989/jar.2/README.md | 8 +- 1989/ovdluhe/README.md | 12 +- 1989/paul/README.md | 8 +- 1989/robison/README.md | 6 +- 1989/roemer/README.md | 4 +- 1989/tromp/README.md | 10 +- 1989/vanb/README.md | 4 +- 1989/westley/README.md | 22 ++-- 1990/baruch/README.md | 8 +- 1990/cmills/README.md | 6 +- 1990/dds/README.md | 6 +- 1990/dg/README.md | 12 +- 1990/jaw/README.md | 12 +- 1990/pjr/README.md | 12 +- 1990/scjones/README.md | 6 +- 1990/stig/README.md | 6 +- 1990/tbr/README.md | 18 +-- 1990/theorem/README.md | 16 +-- 1990/westley/README.md | 10 +- 1991/README.md | 2 +- 1991/ant/README.md | 10 +- 1991/brnstnd/README.md | 4 +- 1991/buzzard/README.md | 10 +- 1991/cdupont/README.md | 6 +- 1991/davidguy/README.md | 8 +- 1991/dds/README.md | 8 +- 1991/fine/README.md | 6 +- 1991/rince/README.md | 12 +- 1991/westley/README.md | 18 +-- 1992/adrian/README.md | 22 ++-- 1992/albert/README.md | 14 +-- 1992/ant/README.md | 6 +- 1992/buzzard.1/README.md | 22 ++-- 1992/buzzard.2/README.md | 18 +-- 1992/gson/README.md | 14 +-- 1992/imc/README.md | 8 +- 1992/kivinen/README.md | 8 +- 1992/lush/README.md | 4 +- 1992/marangon/README.md | 4 +- 1992/nathan/README.md | 8 +- 1992/vern/README.md | 8 +- 1992/westley/README.md | 18 +-- 1993/ant/README.md | 6 +- 1993/cmills/README.md | 8 +- 1993/dgibson/README.md | 6 +- 1993/ejb/README.md | 12 +- 1993/jonth/README.md | 4 +- 1993/leo/README.md | 6 +- 1993/lmfjyh/README.md | 12 +- 1993/plummer/README.md | 14 +-- 1993/rince/README.md | 12 +- 1993/schnitzi/README.md | 10 +- 1993/vanb/README.md | 14 +-- 1994/dodsond1/README.md | 4 +- 1994/dodsond2/README.md | 10 +- 1994/horton/README.md | 14 +-- 1994/imc/README.md | 6 +- 1994/ldb/README.md | 6 +- 1994/schnitzi/README.md | 16 +-- 1994/shapiro/README.md | 6 +- 1994/smr/README.md | 6 +- 1994/tvr/README.md | 14 +-- 1994/weisberg/README.md | 12 +- 1994/westley/README.md | 22 ++-- 1995/cdua/README.md | 12 +- 1995/dodsond1/README.md | 8 +- 1995/dodsond2/README.md | 4 +- 1995/esde/README.md | 6 +- 1995/garry/README.md | 18 +-- 1995/heathbar/README.md | 6 +- 1995/leo/README.md | 18 +-- 1995/makarios/README.md | 4 +- 1995/savastio/README.md | 6 +- 1995/schnitzi/README.md | 6 +- 1995/spinellis/README.md | 4 +- 1995/vanschnitz/README.md | 12 +- 1996/august/README.md | 36 +++--- 1996/dalbec/README.md | 6 +- 1996/eldby/README.md | 8 +- 1996/gandalf/README.md | 8 +- 1996/huffman/README.md | 8 +- 1996/jonth/README.md | 8 +- 1996/rcm/README.md | 8 +- 1996/schweikh1/README.md | 6 +- 1996/schweikh2/README.md | 16 +-- 1996/schweikh3/README.md | 10 +- 1996/westley/README.md | 12 +- 1998/banks/README.md | 14 +-- 1998/bas1/README.md | 4 +- 1998/bas2/README.md | 6 +- 1998/chaos/README.md | 8 +- 1998/df/README.md | 6 +- 1998/dlowe/README.md | 18 +-- 1998/dloweneil/README.md | 10 +- 1998/dorssel/README.md | 16 +-- 1998/dorssel/dorssel.md | 10 +- 1998/fanf/README.md | 8 +- 1998/schnitzi/README.md | 12 +- 1998/schweikh1/README.md | 20 ++-- 1998/schweikh1/macos.md | 4 +- 1998/schweikh2/README.md | 28 ++--- 1998/schweikh3/README.md | 20 ++-- 1998/tomtorfs/README.md | 14 +-- 2000/anderson/README.md | 6 +- 2000/bellard/README.md | 4 +- 2000/bmeyer/README.md | 22 ++-- 2000/briddlebane/README.md | 6 +- 2000/dhyang/README.md | 6 +- 2000/dlowe/README.md | 10 +- 2000/jarijyrki/README.md | 14 +-- 2000/natori/README.md | 12 +- 2000/primenum/README.md | 8 +- 2000/rince/README.md | 16 +-- 2000/robison/README.md | 4 +- 2000/schneiderwent/README.md | 10 +- 2000/thadgavin/README.md | 22 ++-- 2000/tomx/README.md | 10 +- 2001/anonymous/README.md | 10 +- 2001/bellard/README.md | 14 +-- 2001/cheong/README.md | 10 +- 2001/coupard/README.md | 10 +- 2001/ctk/README.md | 8 +- 2001/dgbeards/README.md | 8 +- 2001/herrmann1/README.md | 20 ++-- 2001/herrmann2/README.md | 14 +-- 2001/jason/README.md | 6 +- 2001/kev/README.md | 28 ++--- 2001/ollinger/README.md | 6 +- 2001/rosten/README.md | 14 +-- 2001/schweikh/README.md | 8 +- 2001/westley/README.md | 18 +-- 2001/williams/README.md | 4 +- 2004/anonymous/README.md | 8 +- 2004/arachnid/README.md | 12 +- 2004/burley/README.md | 4 +- 2004/gavare/README.md | 16 +-- 2004/gavin/README.md | 18 +-- 2004/hibachi/README.md | 18 +-- 2004/hoyle/README.md | 10 +- 2004/jdalbec/README.md | 14 +-- 2004/kopczynski/README.md | 10 +- 2004/newbern/README.md | 10 +- 2004/omoikane/README.md | 6 +- 2004/schnitzi/README.md | 10 +- 2004/sds/README.md | 14 +-- 2004/vik1/README.md | 8 +- 2004/vik2/README.md | 12 +- 2005/aidan/README.md | 24 ++-- 2005/anon/README.md | 26 ++--- 2005/boutines/README.md | 10 +- 2005/chia/README.md | 4 +- 2005/giljade/README.md | 10 +- 2005/jetro/README.md | 4 +- 2005/klausler/README.md | 6 +- 2005/mikeash/README.md | 12 +- 2005/mynx/README.md | 18 +-- 2005/persano/README.md | 14 +-- 2005/sykes/README.md | 22 ++-- 2005/timwi/README.md | 6 +- 2005/toledo/README.md | 14 +-- 2005/vik/README.md | 14 +-- 2005/vince/README.md | 6 +- 2006/birken/README.md | 6 +- 2006/borsanyi/README.md | 8 +- 2006/grothe/README.md | 10 +- 2006/hamre/README.md | 8 +- 2006/meyer/README.md | 10 +- 2006/monge/README.md | 34 +++--- 2006/night/README.md | 8 +- 2006/sloane/README.md | 12 +- 2006/stewart/README.md | 10 +- 2006/sykes1/README.md | 26 ++--- 2006/sykes2/README.md | 6 +- 2006/toledo1/README.md | 8 +- 2006/toledo2/README.md | 12 +- 2006/toledo3/README.md | 10 +- 2011/akari/README.md | 18 +-- 2011/blakely/README.md | 16 +-- 2011/borsanyi/README.md | 6 +- 2011/dlowe/README.md | 24 ++-- 2011/eastman/README.md | 8 +- 2011/fredriksson/README.md | 20 ++-- 2011/goren/README.md | 10 +- 2011/hamaji/README.md | 14 +-- 2011/hou/README.md | 10 +- 2011/konno/README.md | 6 +- 2011/richards/README.md | 6 +- 2011/toledo/README.md | 8 +- 2011/vik/README.md | 22 ++-- 2011/zucker/README.md | 20 ++-- 2012/blakely/README.md | 10 +- 2012/deckmyn/README.md | 14 +-- 2012/deckmyn/deckmyn.md | 4 +- 2012/dlowe/README.md | 6 +- 2012/endoh1/README.md | 30 ++--- 2012/endoh2/README.md | 12 +- 2012/grothe/README.md | 12 +- 2012/hamano/README.md | 10 +- 2012/hou/README.md | 10 +- 2012/hou/hint.md | 8 +- 2012/kang/README.md | 16 +-- 2012/konno/README.md | 14 +-- 2012/omoikane/README.md | 20 ++-- 2012/tromp/README.md | 38 +++--- 2012/vik/README.md | 22 ++-- 2012/zeitak/README.md | 12 +- 2013/README.md | 4 +- 2013/birken/README.md | 22 ++-- 2013/cable1/README.md | 18 +-- 2013/cable2/README.md | 6 +- 2013/cable3/README.md | 20 ++-- 2013/dlowe/README.md | 18 +-- 2013/endoh1/README.md | 22 ++-- 2013/endoh2/README.md | 6 +- 2013/endoh3/README.md | 20 ++-- 2013/endoh4/README.md | 22 ++-- 2013/hou/README.md | 10 +- 2013/mills/README.md | 8 +- 2013/misaka/README.md | 30 ++--- 2013/morgan1/README.md | 6 +- 2013/morgan2/README.md | 6 +- 2013/robison/README.md | 6 +- 2014/birken/README.md | 24 ++-- 2014/deak/README.md | 14 +-- 2014/endoh1/README.md | 10 +- 2014/endoh1/spoilers.md | 6 +- 2014/endoh2/README.md | 6 +- 2014/maffiodo1/README.md | 14 +-- 2014/maffiodo2/README.md | 20 ++-- 2014/morgan/README.md | 6 +- 2014/sinon/README.md | 10 +- 2014/skeggs/README.md | 4 +- 2014/vik/README.md | 16 +-- 2014/wiedijk/README.md | 8 +- 2015/burton/README.md | 18 +-- 2015/dogon/README.md | 12 +- 2015/duble/README.md | 20 ++-- 2015/endoh1/README.md | 8 +- 2015/endoh2/README.md | 10 +- 2015/endoh3/README.md | 10 +- 2015/endoh4/README.md | 10 +- 2015/hou/README.md | 10 +- 2015/howe/README.md | 8 +- 2015/mills1/README.md | 14 +-- 2015/mills2/README.md | 10 +- 2015/muth/README.md | 14 +-- 2015/schweikhardt/README.md | 44 +++---- 2015/yang/README.md | 16 +-- 2018/algmyr/README.md | 12 +- 2018/anderson/README.md | 12 +- 2018/bellard/README.md | 10 +- 2018/burton1/README.md | 22 ++-- 2018/burton2/README.md | 26 ++--- 2018/ciura/README.md | 10 +- 2018/endoh1/README.md | 12 +- 2018/endoh2/README.md | 6 +- 2018/ferguson/README.md | 76 ++++++------ 2018/giles/README.md | 6 +- 2018/hou/README.md | 6 +- 2018/mills/README.md | 22 ++-- 2018/poikola/README.md | 10 +- 2018/vokes/README.md | 6 +- 2018/yang/README.md | 18 +-- 2019/adamovsky/README.md | 14 +-- 2019/burton/README.md | 12 +- 2019/ciura/README.md | 12 +- 2019/diels-grabsch1/README.md | 12 +- 2019/diels-grabsch2/README.md | 8 +- 2019/dogon/README.md | 10 +- 2019/dogon/index.html | 6 +- 2019/duble/README.md | 20 ++-- 2019/endoh/README.md | 16 +-- 2019/giles/README.md | 10 +- 2019/karns/README.md | 16 +-- 2019/lynn/README.md | 22 ++-- 2019/mills/README.md | 44 +++---- 2019/poikola/README.md | 20 ++-- 2019/yang/README.md | 30 ++--- 2020/burton/README.md | 14 +-- 2020/carlini/README.md | 46 ++++---- 2020/endoh1/README.md | 12 +- 2020/endoh2/README.md | 10 +- 2020/endoh3/README.md | 12 +- 2020/ferguson1/COMPILING.md | 14 +-- 2020/ferguson1/HACKING.md | 26 ++--- 2020/ferguson1/README.md | 8 +- 2020/ferguson1/bugs.md | 14 +-- 2020/ferguson1/cannibalism.log.md | 2 +- 2020/ferguson1/crazy.log.md | 2 +- 2020/ferguson1/gameplay.md | 40 +++---- 2020/ferguson1/spoilers.md | 20 ++-- 2020/ferguson1/terminals.md | 26 ++--- 2020/ferguson1/troubleshooting.md | 12 +- 2020/ferguson2/README.md | 48 ++++---- 2020/ferguson2/obfuscation.md | 24 ++-- 2020/ferguson2/recode.md | 42 +++---- 2020/giles/README.md | 10 +- 2020/kurdyukov1/README.md | 8 +- 2020/kurdyukov2/README.md | 26 ++--- 2020/kurdyukov3/README.md | 10 +- 2020/kurdyukov4/README.md | 12 +- 2020/otterness/README.md | 8 +- 2020/tsoj/README.md | 10 +- 2020/yang/README.md | 14 +-- 2020/yang/index.html | 14 +-- README.md | 2 +- archive/historic/README.md | 4 +- author/README.md | 22 ++-- bin/README.md | 98 ++++++++-------- bugs.md | 118 +++++++++---------- contact.html | 10 +- faq.html | 21 ++++ faq.md | 186 +++++++++++++++--------------- news.md | 2 +- status.html | 2 +- status.json | 2 +- status.md | 6 +- thanks-for-help.md | 126 ++++++++++---------- tmp/OLD_manifest/README.md | 14 +-- tmp/README.md | 4 +- 357 files changed, 2432 insertions(+), 2399 deletions(-) diff --git a/1984/anonymous/README.md b/1984/anonymous/README.md index d90dbe252..3454dfc0d 100644 --- a/1984/anonymous/README.md +++ b/1984/anonymous/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./anonymous ``` @@ -22,7 +22,7 @@ as the alternate code. See below for the tattoo side-by-side with the code. ### Alternate build: -``` +``` make alt ``` @@ -31,7 +31,7 @@ as the alternate code. See below for the tattoo side-by-side with the code. NOTE: this version might not work on some systems like macOS. -``` +``` ./anonymous.alt ``` diff --git a/1984/decot/README.md b/1984/decot/README.md index 37a9af299..e52a2a22a 100644 --- a/1984/decot/README.md +++ b/1984/decot/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -22,7 +22,7 @@ For more detailed information see [1984 decot bugs](../../bugs.html#1984_decot). ## To use: -``` +``` ./decot ``` @@ -36,14 +36,14 @@ can use this version. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./decot.alt ``` @@ -61,13 +61,13 @@ the judges offer this one comment: understand remarks! Some new (in 1984) compilers disliked line 15 of the original source, so we changed it from: -``` +``` for(signal=0;*k * x * __FILE__ *i;) do { ``` to: -``` +``` for(signal=0;*k *x * __FILE__ *i;) do { ``` @@ -75,7 +75,7 @@ To see what we mean look at the [original source file](decot.orig.c). The [alternate code](decot.alt.c) is the version that has this modification. The fixed version has instead: -``` +``` for(signal=0;*k *= * __FILE__ *i;) do { ``` diff --git a/1984/laman/README.md b/1984/laman/README.md index 845ded6eb..b8070811d 100644 --- a/1984/laman/README.md +++ b/1984/laman/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./laman ``` @@ -17,7 +17,7 @@ The program accepts ONE POSITIVE number. Seeing is believing, so try things like: -``` +``` ./try.sh ./laman 4 @@ -33,14 +33,14 @@ This code should run you in circles. Some new compilers (in 1984) dislike lines 6 and 10 of the source, so we changed them from: -``` +``` ;++f)a[ b<<5|c] =d++,b+ =e;for( f=0;f +``` ;++f)a[ b<<5|c] =d++,b+= e;for( f=0;f +``` make alt ``` @@ -24,7 +24,7 @@ For more detailed information see [1984 mullender bugs](../../bugs.html#1984_mul ## To use: -``` +``` ./mullender.alt [microseconds] ``` @@ -48,7 +48,7 @@ which is probably not as uncommon as you think :-). ## Try: -``` +``` ./mullender.alt ./mullender.alt 5000 # wait for 5000 microseconds and see what happens @@ -72,14 +72,14 @@ machine dependent code was discouraged. ### Original build: -``` +``` make all ``` ### Original use: -``` +``` ./mullender ``` @@ -137,19 +137,19 @@ Repo](https://github.com/dspinellis/unix-history-repo/tree/Research-Release). `gentab.c` can be built like: -``` +``` make gentab ``` ### gentab use: -``` +``` ./gentab file ``` ### gentab try: -``` +``` ./gentab gentab > g.c ``` @@ -256,7 +256,7 @@ separate. The [PDP](https://en.wikipedia.org/wiki/Programmed_Data_Processor) and [VAX](https://en.wikipedia.org/wiki/VAX) codes implement the same algorithm: -``` +``` for (;;) { write(1, " :-)\b\b\b\b", 9); delay(); @@ -284,7 +284,7 @@ We started with writing the We both knew [PDP-11](https://en.wikipedia.org/wiki/PDP-11) assembly so that was no problem. The assembly code we came up with is as follows: -``` +``` pdp: mov pc,r4 tst -(r4) @@ -331,7 +331,7 @@ VAX code in C and massaged the program that we came up with is as follows: -``` +``` vax: .word 0400 + (pdp - vax) / 2 - 1 1: pushl $9 @@ -389,7 +389,7 @@ extracted the machine code from the object file. > NOTE from judges: see [gentab.c](gentab.c) for a copy of this file that can be compiled in modern systems. -``` +``` #include #include diff --git a/1985/applin/README.md b/1985/applin/README.md index 9355efb8b..4ca6e48c3 100644 --- a/1985/applin/README.md +++ b/1985/applin/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./applin ``` diff --git a/1985/august/README.md b/1985/august/README.md index 1750590b3..5f6ac2d08 100644 --- a/1985/august/README.md +++ b/1985/august/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./august ``` ## Try: -``` +``` ./try.sh ``` @@ -22,7 +22,7 @@ If you have the `primes(6)` tool (sometimes part of [BSD Games](https://github.com/vattam/BSDGames)) you can see what of the output in the first `N` (say `15` or `25`) lines are primes: -``` +``` ./primes.sh # 15 ./primes.sh 25 ``` diff --git a/1985/lycklama/README.md b/1985/lycklama/README.md index 594552f67..7b315f1db 100644 --- a/1985/lycklama/README.md +++ b/1985/lycklama/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make alt ``` ## To use: -``` +``` ./lycklama.alt < some_file ``` @@ -24,13 +24,13 @@ call with a configurable time to sleep. The default is 500 microseconds but you reconfigure it like: -``` +``` make SLEEP=700 clobber alt ``` which would set it at 700. Then, whether you use the default value or not, try: -``` +``` ./try.alt.sh ``` @@ -45,21 +45,21 @@ modern systems. ### Original build: -``` +``` make all ``` ### Original use: -``` +``` ./lycklama < some_file ``` ### Original try: -``` +``` ./lycklama < lycklama.c ./lycklama < lycklama.alt.c ./lycklama < lycklama.orig.c diff --git a/1985/shapiro/README.md b/1985/shapiro/README.md index a61165a9d..31e04eaeb 100644 --- a/1985/shapiro/README.md +++ b/1985/shapiro/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -10,7 +10,7 @@ There is alternate code which allows one to change the size of the maze. See ### To run: -``` +``` ./shapiro ``` @@ -23,7 +23,7 @@ of the maze. The alt code allows one to easily do this. ### Alternate build: -``` +``` make alt ``` @@ -32,7 +32,7 @@ of the maze. The alt code allows one to easily do this. If you wish to change the value you can do it like: -``` +``` make clobber SIZE=5 alt ``` @@ -41,7 +41,7 @@ error. If it's <= 0 || >= 5000 then it is set to 39, the default. You might also wish to try: -``` +``` ./try.alt.sh ``` diff --git a/1985/sicherman/README.md b/1985/sicherman/README.md index 31c45cf22..5c6fc3ac2 100644 --- a/1985/sicherman/README.md +++ b/1985/sicherman/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -11,7 +11,7 @@ more details on it. ## To use: -``` +``` ./sicherman < file echo foo | ./sicherman @@ -23,7 +23,7 @@ more details on it. ## Try: -``` +``` ./try.sh ``` @@ -43,7 +43,7 @@ audience. Although this will be built if the original fails to compile you can do it manually like: -``` +``` make alt ``` @@ -52,14 +52,14 @@ In this case it will be built as `sicherman.alt`. ### Alternate use: -``` +``` ./sicherman.alt < file ``` ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -80,7 +80,7 @@ on a line. Now enter the letters 'n' through 'z'. But to borrow a quote from Richard Stallman: If you think you understand what this code does, then you don't, so read it again! Explain why: -``` +``` ./sicherman < sicherman.c | ./sicherman | diff - ./sicherman.c ``` diff --git a/1986/applin/README.md b/1986/applin/README.md index 95c15bf30..cc1dea2a4 100644 --- a/1986/applin/README.md +++ b/1986/applin/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./applin ``` ## Try: -``` +``` ./applin.c ``` diff --git a/1986/august/README.md b/1986/august/README.md index 61fd004ca..17652b2b6 100644 --- a/1986/august/README.md +++ b/1986/august/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1986 august bugs](../../bugs.html#1986_august ## Try: -``` +``` ./august ``` diff --git a/1986/bright/README.md b/1986/bright/README.md index 210e99a2f..213923a50 100644 --- a/1986/bright/README.md +++ b/1986/bright/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./bright some_file ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1986/hague/README.md b/1986/hague/README.md index f900d03b6..b6c751a40 100644 --- a/1986/hague/README.md +++ b/1986/hague/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./hague 2>/dev/null # enter some text ``` @@ -15,7 +15,7 @@ ## Try: -``` +``` ./try.sh ``` diff --git a/1986/holloway/README.md b/1986/holloway/README.md index 5b6da9421..aa0fa98d0 100644 --- a/1986/holloway/README.md +++ b/1986/holloway/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./holloway ``` diff --git a/1986/marshall/README.md b/1986/marshall/README.md index 2f84c5feb..54c90a0bb 100644 --- a/1986/marshall/README.md +++ b/1986/marshall/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ if nothing else. ## To use: -``` +``` ./marshall ``` @@ -36,14 +36,14 @@ instead offer the problematic code as an alternate version whereas To see if your compiler has the problems noted: -``` +``` make alt ``` ### Alternate use: -``` +``` ./marshall.alt ``` diff --git a/1986/marshall/compilers.md b/1986/marshall/compilers.md index a732d52fe..2f341acb5 100644 --- a/1986/marshall/compilers.md +++ b/1986/marshall/compilers.md @@ -54,7 +54,7 @@ dumps core just like before! What about the call to `_exit()`? The call was: -``` +``` _exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]); ``` @@ -72,7 +72,7 @@ infinite loop! After we fix the infinite loop if we change the `_exit()` call in macOS and disable the optimiser we might get something like: -``` +``` $ ./marshall choo choo Segmentation fault: 11 diff --git a/1986/pawka/README.md b/1986/pawka/README.md index a3caf8c20..c3fde1382 100644 --- a/1986/pawka/README.md +++ b/1986/pawka/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./pawka ``` diff --git a/1986/stein/README.md b/1986/stein/README.md index 73121e459..bd5360349 100644 --- a/1986/stein/README.md +++ b/1986/stein/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./stein $(printf "\015\015"); echo ``` @@ -24,7 +24,7 @@ The `\015` in the above `printf(1)` command produces a control-N. One some machines, a control-M control-N arg is needed to get the command to output cleanly: -``` +``` ./stein $(printf "\014\015"); echo ``` diff --git a/1986/wall/README.md b/1986/wall/README.md index 6db56f878..d2fdef964 100644 --- a/1986/wall/README.md +++ b/1986/wall/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./wall ``` diff --git a/1987/biggar/README.md b/1987/biggar/README.md index 4430ea795..a0313c22c 100644 --- a/1987/biggar/README.md +++ b/1987/biggar/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` some_command | ./biggar | od -c ./biggar < file | od -c @@ -16,7 +16,7 @@ ## Try: -``` +``` ./try.sh ``` diff --git a/1987/heckbert/README.md b/1987/heckbert/README.md index ae61cea5a..41c23df47 100644 --- a/1987/heckbert/README.md +++ b/1987/heckbert/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -10,7 +10,7 @@ To compile on a 16 bit machine, change 300000 to 30000. ## To use: -``` +``` ./heckbert col < file ``` @@ -19,7 +19,7 @@ where col is the number of columns to fold at and file is the file to fold. ## Try: -``` +``` ./try.sh ``` @@ -28,7 +28,7 @@ where col is the number of columns to fold at and file is the file to fold. Folding at the wrong length may be equivalent to a "Spindle or Mutilate" operation. For example: -``` +``` ./heckbert 40 < heckbert.c > ph.c ; make ph ; ./ph 20 < heckbert.c > bar.c ; make bar ``` diff --git a/1987/hines/README.md b/1987/hines/README.md index 59e84f8dd..1627a154c 100644 --- a/1987/hines/README.md +++ b/1987/hines/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./hines file.c ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1987/korn/README.md b/1987/korn/README.md index 80d27d030..cd513c384 100644 --- a/1987/korn/README.md +++ b/1987/korn/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./korn ``` @@ -29,14 +29,14 @@ Several points are important to understand this program: 2. What is the value of the symbol `"have"`? (hint: the value is NOT 4 characters, or `'h'`, or a string) Consider the fact that: -``` +``` char *x; ``` defines a pointer to a `char` (i.e. an address), and that the `=` assigns things of compatible types. Since: -``` +``` x = "have"; ``` @@ -44,13 +44,13 @@ is legal C, what type of value is `"have"`? 3. Note that the following expressions yield the same value: -``` +``` x[3] *(x+3) *(3+x) ``` since addition is commutative. What can be said about this value? -``` +``` 3[x] ``` diff --git a/1987/lievaart/README.md b/1987/lievaart/README.md index 4ae8714e6..93b0225d2 100644 --- a/1987/lievaart/README.md +++ b/1987/lievaart/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./lievaart # enter a level and start playing as described below ``` @@ -17,7 +17,7 @@ To see what it would have looked like without the size restrictions: -``` +``` ./lievaart2 # enter a level and start playing as described below ``` diff --git a/1987/wall/README.md b/1987/wall/README.md index df10a656e..c0f70027d 100644 --- a/1987/wall/README.md +++ b/1987/wall/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./wall # enter some numbers @@ -18,14 +18,14 @@ ## Try: -``` +``` ./try.sh ``` You may of course run the commands manually and enter text as you wish. For instance you might try one or both of: -``` +``` ./wall | bc ./wall | cat diff --git a/1987/westley/README.md b/1987/westley/README.md index 564ce1a22..d46ca5068 100644 --- a/1987/westley/README.md +++ b/1987/westley/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./westley ``` diff --git a/1988/applin/README.md b/1988/applin/README.md index b0b04d5a5..99e78b0a4 100644 --- a/1988/applin/README.md +++ b/1988/applin/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -12,7 +12,7 @@ program. See the [Alternate code](#alternate-code) section below for details. ## Try: -``` +``` ./applin ``` @@ -25,7 +25,7 @@ with this entry. ### Alternate build: -``` +``` make alt ``` diff --git a/1988/dale/README.md b/1988/dale/README.md index c543dc8dd..2bffd84b0 100644 --- a/1988/dale/README.md +++ b/1988/dale/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,13 +18,13 @@ For more detailed information see [1988 dale bugs](../../bugs.html#1988_dale). ## Try: -``` +``` ./try.sh ``` Observe that three of the commands in the script are: -``` +``` ./dale these files are in this directory: * ./dale $(printf "the following files exist in this directory:\n%s\n" *) ./dale "$(printf "the following files exist in this directory:\n%s\n" *)" diff --git a/1988/isaak/README.md b/1988/isaak/README.md index f4fb99ff8..aebc78bb3 100644 --- a/1988/isaak/README.md +++ b/1988/isaak/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -11,7 +11,7 @@ code](#alternate-code) below. ## To use: -``` +``` ./isaak ``` @@ -21,7 +21,7 @@ code](#alternate-code) below. The original version of this code is in [isaak.alt.c](isaak.alt.c). The original entry starts with the line: -``` +``` main(){}; ``` @@ -37,7 +37,7 @@ compile. ### Alternate build: -``` +``` make alt ``` @@ -64,7 +64,7 @@ due to the fact that BSD style systems have an `sprintf(3)` that returns a `char *`. Due to the above problems, we placed the output of this program in the file: isaak.encode. To read this file do. -``` +``` uudecode < isaak.encode cat isaak.output ``` diff --git a/1988/litmaath/README.md b/1988/litmaath/README.md index a38ba4d0f..984253c1a 100644 --- a/1988/litmaath/README.md +++ b/1988/litmaath/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./litmaath some text ``` @@ -17,7 +17,7 @@ code](#alternate-code) section below. ## Try: -``` +``` ./litmaath eschew obfuscation ``` @@ -31,7 +31,7 @@ a file. ### Alternate build: -``` +``` make alt ``` @@ -40,7 +40,7 @@ Use `litmaath.alt` as you would `litmaath` above. ### Alternate try: -``` +``` ./litmaath.alt six was afraid of seven because seven eight nine ``` @@ -50,7 +50,7 @@ Use `litmaath.alt` as you would `litmaath` above. Note the unusual structure: -``` +``` while () ; ``` @@ -66,7 +66,7 @@ could make the body of the `while` loop an `fprintf` with interesting variables like: -``` +``` fprintf(stderr, "argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n", (long) argv, (long) *argv, *argv && **argv ? **argv : '@', diff --git a/1988/phillipps/README.md b/1988/phillipps/README.md index 4e8a9bbbc..915301d97 100644 --- a/1988/phillipps/README.md +++ b/1988/phillipps/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` diff --git a/1988/reddy/README.md b/1988/reddy/README.md index 25cd1004e..e592e0d64 100644 --- a/1988/reddy/README.md +++ b/1988/reddy/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./reddy char *(*(fun[16])(); char *(*(*(*(*(*fun[32])))))(); @@ -15,7 +15,7 @@ What happens if you input, and what you do about it? -``` +``` char *(*(*(*(*(*fun[32])))))()); ``` diff --git a/1988/robison/README.md b/1988/robison/README.md index 36dd9a375..a8df128d1 100644 --- a/1988/robison/README.md +++ b/1988/robison/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./robison 80 10 ./robison 40 16 ``` The first and second parameters are optional. You might also try: -``` +``` ./robison 80 2 # <--- can you find the bug? ./robison 80 -246 ``` @@ -24,7 +24,7 @@ The first and second parameters are optional. You might also try: The following might make an interesting benchmark: -``` +``` ./robison 100 ``` diff --git a/1988/spinellis/README.md b/1988/spinellis/README.md index aa12f1b32..fa5e97001 100644 --- a/1988/spinellis/README.md +++ b/1988/spinellis/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make clobber all ``` @@ -12,7 +12,7 @@ code](#alternate-code) section below. ## To use: -``` +``` ./spinellis ``` @@ -21,7 +21,7 @@ EOF (typically ctrl-d). Now run again: -``` +``` ./spinellis ``` @@ -33,7 +33,7 @@ For clang or compilers that won't read from `/dev/tty`, we provide this version. ### Alternate build: -``` +``` make clobber alt ``` @@ -42,7 +42,7 @@ and follow the instructions. ### Alternate use: -``` +``` ./spinellis.alt ``` @@ -51,7 +51,7 @@ EOF (typically ctrl-d). Now run again: -``` +``` ./spinellis.alt ``` diff --git a/1988/westley/README.md b/1988/westley/README.md index 800abe233..5c0eaf417 100644 --- a/1988/westley/README.md +++ b/1988/westley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -11,13 +11,13 @@ might wish to do so. ## Try: -``` +``` ./westley ``` Also try: -``` +``` ./try.sh ``` @@ -31,7 +31,7 @@ This version is the original which might not work as you expect nowadays. ### Alternate build: -``` +``` make alt ``` @@ -41,7 +41,7 @@ This version is the original which might not work as you expect nowadays. To see if your compiler has the problem described in the Judges' remarks below, try: -``` +``` ./westley.alt ``` @@ -52,7 +52,7 @@ Does it show the same output as `westley`? Your compiler must parse -``` +``` #define _ -a -_ ``` @@ -62,7 +62,7 @@ conforming ANSI C Preprocessors may object to this: for such compilers, you can elide the non-standard token-pasting requirement by changing the #define line to: -``` +``` #define _ F-->00||F-OO--; ``` @@ -71,7 +71,7 @@ code is the original. You might enjoy looking at the output of: -``` +``` cc -E westley.alt.c ``` diff --git a/1989/fubar/README.md b/1989/fubar/README.md index 7deb564d2..111e98900 100644 --- a/1989/fubar/README.md +++ b/1989/fubar/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,14 +18,14 @@ For more detailed information see [1989 fubar bugs](../../bugs.html#1989_fubar). ## To use: -``` +``` ./fubar ``` ## Try: -``` +``` ./try.sh # run on 1 - 7 ./fubar.sh 2 # run via script diff --git a/1989/jar.1/README.md b/1989/jar.1/README.md index e00bf6723..cd9fe4406 100644 --- a/1989/jar.1/README.md +++ b/1989/jar.1/README.md @@ -2,7 +2,7 @@ NOTE: this will run the program itself. -``` +``` make clobber all ``` @@ -12,7 +12,7 @@ See the [Alternate code](#alternate-code) section below for more details. ## To use: -``` +``` ./jar.1 ``` @@ -26,14 +26,14 @@ This alternate code, which prints something slightly different, is provided as w NOTE: this will run the program itself. -``` +``` make clobber alt ``` ### Alternate use: -``` +``` ./jar.1.alt ``` @@ -43,7 +43,7 @@ NOTE: this will run the program itself. On many systems the compiler will not allow you to send the object file to `/dev/tty`. The author suggested: -``` +``` cc -c -o /dev/tty jar.1.c ``` diff --git a/1989/jar.2/README.md b/1989/jar.2/README.md index 09e031dc5..067fca80b 100644 --- a/1989/jar.2/README.md +++ b/1989/jar.2/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./jar.2 [enter some lisp] @@ -19,7 +19,7 @@ NOTE: this entry will likely segfault on invalid input. ## Try: -``` +``` ./try.sh ./try.sh chocolate_cake.lisp @@ -65,7 +65,7 @@ lisp expressions (followed by CR), the program evaluates them and prints out the return values. End execution by typing an end-of-file character. -``` +``` (+ 2.5 3.1) (defun fib (n) (if (< n 2) diff --git a/1989/ovdluhe/README.md b/1989/ovdluhe/README.md index 0192e7207..6f0a1ec60 100644 --- a/1989/ovdluhe/README.md +++ b/1989/ovdluhe/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -11,7 +11,7 @@ To get this to compile with a modern CPP, we had to replace `#D` with `#define`. Run the program this way: -``` +``` ./ovdluhe < textfile ``` @@ -21,7 +21,7 @@ by chance or is killed. ## Try: -``` +``` ./try.sh ; sleep 2 ; ./try.sh ``` @@ -34,7 +34,7 @@ it's a `#define` it's easy to set up. ### Alternate build: -``` +``` make P=9 clobber alt ``` @@ -46,14 +46,14 @@ program to fail and a negative value will cause a compilation error. ### Alternate use: -``` +``` ./ovdluhe.alt ``` ### Alternate try: -``` +``` ./try.alt.sh P=5 ./try.alt.sh diff --git a/1989/paul/README.md b/1989/paul/README.md index cc69b975d..81aa1a235 100644 --- a/1989/paul/README.md +++ b/1989/paul/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -10,7 +10,7 @@ out. See [alternate code](#alternate-code) below for more details. ## Try: -``` +``` ./paul ``` @@ -28,14 +28,14 @@ could easily be added. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./paul.alt ``` diff --git a/1989/robison/README.md b/1989/robison/README.md index 90e9ef7da..01e4a330a 100644 --- a/1989/robison/README.md +++ b/1989/robison/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1989 robison bugs](../../bugs.html#1989_robis ## To use: -``` +``` ./robison # enter valid expressions ``` @@ -26,7 +26,7 @@ For more detailed information see [1989 robison bugs](../../bugs.html#1989_robis ## Try: -``` +``` ./robison 11x10 # enter other expressions diff --git a/1989/roemer/README.md b/1989/roemer/README.md index 5991a2fa5..28cdc367c 100644 --- a/1989/roemer/README.md +++ b/1989/roemer/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./roemer ``` diff --git a/1989/tromp/README.md b/1989/tromp/README.md index 397440e90..e7a9654bb 100644 --- a/1989/tromp/README.md +++ b/1989/tromp/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./tromp [drops_per_sec [cmd_string]] ``` ## Try: -``` +``` ./tromp 5 ./tromp 10 "hkl jq" @@ -53,7 +53,7 @@ the judges' additional remarks in the author's remarks, for more details. ### Alternate build: -``` +``` make alt ``` @@ -138,7 +138,7 @@ at the start and `-raw` at the end. This further reduces the size of the program, but has the possible disadvantage that the program can only by stopped by 'q' or by the `kill -9' command. -``` +``` long h[4];t(){h[3]-=h[3]/3000;setitimer(0,h,0);}c,d,l,v[]={(int)t,0,2},w,s,I,K =0,i=276,j,k,q[276],Q[276],*n=q,*m,x=17,f[]={7,-13,-12,1,8,-11,-12,-1,9,-1,1, 12,3,-13,-12,-1,12,-1,11,1,15,-1,13,1,18,-1,1,2,0,-12,-1,11,1,-12,1,13,10,-12, diff --git a/1989/vanb/README.md b/1989/vanb/README.md index 6471c0b5a..4d8780348 100644 --- a/1989/vanb/README.md +++ b/1989/vanb/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1989/westley/README.md b/1989/westley/README.md index a9867c8d6..a913e9bc1 100644 --- a/1989/westley/README.md +++ b/1989/westley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -20,26 +20,26 @@ For more detailed information see [1989 westley bugs](../../bugs.html#1989_westl Try compiling and running the 4 resulting programs like: -``` +``` ./compile.sh ``` If you need to specify an alternate compiler path, say because your default compiler is clang (or in the case of macOS gcc is clang) you can do so like: -``` +``` CC=/opt/local/bin/gcc-mp-12 ./compile.sh ``` If you wish to delay the script or remove the delay you can do so like: -``` +``` DELAY=2 ./compile.sh ``` Finally try: -``` +``` ./westley # input some lines of text, sending EOF (usually ctrl-d) to end @@ -70,7 +70,7 @@ different algorithm for each version (hereafter referred to as When compiling these versions, one needs to define `trgpune` in the compile line (which the Makefile now has). Example: -``` +``` cc -Dtrgpune=putchar ver3.c -o ver3 ``` @@ -109,13 +109,13 @@ function `vs()` to define in the ROT13 version. But a function called `vs()` turns into a function called `if()` in the original, so it can't be done. Therefore, I do: -``` +``` expr1 && expr2 && (expr3=etc); ``` which is the same as: -``` +``` if (expr1 && expr2) expr3=etc; ``` @@ -124,7 +124,7 @@ expressions if they aren't in an assignment or conditional statement. This might warrant a warning, since other compilers may do this. I found MANY compilers botched: -``` +``` expr1 && (expr2,expr3); ``` @@ -146,7 +146,7 @@ such statements to make it more portable. Normally (!), a reversible C program is done thus: -``` +``` /**/ forward code /*/ edoc drawkcab /**/ ``` @@ -154,7 +154,7 @@ If your compiler nests comments, it will get this wrong. However, I have made some bits of the code palindromic, (or different, but reversible) so it is more like: -``` +``` /**/forward/*//**/ palindromic /**//*/drawkcab/**/ ``` diff --git a/1990/baruch/README.md b/1990/baruch/README.md index a384d813a..e777efe07 100644 --- a/1990/baruch/README.md +++ b/1990/baruch/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -21,7 +21,7 @@ For more detailed information see [1990 baruch bugs](../../bugs.html#1990_baruch ## To use: -``` +``` echo 4 | ./baruch echo 7 | ./baruch ``` @@ -29,7 +29,7 @@ For more detailed information see [1990 baruch bugs](../../bugs.html#1990_baruch ## Try: -``` +``` ./try.sh ``` @@ -47,7 +47,7 @@ question. YMMV. ### Alternate build: -``` +``` make alt ``` diff --git a/1990/cmills/README.md b/1990/cmills/README.md index d581abe43..4c0c83ff9 100644 --- a/1990/cmills/README.md +++ b/1990/cmills/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./cmills [starting_cash] ``` ## Try: -``` +``` ./cmills 5000 ``` diff --git a/1990/dds/README.md b/1990/dds/README.md index f060670a2..aed7d1651 100644 --- a/1990/dds/README.md +++ b/1990/dds/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dds ``` @@ -16,7 +16,7 @@ Give the following lines as input: -``` +``` OLD LANDER.BAS RUN ``` diff --git a/1990/dg/README.md b/1990/dg/README.md index 1712f36d2..44279b653 100644 --- a/1990/dg/README.md +++ b/1990/dg/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` echo foo bar | ./dg ``` ## Try: -``` +``` ./try.sh ``` @@ -24,13 +24,13 @@ 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)))))))))))))))))))))))))))))) ``` sometimes has to be changed to: -``` +``` b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A')))))))))))))))))))))))))))) ``` @@ -56,7 +56,7 @@ As for the rot13 algorithm, it relies on `index(3)` to find if the character is in the set `A-Za-z`. `l[]` is an array that gets filled with: -``` +``` "nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM" ``` diff --git a/1990/jaw/README.md b/1990/jaw/README.md index abbcfa488..3b8f71fed 100644 --- a/1990/jaw/README.md +++ b/1990/jaw/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -9,7 +9,7 @@ To test the official C entry, one might try: -``` +``` echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw ``` @@ -19,7 +19,7 @@ sentence. #### Also try: -``` +``` ./try.sh ``` @@ -39,14 +39,14 @@ it to 1530 bytes) which implements the complete shark utility. The script, The sender must have `compress` and `btoa`. To send, try: -``` +``` ./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 @@ -168,7 +168,7 @@ 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. -``` +``` #!/bin/sh m=$1; shift shark $* | split -800 - /tmp/shark$$ diff --git a/1990/pjr/README.md b/1990/pjr/README.md index 40225e8d5..0b79a40fb 100644 --- a/1990/pjr/README.md +++ b/1990/pjr/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -11,7 +11,7 @@ that can be used if your compiler is incapable of compiling `X=g()...` in ## To use: -``` +``` ./pjr ``` @@ -22,7 +22,7 @@ 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: -``` +``` main(){X=s().v().o().o().l().S().d().l().i().o().w().N();} ``` @@ -34,14 +34,14 @@ well. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./pjr.alt ``` @@ -74,7 +74,7 @@ opposite: To encode a new string input the string as it is meant to come out: -``` +``` X=s().v().o().o().l().S().d().l().i().o().w().N(); ``` diff --git a/1990/scjones/README.md b/1990/scjones/README.md index 00b8b344c..3d940cded 100644 --- a/1990/scjones/README.md +++ b/1990/scjones/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./scjones ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1990/stig/README.md b/1990/stig/README.md index 761e50c8e..25092375b 100644 --- a/1990/stig/README.md +++ b/1990/stig/README.md @@ -1,19 +1,19 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` make all ``` NOTE: that's not a typo or mistake but one can also do: -``` +``` ./o ``` diff --git a/1990/tbr/README.md b/1990/tbr/README.md index 57ea68c95..9252af293 100644 --- a/1990/tbr/README.md +++ b/1990/tbr/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -25,7 +25,7 @@ In 2023 it was noticed that in some systems like macOS there was confusing output due to a warning at runtime that was interspersed with the output of the program. For instance it would show: -``` +``` ./tbr $ warning: this program uses gets(), which is unsafe. ``` @@ -40,7 +40,7 @@ below, in the [alternate version](#alternate-code) section. ## To use: -``` +``` ./tbr $ enter some shell commands ``` @@ -54,7 +54,7 @@ just `exit` or `logout`? Hint: see the authors' remarks. ## Try: -``` +``` ./tbr $ ls -l tbr tbr.c @@ -79,7 +79,7 @@ documented, are not considered bugs as such in the context of the contest. The authors 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;);} @@ -99,14 +99,14 @@ equivalent like the authors intended. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./tbr.alt ``` @@ -165,13 +165,13 @@ argument is stolen every time a `>` or `<` is encountered. The shell flags an error if no arguments are on the stack. Thus, for example: -``` +``` cat > foo > bar ``` cats to `foo`, since it was pushed last, but -``` +``` cat > > foo bar ``` diff --git a/1990/theorem/README.md b/1990/theorem/README.md index 55707dce4..b81948636 100644 --- a/1990/theorem/README.md +++ b/1990/theorem/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1990 theorem bugs](../../bugs.html#1990_theor ## To use: -``` +``` ./theorem expression x1 x2 h y1 ``` @@ -35,7 +35,7 @@ where: ## Try: -``` +``` ./try.sh ``` @@ -62,7 +62,7 @@ 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 @@ -71,14 +71,14 @@ Try running the program with the following args: 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 ``` Still not impressed? The author throws in for free, a sort program! Try: -``` +``` make sorter ls | ./sorter ``` @@ -87,14 +87,14 @@ 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 ``` 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 diff --git a/1990/westley/README.md b/1990/westley/README.md index 8ffd2c0f2..27b6fe30c 100644 --- a/1990/westley/README.md +++ b/1990/westley/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./westley ``` @@ -16,7 +16,7 @@ The number should be greater than 0. ## Try: -``` +``` ./try.sh ``` @@ -30,14 +30,14 @@ The alternate code is provided to show how C changed. If you have an old enough compiler try and to see how C has changed over the years: -``` +``` make alt ``` ### Alternate use: -``` +``` ./westley.alt ``` diff --git a/1991/README.md b/1991/README.md index c8812208f..f7dca8c16 100644 --- a/1991/README.md +++ b/1991/README.md @@ -35,7 +35,7 @@ been eliminated, and will likely be considered in future years. A number of entries made use of the following C pre-processor feature: -``` +``` #define X define #X foo bar ``` diff --git a/1991/ant/README.md b/1991/ant/README.md index 12f231e7c..e191767fb 100644 --- a/1991/ant/README.md +++ b/1991/ant/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -10,7 +10,7 @@ familiar to vi(m) users. ## To use: -``` +``` ./ant some_file ``` @@ -20,12 +20,12 @@ program exit without doing anything. ## Try: -``` +``` make hill ./ant hill ``` -``` +``` make mole ./ant mole ``` @@ -46,7 +46,7 @@ rest was unchanged. ### Alternate build: -``` +``` make alt ``` diff --git a/1991/brnstnd/README.md b/1991/brnstnd/README.md index b6dba7ac1..b06aedb0e 100644 --- a/1991/brnstnd/README.md +++ b/1991/brnstnd/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## Try: -``` +``` ./try.sh ./sorta < sorta.itailrec diff --git a/1991/buzzard/README.md b/1991/buzzard/README.md index 3d65edf07..207284476 100644 --- a/1991/buzzard/README.md +++ b/1991/buzzard/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -21,7 +21,7 @@ For more detailed information see [1991 buzzard bugs](../../bugs.html#1991_buzza ## To use: -``` +``` ./buzzard ``` @@ -37,14 +37,14 @@ code directly so the keys are not made a `-D` at the compiler. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./buzzard.alt ``` @@ -89,7 +89,7 @@ so make sure to convert tabs to spaces before using it. Usage: -``` +``` ./buzzard [filename [escape-char [start-x start-yNNN ``` diff --git a/1991/cdupont/README.md b/1991/cdupont/README.md index 531da5248..434fbd94e 100644 --- a/1991/cdupont/README.md +++ b/1991/cdupont/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./cdupont ``` @@ -16,7 +16,7 @@ Why is the following label necessary? -``` +``` sorryfor_this_unused_but_very_needed_label: ``` diff --git a/1991/davidguy/README.md b/1991/davidguy/README.md index f206f507c..ff774e2ad 100644 --- a/1991/davidguy/README.md +++ b/1991/davidguy/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./davidguy ip_address:server.screen ``` @@ -16,7 +16,7 @@ where `ip_address` in an IP address of an X server. ## Try: -``` +``` ./davidguy 127.0.0.1:0.0 ``` @@ -24,7 +24,7 @@ Of course, you may need to supply a more reasonable address. :-) ## Also try: -``` +``` cp -f davidguy guydavid ./guydavid 127.0.0.1:0.0 ``` diff --git a/1991/dds/README.md b/1991/dds/README.md index 73a57d3c8..39260b07e 100644 --- a/1991/dds/README.md +++ b/1991/dds/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dds basic_program ./a.out 2>/dev/null ``` @@ -17,7 +17,7 @@ The author suggests trying: -``` +``` ./dds LANDER.BAS ./a.out ``` @@ -27,7 +27,7 @@ produced? How does `a.c` relate to [LANDER.BAS](LANDER.BAS)? What happens if you give the program a C program like itself? Try: -``` +``` ./dds dds.c ``` diff --git a/1991/fine/README.md b/1991/fine/README.md index a70c6c98a..4307b6182 100644 --- a/1991/fine/README.md +++ b/1991/fine/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` echo text | ./fine ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1991/rince/README.md b/1991/rince/README.md index f315d8e7a..3a23a1026 100644 --- a/1991/rince/README.md +++ b/1991/rince/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -11,7 +11,7 @@ that's fewer than the original program. ## To use: -``` +``` ./rince ``` @@ -30,7 +30,7 @@ The author set the maximum number of moves to 484. ### Alternate build: -``` +``` make alt ``` @@ -41,7 +41,7 @@ configurable maximum number of moves allowed, defaulting to the entry's max, To reconfigure the maximum number of moves to 700: -``` +``` make clobber MAXMOVES=700 alt ``` @@ -50,13 +50,13 @@ To reconfigure the maximum number of moves to 700: To run the first alt version: -``` +``` ./rince.alt ``` To run the second alt version: -``` +``` ./rince.alt2 ``` diff --git a/1991/westley/README.md b/1991/westley/README.md index 93bce8dbe..217c5c8f9 100644 --- a/1991/westley/README.md +++ b/1991/westley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -27,7 +27,7 @@ for the interested. See the [try](#try) section if you just want to play. Make and then run as follows: -``` +``` ./westley [move_location] | tee nextmove.c ``` @@ -43,7 +43,7 @@ a move on a tic-tac-toe board: If you omit `move_location`, then the computer moves first. For your next move, recompile `nextmove.c` and play it again: -``` +``` make nextmove ./nextmove move_location | tee nextmove.c ``` @@ -54,7 +54,7 @@ next move, recompile `nextmove.c` and play it again: We have provided the shell script, [ttt](ttt.sh), to make it easier to play the game: -``` +``` make ttt ./ttt [first_move] # <- omit first arg to have it move first ./ttt next_move @@ -64,14 +64,14 @@ The shell script determines when the game is over, and automatically replaces `merlyn.c` (copied from [westley.c](westley.c) with an improved version after a loss). The [ttt](ttt.sh) script has two other modes: -``` +``` ./ttt quitgame # cancel any game in progress, revert to merlyn.c ./ttt clobber # remove all game files, revert to original source ``` For example here is a potentially losing game: -``` +``` ./ttt 1 ./ttt 4 ./ttt 6 @@ -80,7 +80,7 @@ For example here is a potentially losing game: The final might look like: -``` +``` a(X){/*/X=- a(X){/*/X=- X -1;F;X=- -1;F;X=- -1;F;}/*/ -1;F;}/*/ @@ -123,7 +123,7 @@ can lose if you cheat. That's supposed to happen. Can you win any other time? ### Alternate build: -``` +``` make alt ``` @@ -194,7 +194,7 @@ function as `a()`, `b()`, or `c()`. After each function is called, the global variables `X` and `O` contain bitmasks of where all the `X`s and `O`s are placed. The statement: -``` +``` X=- -1; ``` diff --git a/1992/adrian/README.md b/1992/adrian/README.md index 458e89c06..f9960ecc2 100644 --- a/1992/adrian/README.md +++ b/1992/adrian/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -19,13 +19,13 @@ For more detailed information see [1992 adrian bugs](../../bugs.html#1992_adrian ## Try: -``` +``` ./try.sh ``` For the slow minded, try: -``` +``` ./adsleep 32767 ``` @@ -134,7 +134,7 @@ character list. With the automaton specification in `filename`, invoke the program by typing -``` +``` ./adrian filename ``` @@ -151,7 +151,7 @@ occurs if your automaton has more than 257 states. Running: -``` +``` ./adrian from < your_mailbox ``` @@ -169,7 +169,7 @@ the regular expression: I suggest using `adrian.c` as input, and storing the output in `adwc.c`: -``` +``` ./adrian < adrian.c > adwc.c ``` @@ -181,13 +181,13 @@ in the input file. Another possibly interesting automaton can be created by slightly adjusting the `adrian.c` file. Change the first line to read -``` +``` /* . echo| . */ ``` and repeat the process above -``` +``` ./adrian adecho.c ``` @@ -204,7 +204,7 @@ employed. Two other adjustments to the first line also yield useful results. By changing it to -``` +``` /* . head; . */ ``` @@ -221,7 +221,7 @@ specified (again this was changed to `__FILE__`). By setting the first line to -``` +``` /* . basename . */ ``` @@ -240,7 +240,7 @@ The resulting base name is printed to stdout. Lastly, by setting the first line to -``` +``` /* . sleep . */ ``` diff --git a/1992/albert/README.md b/1992/albert/README.md index 035ac3196..acdec33cf 100644 --- a/1992/albert/README.md +++ b/1992/albert/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -21,14 +21,14 @@ For more detailed information see [1992 albert bugs](../../bugs.html#1992_albert ## To use: -``` +``` ./albert number ``` ## Try: -``` +``` ./try.sh ``` @@ -64,7 +64,7 @@ The [albert.alt.c](albert.c) file is the fixed file, whereas the To compile this alternate version: -``` +``` make alt ``` @@ -76,7 +76,7 @@ Use `albert.alt` as you would `albert` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -106,7 +106,7 @@ if you want to factor Fermat's 4th number. Then just run it. Or you may type `./albert ` A nice one is also (30 ones): -``` +``` ./albert 111111111111111111111111111111 ``` @@ -114,7 +114,7 @@ Apart from the foregoing there are no special execution instructions. To customize the program into a factorizer of a fixed number, use -``` +``` cc albert.c -o 4294967297 ``` diff --git a/1992/ant/README.md b/1992/ant/README.md index 38e47788f..6256e5760 100644 --- a/1992/ant/README.md +++ b/1992/ant/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./ant Makefile ./ant Makefile rule @@ -18,7 +18,7 @@ where `Makefile` is a Makefile to use and `rule` is an optional rule to use. ## Try: -``` +``` ./try.sh ``` diff --git a/1992/buzzard.1/README.md b/1992/buzzard.1/README.md index 03c59c42d..3a086ac2f 100644 --- a/1992/buzzard.1/README.md +++ b/1992/buzzard.1/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./buzzard.1 num num ``` ## Try: -``` +``` ./try.sh ``` @@ -23,7 +23,7 @@ To see good C Preprocessor buzzard.1, try: -``` +``` make babble.cppcb cat babble.cppcb ``` @@ -54,19 +54,19 @@ short strings. `buzzard.1` is a simple mathematical program. It expects two numeric arguments. -``` +``` ./buzzard.1 0 ``` will print out the factorial of ``. -``` +``` ./buzzard.1 ``` will print out the largest common factor of `num1` and `num2`. -``` +``` ./buzzard.1 1 ``` @@ -171,21 +171,21 @@ programs is the conditional (given that we have loops). Since all you can do in the given operation output set is assignment, we implement "conditional assignment": -``` +``` if (x) y = z; ``` To implement this, we constrain `x` to be either 0 or 1, and simply compute: -``` +``` y = (z * x) + (y * (1-x)); ``` This is more obscured by factoring out common terms and restricting ourselves to two operand operations: -``` +``` temp = z; (temp == z) temp -= y; (temp == z-y) temp *= x; (temp == (z-y)*x) @@ -199,7 +199,7 @@ Next we imagine we have a [pc](https://en.wikipedia.org/wiki/Program_counter). we're not currently coming up on statement pc. To handle this, we simply make every operation conditional on the pc having the correct value: -``` +``` if (pc == some_constant) y = z; ``` diff --git a/1992/buzzard.2/README.md b/1992/buzzard.2/README.md index 50a722c48..dd2c45c4b 100644 --- a/1992/buzzard.2/README.md +++ b/1992/buzzard.2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -13,13 +13,13 @@ code](#alternate-code) below for details. First, you must make sure that `first` is made first (even though `make all` should make first first :-) ): -``` +``` make first ``` Second: -``` +``` # get help: echo help | cat third help.th - | ./first @@ -29,7 +29,7 @@ Second: Third: -``` +``` cat third help.th - | ./first ``` @@ -50,7 +50,7 @@ Fourth: ## Try: -``` +``` ./try.sh ``` @@ -63,7 +63,7 @@ fix that the author notes in their remarks. ### Alternate build: -``` +``` make alt ``` @@ -75,7 +75,7 @@ Use `buzzard.2.alt` as you would `buzzard.2` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -125,7 +125,7 @@ Do not expect to be able to do anything interesting with `first`. To do something interesting, you need to feed `first` the file [third](third) first. In unix, you can do -``` +``` cat third help.th - | ./first ``` @@ -226,7 +226,7 @@ When you get the `Ok.` message from `third`, try out some sample you in a normal way. It only prints `'Ok.'` after you define a word). -``` +``` 2 3 + . cr ``` diff --git a/1992/gson/README.md b/1992/gson/README.md index 8f400bd4e..1dd421a22 100644 --- a/1992/gson/README.md +++ b/1992/gson/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -21,14 +21,14 @@ For more detailed information see [1992 gson bugs](../../bugs.html#1992_gson). ## To use: -``` +``` ./ag word word2 word3 < /path/to/dictionary ``` ## Try: -``` +``` ./try.sh ``` @@ -45,7 +45,7 @@ following locations though the last one is more ironic: Then using the proper dictionary file it does: -``` +``` ./ag free software foundation < /usr/share/dict/words ./ag obfuscated c contest < /usr/share/dict/words ./ag unix international < /usr/share/dict/words @@ -73,7 +73,7 @@ weren't allowed to print! The author provided an obfuscated script that can be used to construct dictionaries which has been put in as [mkdict.sh](mkdict.sh). To use try: -``` +``` cat README.md | ./mkdict.sh > words ``` @@ -103,7 +103,7 @@ have one already, you can make your own dictionary by concatenating a few hundred of your favourite Usenet articles and piping them through the following obfuscated shell script: -``` +``` #!/bin/sh z=a-z];tr [A-Z\] \[$z|sed s/[\^$z[\^$z*/_/g|tr _ \\012|grep ..|sort -u ``` @@ -258,7 +258,7 @@ those bits that should remain zero. For example, the following program prints all those 16-bit integers that contain zeroes in all even bit positions: -``` +``` main(){int i=0,s=0xAAAA;do{printf("%04x\t",i);}while(i=((i|~s)+1)&s);} ``` diff --git a/1992/imc/README.md b/1992/imc/README.md index c30322335..bf92e959e 100644 --- a/1992/imc/README.md +++ b/1992/imc/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` # text mode ./imc -text @@ -19,7 +19,7 @@ To see a number of options and configurations: -``` +``` ./try.sh ``` @@ -164,7 +164,7 @@ standard error to indicate its progress (one dot per pixel line). Here are a couple of good pictures to draw: -``` +``` ./imc -s 512,512 -f 600000 -l 512 -m 16 -c.00805,.74274 > screen1.ras ./imc -s512,512 -j-.523,-.535 > screen2.ras ``` diff --git a/1992/kivinen/README.md b/1992/kivinen/README.md index 92ffd4b7f..d08bddb36 100644 --- a/1992/kivinen/README.md +++ b/1992/kivinen/README.md @@ -2,7 +2,7 @@ If your machine support the X Window System, Version 11: -``` +``` make alt ``` @@ -24,7 +24,7 @@ For more detailed information see [1992 kivinen bugs](../../bugs.html#1992_kivin ## To use: -``` +``` ./kivinen.alt ./kivinen.alt a @@ -41,7 +41,7 @@ Also try changing the speed that the game moves. For instance if you wish to change the `usleep(3)` value to `30000` from `20000`, try: -``` +``` make clobber SLEEP=30000 alt # make it slower make clobber SLEEP=10000 alt # make it faster @@ -59,7 +59,7 @@ code. ### Original build: -``` +``` make all ``` diff --git a/1992/lush/README.md b/1992/lush/README.md index cb10e36c2..923492b03 100644 --- a/1992/lush/README.md +++ b/1992/lush/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1992 lush bugs](../../bugs.html#1992_lush). ## To use: -``` +``` ./lush.sh ``` diff --git a/1992/marangon/README.md b/1992/marangon/README.md index 883441bcf..1bae2f83d 100644 --- a/1992/marangon/README.md +++ b/1992/marangon/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./marangon ``` diff --git a/1992/nathan/README.md b/1992/nathan/README.md index 0cf51e6a2..733cc5805 100644 --- a/1992/nathan/README.md +++ b/1992/nathan/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./nathan # enter some text ``` @@ -17,7 +17,7 @@ To see some other fun uses: -``` +``` ./try.sh ``` @@ -58,7 +58,7 @@ distribute some winning entries outside of the US. Nathan Sidwell stated that he was willing to distribute the winning source. To read HIS instructions of how to obtain his winning program one was able to run: -``` +``` make nathan ./nathan ``` diff --git a/1992/vern/README.md b/1992/vern/README.md index 77e4eabd4..555ed3be5 100644 --- a/1992/vern/README.md +++ b/1992/vern/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1992 vern bugs](../../bugs.html#1992_vern). ## To use: -``` +``` ./vern 3 # <-- default is 2 ``` @@ -42,7 +42,7 @@ suggested above. :-) For a real quick game try: -``` +``` ./vern 65 55 @@ -124,7 +124,7 @@ wouldn't pass the character limit. A nice side effect is that the initial source is gloriously difficult to peruse. In particular, the Makefile does: -``` +``` sed vern.tmp.c ``` diff --git a/1992/westley/README.md b/1992/westley/README.md index 2cd0f342e..4442ffb33 100644 --- a/1992/westley/README.md +++ b/1992/westley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -22,7 +22,7 @@ For more detailed information see [1992 westley bugs](../../bugs.html#1992_westl If lost: -``` +``` ./whereami.sh lat long ``` @@ -36,7 +36,7 @@ should just use the `westley` and `westley.alt` programs directly. ## Try: -``` +``` ./try.sh ``` @@ -48,14 +48,14 @@ The author provided a version for the US which we added. To build: ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./whereami.alt.sh lat long ``` @@ -67,7 +67,7 @@ NOTE: this alternative version also needs a terminal with at least 80 columns. The [try.sh](try.sh) script uses both the original entry and the alternate code so one can try the same script for both: -``` +``` ./try.sh ``` @@ -76,7 +76,7 @@ so one can try the same script for both: To find the approximate place where this entry was judged, type: -``` +``` ./whereami 37 -122 # NOTE: - means west of meridian # or if you don't have curses installed: @@ -164,7 +164,7 @@ is reasonably accurate. For a domestic (US) version with higher resolution, try: -``` +``` main(l,a,n,d)char**a;{for(d=atoi(a[1])/2*80-atoi(a[2])-2043; n="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd" [l++-3];)for(;n-->64;)putchar(!d+++33^l&1);} @@ -173,7 +173,7 @@ For a domestic (US) version with higher resolution, try: The code will test the 80-column wrap and document itself if it is joined together as one 160-character line and listed. You should see: -``` +``` main(l,a,n,d)... [A M E R I C A]... ``` diff --git a/1993/ant/README.md b/1993/ant/README.md index 66b39b206..69449c1e7 100644 --- a/1993/ant/README.md +++ b/1993/ant/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,14 +18,14 @@ For more detailed information see [1993 ant bugs](../../bugs.html#1993_ant). ## To use: -``` +``` ./ant 'ERE' [file ...] ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1993/cmills/README.md b/1993/cmills/README.md index 7cbd1b02b..50751a468 100644 --- a/1993/cmills/README.md +++ b/1993/cmills/README.md @@ -4,7 +4,7 @@ We recommend you try the alt version first so you can get a better idea of what this entry was like back in 1993. See the [original code](#original-code) section below to run the original. -``` +``` make alt ``` @@ -16,7 +16,7 @@ requires X11?](../../faq.html#X11macos). To configure how many microseconds to sleep before updates try: -``` +``` make clobber SLEEP=200 alt ``` @@ -34,7 +34,7 @@ For more detailed information see [1993 cmills bugs](../../bugs.html#1993_cmills ## To use: -``` +``` DISPLAY="your_X_server_display" export DISPLAY ./cmills.alt [speed] # must be run on an X11 server @@ -56,7 +56,7 @@ on but you can use the original without any delays if you wish. ### Original build: -``` +``` make all ``` diff --git a/1993/dgibson/README.md b/1993/dgibson/README.md index 39b5ab711..fb08ad8b1 100644 --- a/1993/dgibson/README.md +++ b/1993/dgibson/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dgibson.sh [datafile] ``` @@ -18,7 +18,7 @@ where: ## Try: -``` +``` ./try.sh ``` diff --git a/1993/ejb/README.md b/1993/ejb/README.md index 0a1f272f6..7a97f1c47 100644 --- a/1993/ejb/README.md +++ b/1993/ejb/README.md @@ -1,26 +1,26 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./ejb level ``` where: -``` +``` level a value from -128 to 127 ``` ## Try: -``` +``` ./try.sh ``` @@ -45,7 +45,7 @@ We note that this also works under macOS just fine. #### Output solution to Towers of Hanoi for five rings: -``` +``` ./ejb 5 ``` @@ -54,7 +54,7 @@ text description of how to solve the puzzle. #### Output solution to the Patience puzzle for six rings: -``` +``` ./ejb -6 ``` diff --git a/1993/jonth/README.md b/1993/jonth/README.md index 62ffed00e..389a5f92f 100644 --- a/1993/jonth/README.md +++ b/1993/jonth/README.md @@ -5,14 +5,14 @@ compile. macOS users running Mountain Lion and later will need to download and install [XQuartz](https://www.xquartz.org) in order to compile and run this entry. -``` +``` make all ``` ## To use: -``` +``` ./jonth # must be run on an X11 server ``` diff --git a/1993/leo/README.md b/1993/leo/README.md index df9439aa9..4d670375d 100644 --- a/1993/leo/README.md +++ b/1993/leo/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -9,13 +9,13 @@ To have the computer guess: -``` +``` ./leo [colors] ``` To guess the computer's number: -``` +``` ./mind [colors] ``` diff --git a/1993/lmfjyh/README.md b/1993/lmfjyh/README.md index 127aa6f33..7084bc1bf 100644 --- a/1993/lmfjyh/README.md +++ b/1993/lmfjyh/README.md @@ -2,7 +2,7 @@ If you have gcc < 2.3.3 you can build this entry like: -``` +``` make all ``` @@ -48,7 +48,7 @@ For more detailed information see [1993 lmfjyh bugs](../../bugs.html#1993_lmfjyh If you have gcc < 2.3.3 (i.e. the entry can compile): -``` +``` ./lmfjyh ``` @@ -64,7 +64,7 @@ Nonetheless it will be compiled in case the original entry fails to compile. Should you wish to build this version manually: -``` +``` make alt ``` @@ -99,7 +99,7 @@ that should be familiar to all C-programmers. #### Listing 1: A simple "Hello World" program -``` +``` main() { puts("Hello World!"); @@ -118,14 +118,14 @@ the file. #### Listing 2: Compressed "Hello world" -``` +``` char*_=__FILE__; ``` #### Listing 3: Code embedded in the file name -``` +``` ";main(){puts("Hello World!");}char*C=".c ``` diff --git a/1993/plummer/README.md b/1993/plummer/README.md index ba076c352..036193a5b 100644 --- a/1993/plummer/README.md +++ b/1993/plummer/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make alt ``` @@ -12,21 +12,21 @@ code](#original-code) below. If you wish to speed the entry up, say to 500 microseconds between writes, try: -``` +``` make clobber SLEEP=500 alt ``` Alternatively if you wish to slow it down, say to 1500 microseconds between writes, try: -``` +``` make clobber SLEEP=1500 alt ``` ## To use: -``` +``` ./plummer.alt number arg ``` @@ -42,7 +42,7 @@ bypass](https://hitchhikers.fandom.com/wiki/Bypass). ## Try: -``` +``` ./try.alt.sh ./try.alt.sh 21701 @@ -70,7 +70,7 @@ course). ### Original build: -``` +``` make all ``` @@ -82,7 +82,7 @@ Use `plummer` as you would `plummer.alt` above. ### Original try: -``` +``` ./try.sh ./try.sh 21701 diff --git a/1993/rince/README.md b/1993/rince/README.md index 2b51f33c6..41e6be214 100644 --- a/1993/rince/README.md +++ b/1993/rince/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -22,7 +22,7 @@ For more detailed information see [bugs report with 1993/rince](../../bugs.html# ## To use: -``` +``` ./rince [cabbage] ``` @@ -37,13 +37,13 @@ Some people may want to slow down the game by increasing the value 17 in the lines: -``` +``` struct timeval v= {0,1<<17} ; ``` and -``` +``` refresh(),c=select(k,&y,0,0,(v.tv_usec=1<<17,&v))?getch():0; ``` @@ -57,7 +57,7 @@ changed). ### Alternate build: -``` +``` make SLEEP=18 clobber alt ``` @@ -107,7 +107,7 @@ with the curses library (typically `/lib/libcurses.a` for static libraries) used. It has been suggested that the following gcc command may help: -``` +``` gcc -fno-builtin -I/usr/include -o rince rince.c -lcurses -ltermcap ``` diff --git a/1993/schnitzi/README.md b/1993/schnitzi/README.md index 630f5978b..0f0e24325 100644 --- a/1993/schnitzi/README.md +++ b/1993/schnitzi/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1993 schnitzi bugs](../../bugs.html#1993_schn ## To use: -``` +``` ./schnitzi file ``` @@ -33,14 +33,14 @@ in [1993 schnitzi bugs](../../bugs.html#1993_schnitzi). ## Try: -``` +``` ./schnitzi schnitzi.info # ask some questions suggested by the author, noted below ``` We also suggest you ask the program the following questions: -``` +``` Who is Mark Schnitzus? Who was Jack the Ripper ? @@ -51,7 +51,7 @@ intentional spelling error there. Try feeding the program source to the program and ask both: -``` +``` What is cat ? What is cat? ``` diff --git a/1993/vanb/README.md b/1993/vanb/README.md index 3223518e2..1125bda3b 100644 --- a/1993/vanb/README.md +++ b/1993/vanb/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1993 vanb bugs](../../bugs.html#1993_vanb). ## To use: -``` +``` ./vanb 'exp' ``` @@ -28,7 +28,7 @@ hexadecimal and decimal numbers. ## Try: -``` +``` ./try.sh ``` @@ -133,7 +133,7 @@ Here's a version of the program before it got formatted into the VIII, augmented with comments showing where each state begins. `N1` and `N2` are notes: -``` +``` #define O5 main O5(O2,O7,O3)char**O7; { @@ -180,14 +180,14 @@ printf, and sends the parser to state `012` (which is ``). The `E` and `T` states work like this: -``` +``` int e(){ return eprime( t() ); } ``` The `E'` and `T'` states work like this: -``` +``` int eprime( int intermediate ) { if( ch == '+' ) @@ -202,7 +202,7 @@ The `E'` and `T'` states work like this: The `D`, `X` and `O` states work like this (they assume that they're initially called with `0`): -``` +``` int octal( int intermediate ) { if( ch>='0' && ch<='7' ) diff --git a/1994/dodsond1/README.md b/1994/dodsond1/README.md index ff0dd74e9..7496a57b0 100644 --- a/1994/dodsond1/README.md +++ b/1994/dodsond1/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dodsond1 ``` diff --git a/1994/dodsond2/README.md b/1994/dodsond2/README.md index 1da32eb2a..39f5eb6b4 100644 --- a/1994/dodsond2/README.md +++ b/1994/dodsond2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -23,7 +23,7 @@ For more detailed information see [1994 dodsond2 bugs](../../bugs.html#1994_dods ## To use: -``` +``` ./dodsond2 ``` @@ -39,21 +39,21 @@ from working in some cases. ### Alternate build: -``` +``` make alt ``` The default number of arrows in this version is 3 but if you want to change it, say to 5, try: -``` +``` make clobber ARROWS=5 alt ``` ### Alternate use: -``` +``` ./dodsond2.alt ``` diff --git a/1994/horton/README.md b/1994/horton/README.md index 8a38f2227..eb3677888 100644 --- a/1994/horton/README.md +++ b/1994/horton/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./horton A B C D ``` @@ -16,7 +16,7 @@ ## Try: -``` +``` ./try.sh ``` @@ -29,14 +29,14 @@ version. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./horton.alt A B C D ``` @@ -45,7 +45,7 @@ Where A, B, C and D are numbers like with `horton`. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -80,7 +80,7 @@ It's easily modified to graph *any* 96x160 bitmap on a dumb terminal. See the [gtface](gtface.c) program for another example. Try: -``` +``` make gtface ./gtface < gtface.data ``` diff --git a/1994/imc/README.md b/1994/imc/README.md index 4cb8e1e3a..16584e787 100644 --- a/1994/imc/README.md +++ b/1994/imc/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./imc [NUMBER] ``` @@ -16,7 +16,7 @@ where `[NUMBER]` is an optional number. Default is 5. ## Try: -``` +``` ./try.sh ``` diff --git a/1994/ldb/README.md b/1994/ldb/README.md index f0082cd05..a68b65ddf 100644 --- a/1994/ldb/README.md +++ b/1994/ldb/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1994 ldb bugs](../../bugs.html#1994_ldb). ## To use: -``` +``` ./ldb < file some_command | ./ldb @@ -27,7 +27,7 @@ For more detailed information see [1994 ldb bugs](../../bugs.html#1994_ldb). ## Try: -``` +``` ./try.sh ``` diff --git a/1994/schnitzi/README.md b/1994/schnitzi/README.md index 06c925d81..18c6a1102 100644 --- a/1994/schnitzi/README.md +++ b/1994/schnitzi/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -23,14 +23,14 @@ For more detailed information see [1994 schnitzi bugs](../../bugs.html#1994_schn ## To use: -``` +``` ./schnitzi < textfile ``` ## Try: -``` +``` ./try.sh ``` @@ -49,7 +49,7 @@ buffer size. This is due to a comment which is explained in more detail in ### Alternate build: -``` +``` make alt ``` @@ -62,7 +62,7 @@ feeding the source code to it will not work right. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -71,7 +71,7 @@ feeding the source code to it will not work right. Try: -``` +``` ./schnitzi < schnitzi.c ``` @@ -96,14 +96,14 @@ is run by redirecting a file into the executable on the command line; for instance, for the file 'info', the program would be run as follows: -``` +``` ./schnitzi < info ``` The program generates interesting results when its source file is used as input: -``` +``` ./schnitzi < schnitzi.c ``` diff --git a/1994/shapiro/README.md b/1994/shapiro/README.md index f99824384..0f27b0386 100644 --- a/1994/shapiro/README.md +++ b/1994/shapiro/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -19,7 +19,7 @@ For more detailed information see [1994 shapiro bugs](../../bugs.html#1994_shapi ## To use: -``` +``` ./shapiro & ``` @@ -28,7 +28,7 @@ Now find the clock in the same terminal window (or console if at the console). ## Try: -``` +``` ./shapiro ^Z bg diff --git a/1994/smr/README.md b/1994/smr/README.md index 4c7feef23..27e8f3f6b 100644 --- a/1994/smr/README.md +++ b/1994/smr/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./smr ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1994/tvr/README.md b/1994/tvr/README.md index 19d356653..7956af2f1 100644 --- a/1994/tvr/README.md +++ b/1994/tvr/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -22,7 +22,7 @@ For more detailed information see [1994 tvr bugs](../../bugs.html#1994_tvr). ## To use: -``` +``` ./tvr mode screensize/2 < colormapfile ``` @@ -31,7 +31,7 @@ Mode may be a value from 0 to 12. ## Try: -``` +``` ./try.color.sh # for colour displays ./try.bw.sh # for Black & White displays ``` @@ -44,14 +44,14 @@ The author provided us a spoiler version that might be of interest to some. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./tvr.alt altmode screensize/2 < colormapfile ``` @@ -61,7 +61,7 @@ where `altmode` `1` - `4` correspond to mode `0` - `3` in the original entry and ### Alternate try: -``` +``` ./try.alt.color.sh # for colour displays ./try.alt.bw.sh # for Black & White displays ``` @@ -123,7 +123,7 @@ the fourth is a variation of that with more nice effects. ### Usage: -``` +``` ./tvr mode screensize/2 < colormapfile ``` diff --git a/1994/weisberg/README.md b/1994/weisberg/README.md index f12d8ab7b..9f4a20207 100644 --- a/1994/weisberg/README.md +++ b/1994/weisberg/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -10,20 +10,20 @@ code](#alternate-code) below for more details. ## To use: -``` +``` ./weisberg ``` ## Try: -``` +``` ./try.sh ``` If you have `primes(1)` installed you might also wish to try: -``` +``` ./primes.sh number ``` @@ -40,14 +40,14 @@ something with you might try this version. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./weisberg.alt ``` diff --git a/1994/westley/README.md b/1994/westley/README.md index 7707e4bd4..4bd6e8a1a 100644 --- a/1994/westley/README.md +++ b/1994/westley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make alt ``` @@ -15,7 +15,7 @@ see [Original code](#original-code) below. ## To use: -``` +``` ./westley.alt ``` @@ -39,14 +39,14 @@ from start to finish. For something more interesting try compiling it with different `cc -D` arguments and then run the program each time. For example: -``` +``` cc -Describe -Door westley.alt.c -o westley.alt && ./westley.alt cc -Describe -Drain westley.alt.c -o westley.alt && ./westley.alt ``` To see the game from start to finish, try: -``` +``` ./try.alt.sh ``` @@ -65,7 +65,7 @@ reason that we recommend you try it first. ### Original build: -``` +``` make all ``` @@ -95,14 +95,14 @@ error messages; there is no running the program. For something more interesting try compiling it with different `cc -D` arguments: -``` +``` cc -Describe -Door westley.c cc -Describe -Drain westley.c ``` To see the game from start to complete, try: -``` +``` ./try.sh ``` @@ -115,7 +115,7 @@ For spoilers see the end of the notes from the author below. To use: -``` +``` ./try.sh ``` @@ -131,7 +131,7 @@ This program is a simple adventure game which uses only C preprocessor error messages (for missing `#include` files) as output. To begin, try to compile the program with no options: -``` +``` cc westley.c ``` @@ -159,7 +159,7 @@ missing include file name, which functions as the game text. To "do" things, all words must start with `-D`. For example, to look at the door, do: -``` +``` cc -Describe -Door prog.c ``` @@ -176,7 +176,7 @@ Here is a walk-through for the game, including a few dead-ends: ### SPOILER -``` +``` cc -Describe -Door westley.c cc -Describe -Drain westley.c cc -Describe -Dwarf westley.c diff --git a/1995/cdua/README.md b/1995/cdua/README.md index f8fb27678..7fc97fe6e 100644 --- a/1995/cdua/README.md +++ b/1995/cdua/README.md @@ -4,7 +4,7 @@ We recommend that you try the alternate version first so you can see what this entry looked like back in 1995 (with a configurable speed). See the [original code](#original-code) section below for the original entry. -``` +``` make alt ``` @@ -28,14 +28,14 @@ For more detailed information see [1995 cdua bugs](../../bugs.html#1995_cdua). ## To use: -``` +``` ./cdua.alt ``` ## Try: -``` +``` make SLEEP=1500 clobber alt ./cdua.alt # press enter and watch it go much faster! @@ -43,7 +43,7 @@ For more detailed information see [1995 cdua bugs](../../bugs.html#1995_cdua). You might also like to try: -``` +``` make SLEEP=65000 clobber alt ./cdua.alt # press enter and watch it go much slower! @@ -66,14 +66,14 @@ fast your computer is :-) or use both to see the difference, you can do so. ### Original build: -``` +``` make all ``` ### Original use: -``` +``` ./cdua ``` diff --git a/1995/dodsond1/README.md b/1995/dodsond1/README.md index 41a232325..419226ca3 100644 --- a/1995/dodsond1/README.md +++ b/1995/dodsond1/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dodsond1 < text_file ``` ## Try: -``` +``` ./dodsond1 < README.md ``` @@ -32,7 +32,7 @@ You might consider giving the following input: ... which can be done like: -``` +``` ./try.sh ``` diff --git a/1995/dodsond2/README.md b/1995/dodsond2/README.md index 730f6386a..e25834b53 100644 --- a/1995/dodsond2/README.md +++ b/1995/dodsond2/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dodsond2 ``` diff --git a/1995/esde/README.md b/1995/esde/README.md index d630bb55c..f8461cf15 100644 --- a/1995/esde/README.md +++ b/1995/esde/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./esde data-file word ``` @@ -16,7 +16,7 @@ where data-file contains lines of < 255 chars in length. ## Try: -``` +``` ./try.sh ``` diff --git a/1995/garry/README.md b/1995/garry/README.md index 2c87e7da6..f088f7330 100644 --- a/1995/garry/README.md +++ b/1995/garry/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./garry output_file ``` ## Try: -``` +``` ./try.sh ``` @@ -29,21 +29,21 @@ left intact) looked very much like a rat "dropping core". See ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./garry.alt output_file ``` ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -63,13 +63,13 @@ environment variables. The calling syntax is pretty simple, just use it with `stdio`-redirection or inside pipelines, e.g.: -``` +``` ./garry converted_file ``` or -``` +``` cat all_my_files/* | ./garry | lp ``` @@ -87,7 +87,7 @@ Unknown Env-variables or malformed expressions are ignored and kept intact. Additionally, the filter replaces escaped octal values in the environment variables by their binary representation, e.g.: -``` +``` $ TEST="\110\145\154\154\157" $ export TEST $ echo '$TEST$' | ./garry diff --git a/1995/heathbar/README.md b/1995/heathbar/README.md index 22300ad07..e0a76e93a 100644 --- a/1995/heathbar/README.md +++ b/1995/heathbar/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./heathbar num num ``` @@ -16,7 +16,7 @@ where num is a non-negative number. ## Try: -``` +``` ./try.sh ``` diff --git a/1995/leo/README.md b/1995/leo/README.md index d41fa0228..66f989683 100644 --- a/1995/leo/README.md +++ b/1995/leo/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1995 leo bugs](../../bugs.html#1995_leo). ## To use: -``` +``` ./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ] ``` @@ -27,7 +27,7 @@ See the author's information below on these details. ## Try: -``` +``` ./try.sh ``` @@ -52,7 +52,7 @@ characters on the command line - anything that's not a number is a candidate.) The usage is: -``` +``` ./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ] ``` @@ -68,7 +68,7 @@ to be present if you want to enter `freq` (and you usually do). Some options to try (besides the obvious): -``` +``` ./leo 1 | cat - /dev/tty | gs - ``` @@ -191,19 +191,19 @@ the opening for step 1 is not a single line but a cross: To watch it repeatedly (as a screen saver), use: -``` +``` ./leo 2 | cat - /dev/tty | gs - ``` The command line: -``` +``` ./leo Variable 1 | cat - /dev/tty | gs - ``` draws the same as above. Try: -``` +``` ./leo Variable 1 1 | cat - /dev/tty | gs - ``` @@ -228,7 +228,7 @@ If `Variable` is used, the actual value of `cycle` doesn't matter, as far as it is > 1. To figure out what difference `cycle` makes when `Variable` is not used, try -``` +``` ./leo Variable 37 80 | cat - /dev/tty | gs - ``` diff --git a/1995/makarios/README.md b/1995/makarios/README.md index 764a049c8..3a6d5857f 100644 --- a/1995/makarios/README.md +++ b/1995/makarios/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./makarios ``` diff --git a/1995/savastio/README.md b/1995/savastio/README.md index 1535c4c45..c7dd92b46 100644 --- a/1995/savastio/README.md +++ b/1995/savastio/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1995 savastio bugs](../../bugs.html#1995_sava ## To use: -``` +``` ./savastio # enter a POSITIVE number such as 100 ``` @@ -29,7 +29,7 @@ what happens if you give a non-number? ## Try: -``` +``` ./try.sh ``` diff --git a/1995/schnitzi/README.md b/1995/schnitzi/README.md index ce1dcc707..dbd7c3b89 100644 --- a/1995/schnitzi/README.md +++ b/1995/schnitzi/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./schnitzi num ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1995/spinellis/README.md b/1995/spinellis/README.md index b204ba18c..5680d843b 100644 --- a/1995/spinellis/README.md +++ b/1995/spinellis/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./spinellis < spinellis.c ``` diff --git a/1995/vanschnitz/README.md b/1995/vanschnitz/README.md index 16b12e557..5c8367c6b 100644 --- a/1995/vanschnitz/README.md +++ b/1995/vanschnitz/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -21,14 +21,14 @@ For more detailed information see [1995 vanschnitz bugs](../../bugs.html#1995_va ## To use: -``` +``` ./vanschnitz ``` ## Try: -``` +``` ./try.sh ``` @@ -43,7 +43,7 @@ to first try and figure out the program without the spoiler. ### Alternate build: -``` +``` make alt ``` @@ -84,7 +84,7 @@ line. For instance, to cause the compiler to solve the Towers of Hanoi problem with four disks, you would compile the program like this: -``` +``` gcc hanoi.c -o hanoi -Dn=4 ``` @@ -111,7 +111,7 @@ concatenated; a version that does not use this feature has been included for people who can only run K&R). A good way to see the resulting program (on a Unix system) is to do the command -``` +``` gcc hanoi.c -E -Dn=5 | grep -v \# | grep -v ^\$ ``` diff --git a/1996/august/README.md b/1996/august/README.md index a941d549e..3ccd30412 100644 --- a/1996/august/README.md +++ b/1996/august/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1996 august bugs](../../bugs.html#1996_august ## To use: -``` +``` cat august.c test.oc | ./august > test.oo ./august < test.oo ``` @@ -33,7 +33,7 @@ The above should print a `!` followed by a newline. ## Try: -``` +``` ./try.sh ``` @@ -43,33 +43,33 @@ The above should print a `!` followed by a newline. This entry can feed on itself. If you C pre-process the source, you can compile the interpreter: -``` +``` make august.oc ``` We can now compile the interpreter as follows: -``` +``` cat august.c august.oc | ./august > august.oo ``` and use the compiled interpreter to execute some previously compiled code: -``` +``` cat august.oo test.oo | ./august ``` And we can have the compiled interpreter interpret itself which in turn compiles the test program: -``` +``` cat august.oo august.oo fac.oo | ./august ``` And if you have lots of spare time, you can recurse one level deeper: -``` +``` cat august.oo august.oo august.oo fac.oo | ./august ``` @@ -107,25 +107,25 @@ can go wrong. But this is what seasoned C programmers are used to. Assume that the interpreter has been compiled (source in [august.c](august.c) and binary in august) and that we have this in a file named `test.oc`: -``` +``` main() { putchar('!'); putchar('\n'); exit(0); } ``` We can then compile by -``` +``` cat august.c test.oc | ./august > test.oo ``` And run the compiled program by -``` +``` ./august < test.oo ``` Or even simpler: -``` +``` cat august.c test.oc | ./august | ./august ``` @@ -141,26 +141,26 @@ need to use an external one. To pre-process [august.c](august.c) use the command from the Makefile, but add the `-E` flag and change 60000 to 40000, i.e.: -``` +``` cc -E -DZ=40000 .... august.c > august.oc ``` If `august.oc` contain some junk line starting with a `#` (most likely it does) then remove it like: -``` +``` sed -i'' '/^#/d' august.oc ``` OK, we can now compile the interpreter: -``` +``` cat august.c august.oc | ./august > august.oo ``` And we can run it: -``` +``` cat august.oo test.oo | ./august ``` @@ -168,13 +168,13 @@ Here we have the interpreter interpreting another interpreter that runs the program. Did you think that was too fast? Just throw in another level of interpretation: -``` +``` cat august.oo august.oo test.oo | ./august ``` And another... -``` +``` cat august.oo august.oo august.oo test.oo | ./august ``` diff --git a/1996/dalbec/README.md b/1996/dalbec/README.md index 5796ed640..d2706e4f5 100644 --- a/1996/dalbec/README.md +++ b/1996/dalbec/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dalbec ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1996/eldby/README.md b/1996/eldby/README.md index 36abe14e5..7cc1457cd 100644 --- a/1996/eldby/README.md +++ b/1996/eldby/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make alt ``` @@ -11,7 +11,7 @@ section. ## To use: -``` +``` ./eldby.alt ``` @@ -28,7 +28,7 @@ problematic for some people, can be configured to different speeds by way of the value used in `usleep()`. The default is `35000` but you can easily change it. To do so try: -``` +``` make SLEEP=20000 clobber alt ./eldby.alt ``` @@ -41,7 +41,7 @@ This version is the original which has no sleep time in between updates. ### Original build: -``` +``` make all ``` diff --git a/1996/gandalf/README.md b/1996/gandalf/README.md index c6aef9239..3e78cde14 100644 --- a/1996/gandalf/README.md +++ b/1996/gandalf/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,14 +18,14 @@ For more detailed information see [1996 gandalf bugs](../../bugs.html#1996_ganda ## To use: -``` +``` ./gandalf ``` ## Try: -``` +``` ./try.sh ``` @@ -41,7 +41,7 @@ BTW: it is perilous to 'try' the patience of For misleading C pre-processor output, try: -``` +``` cc -E gandalf.c ``` diff --git a/1996/huffman/README.md b/1996/huffman/README.md index df03524be..4c3dd9796 100644 --- a/1996/huffman/README.md +++ b/1996/huffman/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,14 +18,14 @@ For more detailed information see [1996 huffman bugs](../../bugs.html#1996_huffm ## To use: -``` +``` echo 'Huffman Decoding' | ./huffman ``` ## Try: -``` +``` ./try.sh ``` @@ -39,7 +39,7 @@ And for a misleading hint, consider who won! :-) And if you really can't see what is going on, here is an extra spoiler: -``` +``` ./huffman < huffman.c 2>/dev/null ``` diff --git a/1996/jonth/README.md b/1996/jonth/README.md index d6ebb244e..84db26202 100644 --- a/1996/jonth/README.md +++ b/1996/jonth/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -24,7 +24,7 @@ For more detailed information see [1996 jonth bugs](../../bugs.html#1996_jonth). ## To use: -``` +``` ./jonth :0 :0 ``` @@ -35,7 +35,7 @@ off the other so that you can properly play. NOTE: if there is no X service open this will crash. If this is the case you might try: -``` +``` ./jonth ``` @@ -49,7 +49,7 @@ These are supposed to happen. As is written in the ## Try: -``` +``` ./jonth host1:0 host2:0 ``` diff --git a/1996/rcm/README.md b/1996/rcm/README.md index 44ef7702d..3ec41f1cc 100644 --- a/1996/rcm/README.md +++ b/1996/rcm/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./rcm < file.gz ``` @@ -18,7 +18,7 @@ where `file.gz` is some gzipped file. For more information try: -``` +``` ./try.sh ``` @@ -27,7 +27,7 @@ For more information try: For a good no-op try: -``` +``` gzip -c < rcm.c | ./rcm ``` diff --git a/1996/schweikh1/README.md b/1996/schweikh1/README.md index 696e76757..943eef837 100644 --- a/1996/schweikh1/README.md +++ b/1996/schweikh1/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./schweikh1 ``` @@ -17,7 +17,7 @@ To find the day that Easter falls on in the current year and to show all Easter dates from 1582 to 2199: -``` +``` ./try.sh ``` diff --git a/1996/schweikh2/README.md b/1996/schweikh2/README.md index b37a4f2c5..e83379aa9 100644 --- a/1996/schweikh2/README.md +++ b/1996/schweikh2/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./schweikh2 ``` @@ -24,19 +24,19 @@ The program accepts up to 4 parameters: ## Try: -``` +``` ./try.sh ``` What happens if you pass only three parameters like the below? -``` +``` ./schweikh2 15 1 0 ``` The author also suggests: -``` +``` while :; do grep -v '#' schweikh2.c; done ``` @@ -51,7 +51,7 @@ The original program, with only slight obfuscations, may be found in [hunni.c](hunni.c). The perl script, [hunni.pl](hunni.pl), obfuscates it appropriately. Try: -``` +``` less hunni.c perl ./hunni.pl < hunni.c @@ -137,7 +137,7 @@ minutes (`gcc -O3`). ### Sample arguments: -``` +``` ./schweikh2 6 ./schweikh2 7 0 ./schweikh2 7 7 0 @@ -151,7 +151,7 @@ minutes (`gcc -O3`). The diamond pattern can be continued without a break. For a nice printout try this on your Bourne compatible shell: -``` +``` while :; do grep -v '#' schweikh2.c; done ``` diff --git a/1996/schweikh3/README.md b/1996/schweikh3/README.md index 8cbd86fdc..97602c521 100644 --- a/1996/schweikh3/README.md +++ b/1996/schweikh3/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -12,7 +12,7 @@ It may render your system unusable for a limited amount of time or force you to reboot using the Big Red Button! This is **NOT** a joke. You have been warned. -``` +``` ./schweikh3 ``` @@ -27,7 +27,7 @@ systems. But still it is a useful utility. To use try: -``` +``` ./schweikh3 ``` @@ -57,7 +57,7 @@ You have to select maximum ANSI C conformance of your compiler. The source fails to compile under a C++ compiler due to the `new' identifier which is a C++ reserved word: -``` +``` $ g++ schweikh3.c schweikh3.c:9: parse error before `new' schweikh3.c:16: parse error before `new' @@ -71,7 +71,7 @@ the `new' identifier which is a C++ reserved word: The source fails to compile on compilers that recognize the inline keyword by default, e.g. gcc: -``` +``` $ gcc schweikh3.c schweikh3.c:46: parse error before `void' schweikh3.c: In function `main': diff --git a/1996/westley/README.md b/1996/westley/README.md index fbbc52e47..28d24dabe 100644 --- a/1996/westley/README.md +++ b/1996/westley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -11,7 +11,7 @@ ## To use: -``` +``` ./clock1.sh ./clock2.sh ./clock3.sh @@ -20,7 +20,7 @@ ## Try: -``` +``` ./try.sh ``` @@ -34,14 +34,14 @@ provided, to show the differences. ### Alternate build: -``` +``` make alt ``` ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -81,7 +81,7 @@ larger. The code is simple; the arguments passed are: -``` +``` ./westley minute_map hour_map hand_symbol clock_image ``` diff --git a/1998/banks/README.md b/1998/banks/README.md index 636defc25..1d16b5cbf 100644 --- a/1998/banks/README.md +++ b/1998/banks/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -34,14 +34,14 @@ macros to, depending on what controls you wish to redefine. For instance, to set the throttle up and down to `u` and `d`: -``` +``` make clobber IT=XK_u DT=XK_d all ``` because in the header file you can see that `XK_u` corresponds to `u` and `XK_d` corresponds to `d`: -``` +``` #define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */ #define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */ ``` @@ -63,7 +63,7 @@ preselected alternative keys. ## To use: -``` +``` cat horizon.sc pittsburgh.sc | ./banks ``` @@ -106,7 +106,7 @@ the right side for movement. These are hard coded, as noted. To use the default settings for the alternate build: -``` +``` make alt ``` @@ -231,7 +231,7 @@ Here is a brief description of the scenery files: A few examples of how to input scenery: -``` +``` cat horizon.sc pittsburgh.sc | ./banks cat mountains.sc bb.sc | ./banks cat mountains.sc river.sc pyramids.sc | ./banks @@ -240,7 +240,7 @@ A few examples of how to input scenery: You can simulate flying through a cloud bank as well: -``` +``` ./banks < /dev/null ``` diff --git a/1998/bas1/README.md b/1998/bas1/README.md index 377fb73d8..0cacbed3a 100644 --- a/1998/bas1/README.md +++ b/1998/bas1/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./bas1.sh ``` diff --git a/1998/bas2/README.md b/1998/bas2/README.md index 907b4b967..3541e0a47 100644 --- a/1998/bas2/README.md +++ b/1998/bas2/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./bas2 < file echo text | ./bas2 ``` @@ -15,7 +15,7 @@ ## Try: -``` +``` ./try.sh ./try.sh "foo bar" "baz" "IOCCC 1998/bas2" README.md diff --git a/1998/chaos/README.md b/1998/chaos/README.md index 3570f3747..87b3885cb 100644 --- a/1998/chaos/README.md +++ b/1998/chaos/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make chaos ``` @@ -8,21 +8,21 @@ NOTE: Some systems do not implement `halfdelay()` in their `libcurses`. You might try compiling with -lncurses if you have that library. Or you can build this entry without the `halfdelay()` call by: -``` +``` make chaos_nohalf ``` ## To use: -``` +``` ./chaos ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1998/df/README.md b/1998/df/README.md index a9b3a5626..879527099 100644 --- a/1998/df/README.md +++ b/1998/df/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./df ``` ## Try: -``` +``` ./try.sh ``` diff --git a/1998/dlowe/README.md b/1998/dlowe/README.md index 421244af9..cb4e9c099 100644 --- a/1998/dlowe/README.md +++ b/1998/dlowe/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -10,7 +10,7 @@ below for more details. ## To use: -``` +``` ./dlowe < file > pootfile ./dlowe < file @@ -30,7 +30,7 @@ For more detailed information see [1998 dlowe bugs](../../bugs.html#1998_dlowe). ## Try: -``` +``` ./dlowe < README.md ./dlowe < README.md > README.poot.md ``` @@ -39,7 +39,7 @@ Why is there different output? Also try: -``` +``` ./try.sh ``` @@ -54,7 +54,7 @@ that program. ### Alternate build: -``` +``` make alt ``` @@ -70,7 +70,7 @@ What's the difference between this and `dlowe`? ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -93,7 +93,7 @@ more consistent level of quality. :-) A CGI script such as: -``` +``` #!/bin/sh # pootify - a sample CGI pootifier # @@ -131,7 +131,7 @@ should use the above one instead. You can use the script [pootify.sh](pootify.sh), however, to download and generate html files that you can look at locally in a browser or pipe through `less(1)`. For instance: -``` +``` ./pootify.sh URL=https://microsoft.com | less ./pootify.sh -r URL=https://microsoft.com > ms.html @@ -143,7 +143,7 @@ it in a browser. For an old example of it working as a CGI script see: -``` +``` https://web.archive.org/web/20040326083431/http://www.pootpoot.com/poot/pootify/?URL=http%3A%2F%2Fwww.ioccc.org ``` diff --git a/1998/dloweneil/README.md b/1998/dloweneil/README.md index 4cf455f44..9a1265634 100644 --- a/1998/dloweneil/README.md +++ b/1998/dloweneil/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -22,7 +22,7 @@ For more detailed information see [1998 dloweneil bugs](../../bugs.html#1998_dlo ## To use: -``` +``` ./pootris [X size of board] [Y size of board] ``` @@ -45,14 +45,14 @@ clockwise `l` does as well. Instead of using `d` to drop the letter you can do ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./pootris.alt [X size of board] [Y size of board] ``` @@ -73,7 +73,7 @@ experience may mirror one of our experiences: ### Usage -``` +``` ./pootris [X size of board] [Y size of board] ``` diff --git a/1998/dorssel/README.md b/1998/dorssel/README.md index 565f286b3..f9b794641 100644 --- a/1998/dorssel/README.md +++ b/1998/dorssel/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./dorssel # input some text @@ -17,7 +17,7 @@ ## Try: -``` +``` ./try.sh ``` @@ -48,7 +48,7 @@ altering the behavior ? Try doing what the last part of the last command in [try.sh](try.sh) suggests. As in, do the following: -``` +``` echo ". -..- . .-. -.-. .. ... . -.-. .... .- -. --. . - .... . .--. .-. --- --. .-. .- -- ... --- .. - -.. --- . ... -. --- - ... .... --- ..- -" | ./dorssel ``` @@ -91,7 +91,7 @@ invoke undefined behavior. Try: -``` +``` ./dorssel < dorssel.c | ./dorssel ``` @@ -101,20 +101,20 @@ better job than most C beautifiers). - Filter your text twice (as in the previous sample) to obtain a version of your text that can be reversibly Morsified, i.e. -``` +``` ./dorssel < dorssel.c | ./dorssel | ./dorssel | ./dorssel ``` is the same as -``` +``` ./dorssel < dorssel.c | ./dorssel ``` - The file [dorssel.md](dorssel.md) contains all the information needed to understand this program. For an obfuscated spoiler, try -``` +``` ./dorssel < dorssel.md ``` diff --git a/1998/dorssel/dorssel.md b/1998/dorssel/dorssel.md index 189745f1e..22e81488e 100644 --- a/1998/dorssel/dorssel.md +++ b/1998/dorssel/dorssel.md @@ -42,7 +42,7 @@ That means bits 6 and 5 set to 00 is length 1, set to 01 is length 2, etc. But this would mean that we would have to extract the length into a counter before shifting out each symbol, such as -``` +``` length = (encoding & 96) >> 5; do { putchar(encoding & 1 ? '-' : '.'); @@ -62,7 +62,7 @@ We can also use the remaining bits to *include* the counter with 1 bit still to be chosen freely (let's assume it is 0). Now we can do -``` +``` do { putchar(encoding & 1 ? '-' : '.'); encoding >>= 1; @@ -87,7 +87,7 @@ Notice these encodings in the initialization string. Only the coding for `5` needs an escape (`5 = ..... > 01111111 = '\177'`). The way the length is encoded still allows the encoding to be its own counter: -``` +``` do { putchar(encoding & 1 ? '-' : '.'); encoding = (encoding + 32) >> 1; @@ -101,7 +101,7 @@ precision, so that the actual value of the `char` remains `<= 127`. The character `'-'` (ASCII 45) and `'.'` (ASCII 46) are conveniently in sequence, so the putchar can simply be -``` +``` putchar(45 + encoding % 2); ``` @@ -110,7 +110,7 @@ The assignment can be incorporated into the `while` control test, and a `do-while` loop with a body of a single expression statement can be written as a `while` loop with a comma operator in the test: -``` +``` while(putchar(45 + encoding % 2), encoding = encoding + 32 >> 1); ``` diff --git a/1998/fanf/README.md b/1998/fanf/README.md index dc28c88af..d85fe5401 100644 --- a/1998/fanf/README.md +++ b/1998/fanf/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -10,7 +10,7 @@ this entry because of the system resources it requires. ## To use: -``` +``` ./fanf ``` @@ -19,7 +19,7 @@ this entry because of the system resources it requires. Enter an expression on standard input. To try some we have selected: -``` +``` ./try.sh ``` @@ -47,7 +47,7 @@ can you begin to understand what it is doing? Look at the first stage of the C pre-processing which was done like: -``` +``` cc fanf.c -E > fanftmp1.c ``` diff --git a/1998/schnitzi/README.md b/1998/schnitzi/README.md index cbf0e96d1..cbec70cfd 100644 --- a/1998/schnitzi/README.md +++ b/1998/schnitzi/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [1998 schnitzi bugs](../../bugs.html#1998_schn ## To use: -``` +``` ./schnitzi n > sort.c make sort ./sort @@ -32,14 +32,14 @@ where `n` and `x`, `y` and `z` are numbers. ## Try: -``` +``` ./try.sh ``` What happens if at the command line you don't specify `n` numbers that the program expects? For instance try: -``` +``` ./schnitzi 5 > sort.c make sort @@ -99,7 +99,7 @@ a depth of one. So what does it do? Give it an integer `(1 < n < 27)` on the command line, such as -``` +``` ./schnitzi 5 ``` @@ -109,7 +109,7 @@ them, however, using only `if/else` statements, without arrays or looping. To see the resulting program run, redirect the output from `schnitzi` into another file, like this -``` +``` ./schnitzi 4 > sort.c ``` diff --git a/1998/schweikh1/README.md b/1998/schweikh1/README.md index c70e413e5..989619651 100644 --- a/1998/schweikh1/README.md +++ b/1998/schweikh1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -12,7 +12,7 @@ includes some interesting details about the entry. ## To use: -``` +``` ./schweikh1 ``` @@ -30,7 +30,7 @@ if you don't have a Mac as it has some interesting details about the entry. ### Alternate build: -``` +``` make alt ``` @@ -126,7 +126,7 @@ macros can be defined, because you could write strictly conforming programs that may fail to compile due to syntax errors: supposing that `` defines `PIPE_BUF`, then the conforming -``` +``` #include #include /* <- or where the bogus macro is defined */ #include @@ -155,7 +155,7 @@ C compilers. must resemble one of the canonical forms, `"foo.h"` or ``. This lets us write things like -``` +``` #define HEADER "foo.h" #include HEADER ``` @@ -164,7 +164,7 @@ C compilers. torturing the preprocessor a little more, by using token pasting, at least one compiler falls over. -``` +``` #define H(x) #include H(dio) /* expands to */ ``` @@ -187,7 +187,7 @@ C compilers. ISO 6.8.4. ISO 6.1.4 defines string literals as s-char-sequences, which may include octal escape sequences. Let's look at -``` +``` #include #line 42 "foo\0bar" int main (void) { @@ -214,7 +214,7 @@ C compilers. under his/her nose. Easy money from a bet! Make sure your guru has no chance to use Standardese weasel words as an escape: can I have -``` +``` case : case : ``` @@ -255,7 +255,7 @@ script to compute the character count according to the rules. The advantages of an independent clean room approach... -``` +``` #!/usr/bin/perl -w $/ = "\0"; $_ = <>; @@ -266,7 +266,7 @@ The advantages of an independent clean room approach... To use, try: -``` +``` perl ./charcount.pl schweikh1.c ``` diff --git a/1998/schweikh1/macos.md b/1998/schweikh1/macos.md index 29187e070..385960a6a 100644 --- a/1998/schweikh1/macos.md +++ b/1998/schweikh1/macos.md @@ -19,7 +19,7 @@ However, as noted, macOS does **not** have `/usr/include` so this would never work for macOS without some changes, described next. For macOS you will need the command line tools installed which can be done like: -``` +``` sudo xcode-select --install ``` @@ -50,7 +50,7 @@ which has been changed to be: Shortly below that you will see, as noted above, the numbers: -``` +``` if ((H = fopen (__FILE__+43, 43+__FILE__))) while ((fgets (L, (int)sizeof L, H)) != 0) { I[strcspn (I, 45+__FILE__)] = O = 0; diff --git a/1998/schweikh2/README.md b/1998/schweikh2/README.md index 5ad2fa7a1..45621ff3a 100644 --- a/1998/schweikh2/README.md +++ b/1998/schweikh2/README.md @@ -1,26 +1,26 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./yarng ``` or -``` +``` ./yarng integer_number ``` ## Try: -``` +``` ./try.sh ./yarng @@ -42,13 +42,13 @@ At the time of judging, some non-gcc compilers that were not fully ANSI standard did not compile this entry correctly. Also at that time, some gcc and egcs implementations ran into a problem when building the entry. Doing: -``` +``` make schweikh2 ``` often produced an error of the form: -``` +``` gcc -ansi schweikh2.alt.c -o schweikh2.alt as: Error: cca00NzV.s, line 58: Missing " at end of string " @@ -58,20 +58,20 @@ often produced an error of the form: because the line: -``` +``` #line 10 ONE(O(1,1,2,6,0,6)) ``` turned into the line: -``` +``` # 9 "01\012" ``` (note, though, how that line is on line 11) which caused gcc to give to the assembler the following two lines: -``` +``` .stabs "schweikh2.c ",132,0,0,Ltext1 ``` @@ -80,7 +80,7 @@ and the lone `"` after the `#.file` line resulted in an assembly syntax error. In some cases one had to compile using `gcc -g`: -``` +``` make schweikh2 CFLAGS=-g ``` @@ -105,7 +105,7 @@ still can :-) ). Because of this bug, the code was changed to be instead: -``` +``` #line 10 "01\015" ``` @@ -122,13 +122,13 @@ compiler error: so the line: -``` +``` #line 10 "01\015" ``` was changed to: -``` +``` #line 10 ONE(O(1,1,2,6,0,6)) ``` @@ -158,7 +158,7 @@ different values? How long would you need for an empirical test? For example: -``` +``` $ ./yarng 32 10111001010101110110010101001111 $ ./yarng 5 diff --git a/1998/schweikh3/README.md b/1998/schweikh3/README.md index 704acf525..1572aca3b 100644 --- a/1998/schweikh3/README.md +++ b/1998/schweikh3/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -23,7 +23,7 @@ If `dir` is the directory (or a directory tree) where you keep all your favorite pictures off the Internet or from `alt.binaries.pictures.*`, do -``` +``` find dir -type f -print | ./samefile ``` @@ -34,7 +34,7 @@ Maybe you will not need to buy another 10 GB disk to store them. :-) If you're in this winning entry's directory: -``` +``` ./try.sh ``` @@ -53,7 +53,7 @@ which if (in the code) is unset will be set to the default, 32767. If you wish to change the size to say, 55555: -``` +``` make clobber SIZE=55555 alt ``` @@ -83,7 +83,7 @@ Thank God the IEEE does not standardize a coding style... This is best explained in the man page. The troff source for this man page can be found in the file [samefile.1](samefile.1). To render try: -``` +``` `man ./samefile.1 ``` @@ -100,7 +100,7 @@ Otherwise: #### SYNOPSIS -``` +``` ./samefile ``` @@ -141,7 +141,7 @@ inode numbers is also minimized. Suppose you have six identical files of size 100 in an inode group consisting of the three inodes with numbers 10, 20 and 30: -``` +``` $ ls -i # output edited for readability: 10 file1 20 file4 30 file6 10 file2 20 file5 @@ -177,7 +177,7 @@ For everybody: What are the duplicates under my home directory? -``` +``` find $HOME | ./samefile ``` @@ -185,14 +185,14 @@ For the sysadmin folks: Report all duplicate files under /usr larger than 16k: -``` +``` find /usr -size +16384c -a -type f | ./samefile ``` For the ftp and WWW admins: How much space is wasted below our site's /pub directory? -``` +``` find /pub -type f | samefile | awk '{sum += $1} END {print sum}' ``` diff --git a/1998/tomtorfs/README.md b/1998/tomtorfs/README.md index ef9919984..cc579b02c 100644 --- a/1998/tomtorfs/README.md +++ b/1998/tomtorfs/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make all ``` ## To use: -``` +``` ./tomtorfs filename bitwidth polynom reflected init xor ``` @@ -25,7 +25,7 @@ where: ## Try: -``` +``` ./try.sh ``` @@ -56,7 +56,7 @@ archiver that uses the CRC-32 algorithm. #### CRC-16: -``` +``` ./tomtorfs filename 16 1021 0 FFFF 0000 ``` @@ -64,21 +64,21 @@ archiver that uses the CRC-32 algorithm. #### CRC-32: -``` +``` ./tomtorfs filename 32 04C11DB7 1 FFFFFFFF FFFFFFFF ``` #### XMODEM: -``` +``` ./tomtorfs filename 16 8408 1 0000 0000 ``` #### ARC: -``` +``` ./tomtorfs filename 16 8005 1 0000 0000 ``` diff --git a/2000/anderson/README.md b/2000/anderson/README.md index 1493b58a8..73cf727d6 100644 --- a/2000/anderson/README.md +++ b/2000/anderson/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` echo something | ./anderson ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2000/bellard/README.md b/2000/bellard/README.md index 1b04c374f..a84a59c06 100644 --- a/2000/bellard/README.md +++ b/2000/bellard/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./bellard ``` diff --git a/2000/bmeyer/README.md b/2000/bmeyer/README.md index 5f8abc3ff..91c524c87 100644 --- a/2000/bmeyer/README.md +++ b/2000/bmeyer/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./bmeyer ``` @@ -16,7 +16,7 @@ In a video window (white text on black background): -``` +``` ./try.sh ``` @@ -31,7 +31,7 @@ dashed argument) for compression and decompression! You've been warned. The author recommended on linux/x86, glibc 2.0, libc4/5: -``` +``` bmeyer: bmeyer.c CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm ``` @@ -40,7 +40,7 @@ However many compilers use `-O3` as the maximum level for `-O` optimization. And on linux/x86, glibc 2.1: -``` +``` bmeyer: bmeyer.c gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm ``` @@ -80,13 +80,13 @@ on stdin, and it will decompress it to stdout --- as either raw or ASCII .PGM, depending on what format it was compressed from. For example: -``` +``` ./glicbawls < michael.pgm > michael.glic ``` and then -``` +``` ./glicbawls < michael.glic > michael.decoded.pgm ``` @@ -104,7 +104,7 @@ If you still have trouble, simply use a terminal or xterm with more than 80 columns, and tell `glicbawls` about it by giving the number of columns as an argument. For example -``` +``` ./glicbawls 260 lavabus.glic ``` @@ -122,21 +122,21 @@ decoded as 35, 36, 37, 38 or 39. In order to use this mode, simply give the maximum allowed error as an argument, with a dash (`-`) before it. For example: -``` +``` ./glicbawls -2 < graph.pgm > graph.2.glic ``` will compress in a way that allows decompression with a maximum error of two. You can combine both types of arguments, i.e.: -``` +``` ./glicbawls -3 180 < graph.pgm >graph.3.glic ``` will compress with a maximum error of 3, using a 180 column terminal for the progress display, and: -``` +``` ./glicbawls -3 180 < graph.3.glic > graph.3maxerr.pgm ``` diff --git a/2000/briddlebane/README.md b/2000/briddlebane/README.md index f2623c3cc..04b4a232b 100644 --- a/2000/briddlebane/README.md +++ b/2000/briddlebane/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./briddlebane ``` @@ -19,7 +19,7 @@ equivalent file! You might also like to try: -``` +``` ./try.sh INSULTS=15 ./try.sh diff --git a/2000/dhyang/README.md b/2000/dhyang/README.md index 045fd18ab..25e2ced2e 100644 --- a/2000/dhyang/README.md +++ b/2000/dhyang/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./dhyang ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2000/dlowe/README.md b/2000/dlowe/README.md index 47698db36..ff28c08f7 100644 --- a/2000/dlowe/README.md +++ b/2000/dlowe/README.md @@ -1,12 +1,12 @@ ## To build: -``` +``` make ``` The following bit of perl may help determine the values you need: -``` +``` perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' ``` @@ -27,14 +27,14 @@ For more detailed information see [2000 dlowe bugs](../../bugs.html#2000_dlowe). ## To use: -``` +``` ./dlowe [file ...] ``` ## Try: -``` +``` ./try.sh ``` @@ -126,7 +126,7 @@ or EOF is encountered. ### Examples: -``` +``` $ echo '12 13 14 15 16 + + + + f' | ./dlowe 70 $ echo '12 13 14 15 16 17 + - * / p' | ./dlowe diff --git a/2000/jarijyrki/README.md b/2000/jarijyrki/README.md index 70205406a..f111e3024 100644 --- a/2000/jarijyrki/README.md +++ b/2000/jarijyrki/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -9,7 +9,7 @@ You will need X11 header files and libraries installed to build this program. ## To use: -``` +``` ./jarijyrki < infile.info > outfile.info ``` @@ -18,7 +18,7 @@ You will need a system capable of displaying the results of X Window programs. ## Try: -``` +``` ./jarijyrki < finance.sheet > myedits.info ``` @@ -88,7 +88,7 @@ supports are: ##### Starting -``` +``` ./jarijyrki < finance.sheet > myedits.info ``` @@ -144,7 +144,7 @@ To start the spreadsheet program with an existing spreadsheet, for instance [finance.sheet](finance.sheet), use the following command line: -``` +``` ./jarijyrki < finance.sheet ``` @@ -156,7 +156,7 @@ supported by the program. To start the program with an empty sheet, use -``` +``` ./jarijyrki < /dev/null ``` @@ -171,7 +171,7 @@ output. Hence, when the spreadsheet window has come up, you've made your changes, and you press the ESC key the program finishes. To save the results in a file, the following typical command line would be used: -``` +``` ./jarijyrki < finance.sheet > myedits.info ``` diff --git a/2000/natori/README.md b/2000/natori/README.md index db50dd5e8..73d933ed0 100644 --- a/2000/natori/README.md +++ b/2000/natori/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,14 +11,14 @@ version](#alternate-code) below. ## To use: -``` +``` ./natori ``` ## Try: -``` +``` ./try.sh ``` @@ -42,14 +42,14 @@ The author noted that those in the southern hemisphere might want to change To run the alternate code that supports the southern hemisphere: -``` +``` make alt ``` ### Alternate use: -``` +``` ./natori.alt ``` @@ -65,7 +65,7 @@ versions? Or are there any? ### Alternate try: -``` +``` ./try.alt.sh ``` diff --git a/2000/primenum/README.md b/2000/primenum/README.md index 705d1c9d0..98fbfa4d4 100644 --- a/2000/primenum/README.md +++ b/2000/primenum/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2000 primenum bugs](../../bugs.html#2000_prim ## To use: -``` +``` echo n | ./primenum n ``` @@ -27,7 +27,7 @@ NOTE: `n` is an integer. ## Try: -``` +``` ./try.sh ``` @@ -64,7 +64,7 @@ Instead, the program reads input from `stdin` and returns garbled text on `stdout`. Fortunately, you can recover the original message simply by running the program a second time. Try: -``` +``` ./primenum n < textfile | ./primenum n > textfile2 diff textfile textfile2 ``` diff --git a/2000/rince/README.md b/2000/rince/README.md index 5275e9ca7..935575c1d 100644 --- a/2000/rince/README.md +++ b/2000/rince/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [2000 rince bugs](../../bugs.html#2000_rince). ## To use: -``` +``` ./rince number number2 ``` @@ -28,7 +28,7 @@ different. ## Try: -``` +``` ./try.sh ``` @@ -51,7 +51,7 @@ observation. The simplest way to run it is with no arguments. Just type: -``` +``` ./rince ``` @@ -65,7 +65,7 @@ has a built in time machine. Indeed the program knows the speed of light, which is used to ensure that we see the "live" pictures. Simply specify the fraction of a day to skip forward for each screen refresh. I suggest: -``` +``` ./rince 0.01 ``` @@ -73,7 +73,7 @@ To display the output (still guessing?) for a given date, specify two arguments. The first argument is as before and the second argument is a Julian day number (given as a fractional component). E.g.: -``` +``` ./rince 0 2441193.6 ./rince 0.01 2441193.6 ``` @@ -170,7 +170,7 @@ states the following: Thus we can plot Galileo's discoveries using the following three plots: -``` +``` ./rince 0 $(./dmy2jd 7.8 1 1610) ./rince 0 $(./dmy2jd 8.8 1 1610) ./rince 0 $(./dmy2jd 10.8 1 1610) @@ -180,7 +180,7 @@ However we can go one better by seeing what Galileo would have seen if it wasn't cloudy on the 9th. Try: -``` +``` ./rince 0 $(./dmy2jd 9.85 1 1610) ``` diff --git a/2000/robison/README.md b/2000/robison/README.md index 373a5a921..2e14abf9a 100644 --- a/2000/robison/README.md +++ b/2000/robison/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./robison ``` diff --git a/2000/schneiderwent/README.md b/2000/schneiderwent/README.md index aafa0d595..d1519ed0e 100644 --- a/2000/schneiderwent/README.md +++ b/2000/schneiderwent/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./schneiderwent ``` ## Try: -``` +``` ./schneiderwent schneiderwent.data ./schneiderwent ``` @@ -24,7 +24,7 @@ What's the difference? If you have a long while to spare (and you're bored enough that you could watch paint dry :-) ) you might also try: -``` +``` ./try.sh ``` @@ -33,7 +33,7 @@ you wish to make it run faster, you can override how long it sleeps per iterations and how many iterations it runs. For instance to make it sleep only 30 seconds and run only twice: -``` +``` SLEEP=30 ITERATIONS=2 ./try.sh ``` diff --git a/2000/thadgavin/README.md b/2000/thadgavin/README.md index aebc74a41..40246ecc0 100644 --- a/2000/thadgavin/README.md +++ b/2000/thadgavin/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make alt ``` @@ -16,7 +16,7 @@ looked like back in 2000 (with a configurable speed). See the ## To use: -``` +``` ./thadgavin.alt ``` @@ -27,7 +27,7 @@ You can press 'q' at any time to exit. If you have SDL1 installed: -``` +``` ./thadgavin_sdl ``` @@ -43,13 +43,13 @@ microseconds) for the SDL version. To change the SDL one to something like `15000` you can do: -``` +``` make SDL_SLEEP=15000 clobber alt ``` and to change the curses one to `40`: -``` +``` make SLEEP=40 clobber alt ``` @@ -75,14 +75,14 @@ is not a problem there. ### Original build: -``` +``` make all ``` ### Original use: -``` +``` ./thadgavin ``` @@ -91,7 +91,7 @@ is not a problem there. If you have SDL1 installed: -``` +``` ./thadgavin_sdl ``` @@ -110,14 +110,14 @@ less than dazzling. We could not test this entry in DOS mode. Compile using DJGPP as follows: -``` +``` gcc thadgavin.c -o thadgavin.exe -Wall -lm -O6 -mpentium -fomit-frame-pointer -ffast-math ``` ### To use under Windows, X-Windows or macOS using the Simple DirectMedia Layer: -``` +``` gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lSDL -DSDL -lm ``` @@ -125,7 +125,7 @@ Compile using DJGPP as follows: ### To use curses: -``` +``` gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lncurses -lm ``` diff --git a/2000/tomx/README.md b/2000/tomx/README.md index 461b3d98f..d618e40f1 100644 --- a/2000/tomx/README.md +++ b/2000/tomx/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ There is an alternate version that compiles [mkentry.c](mkentry.c). See ## To use: -``` +``` ./tomx ``` ## Try: -``` +``` ./try.sh ``` @@ -32,14 +32,14 @@ using it as a Makefile and running the code ends up running `mkentry`. ### Alternate build: -``` +``` make alt ``` ### Alternate try: -``` +``` ./try.alt.sh ``` diff --git a/2001/anonymous/README.md b/2001/anonymous/README.md index 39e8c1684..6038d5ed4 100644 --- a/2001/anonymous/README.md +++ b/2001/anonymous/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -27,14 +27,14 @@ For more detailed information see [2001 anonymous bugs](../../bugs.html#2001_ano ## To use: -``` +``` ./anonymous x86_program ``` ## Try: -``` +``` ./try.sh ./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary @@ -64,14 +64,14 @@ that :-( ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./anonymous.ten.alt ./anonymous.bed.alt diff --git a/2001/bellard/README.md b/2001/bellard/README.md index 0256da76e..29db718e3 100644 --- a/2001/bellard/README.md +++ b/2001/bellard/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -19,14 +19,14 @@ For more detailed information see [2001 bellard bugs](../../bugs.html#2001_bella ## To use: -``` +``` ./bellard file ``` ## Try: -``` +``` ./bellard bellard.otccex.c ``` @@ -47,7 +47,7 @@ program. You can use it by typing: -``` +``` ./bellard bellard.c [args]... ``` @@ -61,19 +61,19 @@ or by giving the C source to its standard input. - Sample compilation and execution: -``` +``` ./bellard bellard.otccex.c 10 ``` - Self compilation: -``` +``` ./bellard bellard.c bellard.otccex.c 10 ``` - Self compilation iterated... -``` +``` ./bellard bellard.c bellard.c bellard.otccex.c 10 ``` diff --git a/2001/cheong/README.md b/2001/cheong/README.md index d81e339c0..5990bdcea 100644 --- a/2001/cheong/README.md +++ b/2001/cheong/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./cheong digits ``` ## Try: -``` +``` ./try.sh ``` @@ -36,7 +36,7 @@ Compile normally and run with one argument, an integer with 2n digits. Program will return the integer part of its square root (n-digits). For example, -``` +``` $ cc -o cheong cheong.c $ ./cheong 1234567890 35136 @@ -52,7 +52,7 @@ This program runs normally on any ANSI C compiler and is ASCII dependent. Strict compiling gives just one unavoidable warning: -``` +``` gcc -ansi -Wall cheong.c cheong.c:3: warning: third argument of `main' should probably be `char **' ``` diff --git a/2001/coupard/README.md b/2001/coupard/README.md index 35c98e56a..d953854ba 100644 --- a/2001/coupard/README.md +++ b/2001/coupard/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./coupard ``` ## Try: -``` +``` ./try.sh ``` @@ -52,7 +52,7 @@ that can do sound, as a lowest-denominator sound I/O interface. To listen to what the program says directly, invoke -``` +``` ./coupard > /dev/audio ``` @@ -68,7 +68,7 @@ If you want to convert the audio output of the program into another audio format, you can pipe it to [SoX](https://en.wikipedia.org/wiki/SoX) for example (`sox` is the Swiss army knife of Unix audio tools). The command: -``` +``` ./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wav ``` diff --git a/2001/ctk/README.md b/2001/ctk/README.md index 1d5eaa29b..b068447ee 100644 --- a/2001/ctk/README.md +++ b/2001/ctk/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ code](#alternate code) below. ## To use: -``` +``` ./ctk ``` @@ -23,14 +23,14 @@ This alternate version adds to the movement keys `l` for right, `h` for left and ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./ctk.alt ``` diff --git a/2001/dgbeards/README.md b/2001/dgbeards/README.md index 857a8bf33..1744586d0 100644 --- a/2001/dgbeards/README.md +++ b/2001/dgbeards/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,7 +21,7 @@ For more detailed information see [2001 dgbeards bugs](../../bugs.html#2001_dgbe ## To use: -``` +``` ./dgbeards ``` @@ -36,14 +36,14 @@ this you can look at the author's remarks and make the change. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` ./dgbeards.alt ``` diff --git a/2001/herrmann1/README.md b/2001/herrmann1/README.md index 62142ebf1..9c0e4e124 100644 --- a/2001/herrmann1/README.md +++ b/2001/herrmann1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -19,7 +19,7 @@ For more detailed information see [2001 herrmann1 bugs](../../bugs.html#2001_her ## To use: -``` +``` ./herrmann1.sh 'prg=file' ``` @@ -30,7 +30,7 @@ need an older compiler perhaps gcc 2.95. ## Try: -``` +``` ./try.sh ``` @@ -86,7 +86,7 @@ terminal! The info files `herrmann1.turing` and [herrmann1.gcd](herrmann1.gcd) are sample programs for the Turing machine. For example, type -``` +``` ./herrmann1.sh 'prg=herrmann1.times2' ``` @@ -126,7 +126,7 @@ In the previous example, the Turing machine started on the default tape of the program `times2.turing`. To provide your own tape, type (for example) -``` +``` ./herrmann1 prg=times2.turing tape="O O O I I I O O O" ``` @@ -155,7 +155,7 @@ number in unary representation. (That is, a row of I's is expected, and one more I is appended to the row.) Let's call it `plus1.turing`. Here's what it could look like: -``` +``` /* Search beginning of number. */ #define start_O O, right, start /* Number found. Move one step to the left. */ @@ -177,7 +177,7 @@ line defining `st2_I` has been left out.) Now, the program can be used with -``` +``` ./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"' ``` @@ -187,7 +187,7 @@ machine would start on an empty tape (that is, a tape filled with the case for `plus1.turing`). So you might want to provide a default tape by adding a line like -``` +``` #define tape O O O O O I I I I ``` @@ -200,13 +200,13 @@ When writing long programs, the most common errors are to forget to define a state or to misspell one. Let's assume you forgot the line -``` +``` #define start_I I, left, st2 ``` Remove it and type -``` +``` ./herrmann1 'prg=plus1.turing' ``` diff --git a/2001/herrmann2/README.md b/2001/herrmann2/README.md index 9c6c63b1d..7c2e85378 100644 --- a/2001/herrmann2/README.md +++ b/2001/herrmann2/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./herrmann2 ``` ## Try: -``` +``` ./try.sh ``` @@ -75,7 +75,7 @@ to about 9k. 3D picture, constructed of random characters (with ASCII code between 32 and 126). For example, type -``` +``` ./herrmann2 < herrmann2.ioccc ``` @@ -86,7 +86,7 @@ new random character, it will take the next one from the argument. When it arrives at the end of the argument, it will start over at the beginning. Example: -``` +``` ./herrmann2 "234 84 045 5 6765 7487 65190 84 656 254 12 43931 818 0 6542 \ 341 45 567 76967 7244 606 976567 895 81898 095 68678 1843 4650547 \ 565980691 389 04974" < herrmann2.ioccc @@ -122,7 +122,7 @@ get it (if you lost it or if you don't have it already) is to use the program itself on the right picture and with the right argument: -``` +``` ./herrmann2 \ 'char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;'\ ' ;l ;i(V)man,n {-!har ; =Aadre(0,&e,o||n -- +,o4,=9,l=b=8,'\ @@ -183,7 +183,7 @@ works.) - When still in doubt about how to judge this program, type -``` +``` ./herrmann2 < herrmann2.cup ``` diff --git a/2001/jason/README.md b/2001/jason/README.md index 5e4bb6eba..ea7b62de4 100644 --- a/2001/jason/README.md +++ b/2001/jason/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./jason ``` @@ -37,7 +37,7 @@ cause problems. Go ahead, try it! :-) TED Shroyer came up with the idea that made it possible to hide all the text. Thanks, TED. You won. :) -``` +``` cc -o jason jason.c ./jason you are in a maze of twisty little passages diff --git a/2001/kev/README.md b/2001/kev/README.md index d45a0f4ce..1294a6014 100644 --- a/2001/kev/README.md +++ b/2001/kev/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,7 +21,7 @@ For more detailed information see [2001 kev bugs](../../bugs.html#2001_kev). ## To use: -``` +``` ./kev # in one terminal ./kev hostname # in another terminal @@ -32,7 +32,7 @@ NOTE: each player's paddle is at the bottom and the opponent at the top. ## Try: -``` +``` ./kev # in one terminal ./kev localhost # in another terminal on the same host @@ -41,13 +41,13 @@ NOTE: each player's paddle is at the bottom and the opponent at the top. If you need to change the speed you can reconfigure it like (say for over a network and not the same host): -``` +``` make clobber SPEED=50 all # original default value which is very fast ``` If you wish to change the port you can do so like: -``` +``` make clobber PORT=3773 all ``` @@ -58,19 +58,19 @@ syscall with the `l_` macro, changing the `L` variable like one would `PORT`. Of course you can do more than one at the same time. For instance to change the speed and port: -``` +``` make clobber SPEED=512 PORT=3773 all ``` If you have `xterm` try on one system: -``` +``` xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev & ``` and then the other, the client system: -``` +``` xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost& ``` @@ -85,7 +85,7 @@ awkward `,` and `.` keys to move your paddle. ### Alternate build: -``` +``` make alt ``` @@ -105,13 +105,13 @@ terminal? If you have `xterm` try on one system: -``` +``` xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt & ``` and then the other, the client system: -``` +``` xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost& ``` @@ -151,14 +151,14 @@ getting the ball past your opponent's paddle. It's pretty fun! :) Run the server first without any command line arguments, i.e. -``` +``` ./kev ``` Then run the client with a single command line argument which is the name of the machine running the server, e.g. -``` +``` ./kev localhost ``` @@ -169,7 +169,7 @@ blocked by a firewall. Here's a good quick example to see it in action on your own machine, assuming you have `Xwindows`: -``` +``` xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev & xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost& ``` diff --git a/2001/ollinger/README.md b/2001/ollinger/README.md index 28bec6d77..702d3d79e 100644 --- a/2001/ollinger/README.md +++ b/2001/ollinger/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./ollinger integer ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2001/rosten/README.md b/2001/rosten/README.md index deb0a58cc..201359326 100644 --- a/2001/rosten/README.md +++ b/2001/rosten/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2001 rosten bugs](../../bugs.html#2001_rosten ## To use: -``` +``` ./rosten [number] ``` @@ -30,14 +30,14 @@ NOTE: number is floating point. ## Try: -``` +``` ./rosten 1.03 ./rosten 1.00 ``` For some abuse, try: -``` +``` ./rosten 0.99 ``` @@ -57,7 +57,7 @@ cursor) in the wrong way. :-) ### SYNOPSIS -``` +``` ./rosten [greasiness] ``` @@ -94,7 +94,7 @@ portable, but compile with almost no warnings on most of the compilers tested. It's a kind of shame that none of the compilers do anything like this: -``` +``` $ make greasymouse cc greasymouse.c -o greasymouse -lX11 greasymouse.c:30: This macro should have more text and spaces in it @@ -142,7 +142,7 @@ the way it's used to. The MIPS compiler suggests an `==` instead of an `=` in expressions such as: -``` +``` &&(a=b) ``` diff --git a/2001/schweikh/README.md b/2001/schweikh/README.md index c0b7a466b..c3e112c6d 100644 --- a/2001/schweikh/README.md +++ b/2001/schweikh/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2001 schweikh bugs](../../bugs.html#2001_schw ## To use: -``` +``` ./schweikh string string2 ``` @@ -40,7 +40,7 @@ This is supposed to happen. As is written in the ## Try: -``` +``` ./try.sh ``` @@ -64,7 +64,7 @@ pattern if you are looking for something in the middle. You can use it for your shell scripting needs similar to a silent grep (and without `stdout` redirected to `/dev/null`): -``` +``` if prog "${VARIABLE}" ''; then echo VARIABLE matches else diff --git a/2001/westley/README.md b/2001/westley/README.md index 90e05afe9..820b9600f 100644 --- a/2001/westley/README.md +++ b/2001/westley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -25,7 +25,7 @@ For more detailed information see [2001 westley bugs](../../bugs.html#2001_westl ## To use: -``` +``` ./westley 2>/dev/null # enter some input, terminate with EOF @@ -37,7 +37,7 @@ For more detailed information see [2001 westley bugs](../../bugs.html#2001_westl ## Try: -``` +``` ./try.sh ``` @@ -60,7 +60,7 @@ everyone in the face! :-) This is also compiled by default. ### Punch card try: -``` +``` echo 'Brian Westley does it again!' | ./westley.punch 2>/dev/null ``` @@ -73,7 +73,7 @@ This alternate code might be less portable. ### Alternate build: -``` +``` make alt ``` @@ -108,7 +108,7 @@ to punch cards - C programs can be written to be "drop proof". Consider the following C program: -``` +``` main(){a();b();c();} a(){printf("A");} b(){printf("B");} @@ -122,7 +122,7 @@ any particular order\*\*; it will always produce `ABC` as output. You can also use global variables: -``` +``` char *greet = "Hello, world!"; char *greet; main(){puts(greet);} ``` @@ -132,7 +132,7 @@ It would be trivial to write an entire C program that is possible to write a program that will always compile but behave differently depending on the line order: -``` +``` test(a,b){return a;} #define test(a,b) test(b,a) main(){if (test(0,1)) printf("T"); else printf("F");} @@ -144,7 +144,7 @@ falls between the declaration of `test()` and its use in you can use the same call to `test()` repeatedly in different lines to return different values: -``` +``` #define test(x,y) test(y,x) main(){int i=0;a(&i);b(&i);c(&i);d(&i);printf("%d\n",i);} a(i)int*i;{if (test(0,1)) *i += 1;} diff --git a/2001/williams/README.md b/2001/williams/README.md index e1e46d7ff..b91b43951 100644 --- a/2001/williams/README.md +++ b/2001/williams/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2001 williams bugs](../../bugs.html#2001_will ## To use: -``` +``` ./williams ``` diff --git a/2004/anonymous/README.md b/2004/anonymous/README.md index 129e7d637..3b4321339 100644 --- a/2004/anonymous/README.md +++ b/2004/anonymous/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./anonymous 'foo' > bar.pgm ``` @@ -21,7 +21,7 @@ images. ## Try: -``` +``` ./try.sh ``` @@ -107,7 +107,7 @@ The following command thus writes a rendering of the [Ring inscription](https://www.glyphweb.com/arda/r/ringinscription.html) to the file `ring.pgm`: -``` +``` ./anonymous "ash nazg durhbatuluhk, ash nazg gimbatul, \ ash nazg thrakatuluhk, agh burzhumh-ishi krimpatul." >ring.pgm ``` diff --git a/2004/arachnid/README.md b/2004/arachnid/README.md index 6411587e5..2675d9580 100644 --- a/2004/arachnid/README.md +++ b/2004/arachnid/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,20 +11,20 @@ code](#alternate-code) below. ## To use: -``` +``` ./arachnid [mazefile] ``` ## Try: -``` +``` ./arachnid arachnid.txt ``` and then try: -``` +``` ./arachnid arachnid.c ``` @@ -41,7 +41,7 @@ instead. ### Alternate build: -``` +``` make alt ``` @@ -80,7 +80,7 @@ explorers out there. ### Usage -``` +``` ./arachnid [mazefile] ``` diff --git a/2004/burley/README.md b/2004/burley/README.md index 59d4a6f54..0444c4a3e 100644 --- a/2004/burley/README.md +++ b/2004/burley/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ will not work with it enabled. ## To use: -``` +``` ./burley ``` diff --git a/2004/gavare/README.md b/2004/gavare/README.md index 92ce998fb..69057c6da 100644 --- a/2004/gavare/README.md +++ b/2004/gavare/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ for more details. ## To use: -``` +``` ./gavare > ioccc_ray.ppm ``` Open `ioccc_ray.ppm` with a viewer capable of viewing PPM files. Alternatively, if you have ImageMagick installed, you can convert it to a jpeg: -``` +``` convert ioccc_ray.ppm ioccc_ray.jpg ``` @@ -28,7 +28,7 @@ and then view `ioccc_ray.jpg` in a graphics viewer, editor or web browser. If you have `xv(1)` you can do: -``` +``` ./gavare | xv - ``` @@ -53,19 +53,19 @@ on `stdout` which theoretically should work in Windows. To build the configurable and unobfuscated versions: -``` +``` make alt ``` To change the default size from 1024x768 try: -``` +``` make clobber XX=640 YY=480 alt ``` You might also wish to change the anti-alias setting: -``` +``` make clobber AA=2 alt ``` @@ -78,7 +78,7 @@ This is not possible with the author's version but it is with the alt versions As the Windows version will not compile on most viewers' systems we do not build it with `make alt`; instead try: -``` +``` make alt2 ``` diff --git a/2004/gavin/README.md b/2004/gavin/README.md index 355192b0b..4cbd9db59 100644 --- a/2004/gavin/README.md +++ b/2004/gavin/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -25,7 +25,7 @@ For more detailed information see [2004 gavin bugs](../../bugs.html#2004_gavin). ## To use: -``` +``` ./gavin ``` @@ -36,14 +36,14 @@ To enjoy the results (on a Linux/x86 machine) with a floppy drive (remember those? We do!): -``` +``` su ``` Make a floppy with an ext2 filesystem (`mke2fs /dev/fd0` replacing `fd0` with whatever the floppy device is!), mount it under `/mnt/floppy` and then: -``` +``` cp kernel fs.tar lilo.conf boot.b /mnt/floppy ``` @@ -51,26 +51,26 @@ NOTE: If the version of your lilo is not 21.4, use the appropriate boot.b file. NOTE: If your floppy drive is not `/dev/fd0`, edit lilo.conf appropriately. -``` +``` lilo -C /mnt/floppy/lilo.conf ``` Boot from the floppy on an x86 machine with a PS/2 keyboard and mouse. Move the window away from the corner. -``` +``` vi gavin.c ``` Scroll up and down the file with up-arrow and down-arrow. -``` +``` sh ``` You can have several shell windows: -``` +``` vi README.md ./prim ``` @@ -86,7 +86,7 @@ you can use it with `QEMU`. ### Alternate build: -``` +``` make alt ``` diff --git a/2004/hibachi/README.md b/2004/hibachi/README.md index d75c7b660..1760a1788 100644 --- a/2004/hibachi/README.md +++ b/2004/hibachi/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` cd build; ./hibachi-start.sh & ``` @@ -42,7 +42,7 @@ There is a `hibachi.tgz` file (NOTE: this file was removed by the judges after extraction) that unpacks several support files and a subdirectory tree containing the documentation and examples. It can be viewed by: -``` +``` tar -zxf hibachi.tgz lynx hibachi/localhost/index.html ``` @@ -58,19 +58,19 @@ To build just the executable: For Cygwin, FreeBSD, Linux (newer), Mac OS X: -``` +``` gcc -o hibachi hibachi.c ``` For Linux (older): -``` +``` gcc -DSHUT_WR=1 -o hibachi hibachi.c ``` For SunOS: -``` +``` gcc -o hibachi hibachi.c -lnsl -lsocket ``` @@ -88,20 +88,20 @@ examples. In which case the preferred build commands are: To start the server on the default port (8008): -``` +``` cd build; ./hibachi-start.sh & ``` To test the server: -``` +``` lynx http://localhost:8008/ ``` To stop the server: -``` +``` kill %1 ``` diff --git a/2004/hoyle/README.md b/2004/hoyle/README.md index 905c94ad7..70ca7e5e0 100644 --- a/2004/hoyle/README.md +++ b/2004/hoyle/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./hoyle point ... ``` ## Try: -``` +``` ./try.sh ``` @@ -47,13 +47,13 @@ passed in. For example, to graph `y = x^2`: -``` +``` ./hoyle 0 0 1 ``` Note that: -``` +``` ./hoyle 0 0 2 ``` diff --git a/2004/jdalbec/README.md b/2004/jdalbec/README.md index 97639f4e1..514184050 100644 --- a/2004/jdalbec/README.md +++ b/2004/jdalbec/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,14 +21,14 @@ For more detailed information see [2004 jdalbec bugs](../../bugs.html#2004_jdalb ## To use: -``` +``` ./jdalbec number ... ``` ## Try: -``` +``` ./try.sh ``` @@ -43,7 +43,7 @@ which line it is on. ### Alternate build: -``` +``` make alt ``` @@ -52,7 +52,7 @@ many number of lines to print on a line. Set at default to 11 protons, salt, if you wish to make it silver, 47 (a prime) protons, do: -``` +``` make clobber Ag=47 alt ``` @@ -60,7 +60,7 @@ though it might be odd to have 47 numbers on a line as it would defeat the purpose. :-) Or if you prefer some prime, golden irony: -``` +``` make clobber Ag=79 alt ``` @@ -72,7 +72,7 @@ Use `jdalbec.alt` as you would `jdalbec` above. ### Alternate try: -``` +``` ./try.alt.sh ``` diff --git a/2004/kopczynski/README.md b/2004/kopczynski/README.md index 3f45a0bc7..ffabaa7fe 100644 --- a/2004/kopczynski/README.md +++ b/2004/kopczynski/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ will not work with it enabled. ## To use: -``` +``` ./kopczynski < input_file ``` ## Try: -``` +``` ./try.sh ``` @@ -34,14 +34,14 @@ does. ### Alternate build: -``` +``` make alt ``` ### Alternate try: -``` +``` ./kopczynski.alt < kopczynski-10 echo $? ``` diff --git a/2004/newbern/README.md b/2004/newbern/README.md index 74a13a23d..77b67b7c7 100644 --- a/2004/newbern/README.md +++ b/2004/newbern/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./newbern [file.dat arg] ``` ## Try: -``` +``` ./try.sh ``` @@ -34,14 +34,14 @@ This is a configurable `banner(1)`-like program. - To convert a character glyph into a data file: -``` +``` ./newbern char < some_nicely_shaped_text >> data_file ``` - To print a string using glyphs from a data file: -``` +``` ./newbern data_file a_string ``` diff --git a/2004/omoikane/README.md b/2004/omoikane/README.md index d1234803f..24e57efac 100644 --- a/2004/omoikane/README.md +++ b/2004/omoikane/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./omoikane infile layout outfile ``` @@ -43,7 +43,7 @@ insert a human-readable checksum string in the text itself! `^_^` ### Usage -``` +``` ./omoikane ``` diff --git a/2004/schnitzi/README.md b/2004/schnitzi/README.md index 30dd06415..f10385cba 100644 --- a/2004/schnitzi/README.md +++ b/2004/schnitzi/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./schnitzi +``` ./try.sh ``` @@ -132,13 +132,13 @@ Try one of these methods to get the animation to run: 1. Redirect the output directly to vi, like this: -``` +``` ./schnitzi < input.dat | vi ``` 2. Redirect the output to a file, like this: -``` +``` ./schnitzi < input.dat > output.dat ``` diff --git a/2004/sds/README.md b/2004/sds/README.md index e26089882..bc64056fa 100644 --- a/2004/sds/README.md +++ b/2004/sds/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2004 sds bugs](../../bugs.html#2004_sds). ## To use: -``` +``` ./sds ``` ## Try: -``` +``` ./try.sh ``` @@ -63,13 +63,13 @@ decoder. Try it out. Compile the program, then type -``` +``` ./sds < sds.c ``` You should see the encoder program displayed. Now save it, like: -``` +``` ./sds < sds.c > encoder.c ``` @@ -82,14 +82,14 @@ standard input, and will output the results on the standard output. You can use it like this (assuming you have a file called remarks): -``` +``` echo 'Hello, World!' > message ./encoder message < remarks > remarks_msg ``` Then to decode: -``` +``` ./sds < remarks_msg Hello, World! ``` diff --git a/2004/vik1/README.md b/2004/vik1/README.md index 72fc61959..d0a73561a 100644 --- a/2004/vik1/README.md +++ b/2004/vik1/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./vik1 [arg] ``` ## Try: -``` +``` ./vik1 ./vik1 a @@ -82,7 +82,7 @@ Compile the source code and link X libraries if necessary. The program takes three options which have to be typed in a specific order as described below. -``` +``` Usage: ./vik1 ['a']['d'][#] a - Advanced racing in a winter landscape diff --git a/2004/vik2/README.md b/2004/vik2/README.md index 2dd20b1b1..8a760429a 100644 --- a/2004/vik2/README.md +++ b/2004/vik2/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./vik2 ``` @@ -127,7 +127,7 @@ speed up the compilation, define the `STOP` symbol to anything from `_3` to `_10`. (The default value is `_10` which will make the compilation take some time.) Prime numbers up to `2^STOP` will be calculated. -``` +``` cpp '-DSTOP=_5' '-DFNAME="tmp1.c"' prog.c tmp1.c ``` @@ -135,20 +135,20 @@ Then use `cpp` or any other [pre-processor](https://en.wikipedia.org/wiki/C_preprocessor) to do the actual work. This will take some time.... -``` +``` cpp tmp1.c > tmp2.c ``` Finally compile the pre-processed file -``` +``` cc -O tmp2.c -o prog ``` Then run the program to reveal all prime numbers up to 32 (if you used `STOP=_5` as above): -``` +``` ./vik2 ``` diff --git a/2005/aidan/README.md b/2005/aidan/README.md index c3af9d722..58bcc7097 100644 --- a/2005/aidan/README.md +++ b/2005/aidan/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ code](#alternate-code). ## To use: -``` +``` ./aidan < puzzle ./aidan seed @@ -21,7 +21,7 @@ where `seed` is a number. ## Try: -``` +``` ./try.sh ``` @@ -34,7 +34,7 @@ which is slower, inelegant and not as obscure, as the author put it. ### Alternate build: -``` +``` make alt ``` @@ -46,7 +46,7 @@ Use `aidan.alt` as you would `aidan` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -139,7 +139,7 @@ Telegraph](https://www.telegraph.co.uk/), a UK newspaper. Now, with modern computers this **can** be solved using brute force, e.g.: -``` +``` #include /* sudoku-bfi.c */ #define S(t) for(n=0;n<9;v[n++]=0);for(n=0;n<81;n++)if(i[n]){z=1< +``` cc -o sudoku-sf sudoku-sf.c ``` or, if using gcc, try: -``` +``` gcc -O2 -Wall -Wextra -ansi -pedantic-errors -o sudoku-sf sudoku-sf.c ``` #### Testing (optional) -``` +``` perl ./test-su.perl ``` @@ -211,7 +211,7 @@ really. #### Solving -``` +``` ./aidan < somefile.txt ``` @@ -232,7 +232,7 @@ though slightly slower. See if you can figure out what it does.) #### Generating -``` +``` ./sudoku ``` @@ -292,7 +292,7 @@ least 32. (No, that isn't a typo - I did say 15, not 16). Also requires that `cpp` can properly handle something like: -``` +``` #define foo(x,y) x y foo(bar,) ``` diff --git a/2005/anon/README.md b/2005/anon/README.md index 674bb5e0a..1868bac0f 100644 --- a/2005/anon/README.md +++ b/2005/anon/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -8,7 +8,7 @@ NOTE: there is an alternate version for vi(m) like movements. See [alternate version](#alternate-code) below. If your terminal has problems with the `stty(1)` commands try: -``` +``` make anon-no_stty ``` @@ -28,14 +28,14 @@ For more detailed information see [2005 anon bugs](../../bugs.html#2005_anon). ## To use: -``` +``` ./anon x y [z] ``` ## Try: -``` +``` ./anon 4 4 ./anon 3 3 3 @@ -48,13 +48,13 @@ hook you) and spending too much time playing. :-) If you want to see this in action you can easily do this: -``` +``` yes 'please crash on me :-)' | ./anon 4 4 ``` What happens if you specify a larger board? For instance: -``` +``` yes 'please crash on me :-)' | ./anon 10 10 10 ``` @@ -70,13 +70,13 @@ The alternate version uses `vi(m)` like movement keys. ### Alternate build: -``` +``` make alt ``` To compile the version without `stty(1)`: -``` +``` make alt-no_stty ``` @@ -121,13 +121,13 @@ sorted in the order they appear on the screen. The program takes 2 or 3 arguments, specifying the dimensions of the board. For example, to play the original version of the Fifteen Puzzle: -``` +``` ./anon 4 4 ``` To play with a 3D board, do something like this: -``` +``` ./anon 3 3 3 ``` @@ -377,7 +377,7 @@ stored in a well-known location in the `MASS`. `if(p,q,r,s)` is, in fact, an `if` statement. :-) It is equivalent to: -``` +``` if (p) { q; r } else {s} ``` @@ -404,7 +404,7 @@ closes the current state and opens a new one behind the programmer's back. variable); `x` and `y-1` define the starting and ending values of `i`, and `z` is the loop body. `Z` is the post-loop code in the current state. For example: -``` +``` for(s,i, 0, 10, some_code , other_code) @@ -412,7 +412,7 @@ is the loop body. `Z` is the post-loop code in the current state. For example: is equivalent to: -``` +``` for (i=0; i<10; i++) { some_code; } diff --git a/2005/boutines/README.md b/2005/boutines/README.md index 3470383de..672a9ed6d 100644 --- a/2005/boutines/README.md +++ b/2005/boutines/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -15,20 +15,20 @@ require it?](../../faq.html#imagemagick). Look here to find some [SVG Viewer Implementations](https://www.w3.org/Graphics/SVG/WG/wiki/Implementations). -``` +``` ./boutines < input > output.svg ``` ## Try: -``` +``` ./try.sh ``` If `ruby` is installed [try.sh](try.sh) will generate an SVG file by: -``` +``` ruby -e '20.times{puts "#{rand} #{rand}"}' | ./boutines > test.svg ``` @@ -75,7 +75,7 @@ an [SVG](https://www.w3.org/TR/SVG11/expanded-toc.html) stream. This will possibly save a compressed SVG file and may be useful: -``` +``` ./boutines | gzip > result.svg.gz ``` diff --git a/2005/chia/README.md b/2005/chia/README.md index 7818566e7..538de6966 100644 --- a/2005/chia/README.md +++ b/2005/chia/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./chia ``` diff --git a/2005/giljade/README.md b/2005/giljade/README.md index 287ad9e97..9a583cf1d 100644 --- a/2005/giljade/README.md +++ b/2005/giljade/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,21 +21,21 @@ For more detailed information see [2005 giljade bugs](../../bugs.html#2005_gilja ## To use: -``` +``` ./giljade ``` ## Try: -``` +``` ./try.sh ``` ### Self-test feature to try: -``` +``` ./giljade > out ./giljade out ``` @@ -52,7 +52,7 @@ Control-F. If you really understand expressions, then understand this: -``` +``` s=s^(b=s&s-1^s) ``` diff --git a/2005/jetro/README.md b/2005/jetro/README.md index 377961547..9a8cd0377 100644 --- a/2005/jetro/README.md +++ b/2005/jetro/README.md @@ -6,14 +6,14 @@ haven't already. If you have SDL installed: -``` +``` make ``` ## To use: -``` +``` ./jetro ``` diff --git a/2005/klausler/README.md b/2005/klausler/README.md index 6584b6226..468aa769e 100644 --- a/2005/klausler/README.md +++ b/2005/klausler/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./klausler arg1 arg2 | head ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2005/mikeash/README.md b/2005/mikeash/README.md index 1b4f288c2..3750abd76 100644 --- a/2005/mikeash/README.md +++ b/2005/mikeash/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2005 mikeash bugs](../../bugs.html#2005_mikea ## To use: -``` +``` ./mikeash ``` @@ -28,7 +28,7 @@ under 64-bit (x86_64, arm64) machines too. ## Try: -``` +``` ./try.sh ``` @@ -67,7 +67,7 @@ functions. Try: -``` +``` echo '(format t "~s" (+ 2 2 ))' | ./mikeash ``` @@ -76,7 +76,7 @@ the lack of a newline are due to the somewhat broken implementation of the format function. More sophisticated arithmetic expressions may be used: -``` +``` echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash ``` @@ -130,7 +130,7 @@ nowhere near Basically, the [LISP][] interpreter is good for some basic math operations, and for running itself. To do the latter, try this: -``` +``` ./mikeash < mikeash.c > mikeash2.c diff mikeash.c mikeash2.c ``` diff --git a/2005/mynx/README.md b/2005/mynx/README.md index ce5b08d53..719521281 100644 --- a/2005/mynx/README.md +++ b/2005/mynx/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,7 +21,7 @@ For more detailed information see [2005 mynx bugs](../../bugs.html#2005_mynx). ## To use: -``` +``` ./mynx http:// ``` @@ -31,7 +31,7 @@ the issue of https. ## Try: -``` +``` ./mynx http://www.textfiles.com ./mynx manual.html @@ -58,7 +58,7 @@ must just appreciate the entry for what it once was. ### Alternate build: -``` +``` make alt ``` @@ -68,7 +68,7 @@ must just appreciate the entry for what it once was. Use `mynx.alt` as you would `mynx`. You'd have to specify a port at the end of the URL like: -``` +``` ./mynx.alt https://www.ioccc.org:443 ``` @@ -92,13 +92,13 @@ it inspired me to try my hand at writing the client side complement. A typical build command would be: -``` +``` cc -o mynx mynx.c ``` While some others like to be a little different: -``` +``` cc -o mynx mynx.c -lnsl -lsocket ``` @@ -107,13 +107,13 @@ example, which is kinda of useful when you consider how many OSes put all the network functions in a variety of places. So a simpler build command sequence would be: -``` +``` cd source ; ./configure ; make ``` After which, the rest of the documentation can be read by saying: -``` +``` ./mynx ../manual.html ``` diff --git a/2005/persano/README.md b/2005/persano/README.md index 19afec49c..83b482e74 100644 --- a/2005/persano/README.md +++ b/2005/persano/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ setting binary mode on `stdout`. See [alternate code](#alternate-code) below. ## To use: -``` +``` ./persano p q [num frames] ``` ## Try: -``` +``` ./try.sh ``` @@ -49,7 +49,7 @@ Use `persano.alt` as you would `persano` above. ### Alternate try: -``` +``` ./persano.alt 3 16 > knot3-16.gif ``` @@ -80,7 +80,7 @@ knots](https://en.wikipedia.org/wiki/Torus_knot) to standard output. ### SYNOPSIS -``` +``` ./persano p q [num frames] ``` @@ -98,14 +98,14 @@ cutting it [^1], until it ends up looking just like a circle embedded in R3 [^2] Sample usage: -``` +``` ./persano 3 2 1 > foo.gif ``` writes a non-animated GIF (a single frame) stream of a rendered trefoil knot to the file `foo.gif`. -``` +``` ./persano 5 2 ``` diff --git a/2005/sykes/README.md b/2005/sykes/README.md index 771e47a32..e40d55d05 100644 --- a/2005/sykes/README.md +++ b/2005/sykes/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2005 sykes bugs](../../bugs.html#2005_sykes). ## To use: -``` +``` ./sykes binary_file ``` ## Try: -``` +``` ./try.sh ``` @@ -44,7 +44,7 @@ We downloaded the [ROM](https://en.wikipedia.org/wiki/ROM_image) contents to use the [emulator](https://en.wikipedia.org/wiki/Emulator) in [PET](https://en.wikipedia.org/wiki/Commodore_PET) mode as follows: -``` +``` wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin @@ -53,7 +53,7 @@ the [emulator](https://en.wikipedia.org/wiki/Emulator) in We then created: -``` +``` dd bs=2k count=1 if=/dev/zero of=nullfill.bin ``` @@ -79,7 +79,7 @@ Compile the program, then test the [6502](https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description) [emulation](https://en.wikipedia.org/wiki/Emulator) like this: -``` +``` ./sykes 6502test ``` @@ -105,7 +105,7 @@ Make sure you have a [terminal window](https://en.wikipedia.org/wiki/Terminal_emulator) of 40x25 chars or bigger, and then run the emulator like this: -``` +``` ./sykes pet.rom ``` @@ -119,13 +119,13 @@ You should see the startup message. Try typing in some There is an optional numeric parameter, which controls the speed. For a slower cursor blink, try -``` +``` ./sykes pet.rom 6 ``` and for faster -``` +``` ./sykes pet.rom 2 ``` @@ -191,7 +191,7 @@ Supplied as a demonstration is a compiled-for-[6502](https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description) version a chess program (heh, I found a use for a previous losing entry :) ). Try: -``` +``` ./sykes chess ``` @@ -306,7 +306,7 @@ from the Internet. This is to avoid directly infringing any copyright. What does this do? -``` +``` ./sykes pet.rom -1 ``` diff --git a/2005/timwi/README.md b/2005/timwi/README.md index 5db5c85d6..85ccb6008 100644 --- a/2005/timwi/README.md +++ b/2005/timwi/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./timwi < bf_program ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2005/toledo/README.md b/2005/toledo/README.md index e417df988..a3ae682d7 100644 --- a/2005/toledo/README.md +++ b/2005/toledo/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./toledo [a ...] ``` ## Try: -``` +``` ./toledo a ./toledo a b ``` @@ -30,7 +30,7 @@ Two alternate versions of this entry, [toledo2.c](toledo2.c) and To compile the alternate versions: -``` +``` make alt ``` @@ -63,7 +63,7 @@ This is a [chess](https://en.wikipedia.org/wiki/Chess) program, it can work in two modes: two-players, and one player (always white) against the machine. To get the first mode, run the program without arguments: -``` +``` ./toledo ``` @@ -71,14 +71,14 @@ The other mode is accessible running the program with one argument (5-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory)) analysis): -``` +``` ./toledo a ``` Two arguments for 6-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory)) analysis: -``` +``` ./toledo a b ``` diff --git a/2005/vik/README.md b/2005/vik/README.md index 60ff99348..4816def06 100644 --- a/2005/vik/README.md +++ b/2005/vik/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./vik [file.map] ``` ## Try: -``` +``` ./vik maze.map ``` @@ -60,7 +60,7 @@ Compile the source code and link in [X libraries](https://en.wikipedia.org/wiki/Xlib) if necessary. The program takes three options which have to be typed in a specific order as described below. -``` +``` ./vik [-w ] [mapfile] ``` @@ -75,20 +75,20 @@ where: Start the engine using a built in labyrinth and texture bitmaps: -``` +``` ./vik ``` Start the engine and loads the labyrinth defined in the file [maze.map](maze.map): -``` +``` ./vik maze.map ``` Start the engine using [maze.map](maze.map) in a window that is 400 pixels wide: -``` +``` ./vik -w 400 maze.map ``` diff --git a/2005/vince/README.md b/2005/vince/README.md index ead138c22..834df89d9 100644 --- a/2005/vince/README.md +++ b/2005/vince/README.md @@ -3,14 +3,14 @@ Before building, make sure that you have the OpenGL development libraries installed. -``` +``` make ``` ## To use: -``` +``` ./vince ``` @@ -31,7 +31,7 @@ also has the recursive `CPP` macro (which sneaked in accidentally) removed. To compile this alternate version: -``` +``` make alt ``` diff --git a/2006/birken/README.md b/2006/birken/README.md index b5d9f3724..700bcda38 100644 --- a/2006/birken/README.md +++ b/2006/birken/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2006 birken bugs](../../bugs.html#2006_birken ## To use: -``` +``` ./birken < file.tofu ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2006/borsanyi/README.md b/2006/borsanyi/README.md index c1c68cea7..f8e6d2cbf 100644 --- a/2006/borsanyi/README.md +++ b/2006/borsanyi/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2006 borsanyi bugs](../../bugs.html#2006_bors ## To use: -``` +``` ./borsanyi string > file.gif ``` ## Try: -``` +``` ./try.sh ``` @@ -68,7 +68,7 @@ used. A typical email address is stored in less than 1-2 kilobytes. ### Usage: -``` +``` make all ./borsanyi my@example.com > email.gif my_favourite_gif_viewer email.gif diff --git a/2006/grothe/README.md b/2006/grothe/README.md index f7ede74fc..2db4872b6 100644 --- a/2006/grothe/README.md +++ b/2006/grothe/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./grothe carrier_freq pixelclock horizontal_total < some_input.txt ``` @@ -16,7 +16,7 @@ Put on your "electronic ears" and then try: -``` +``` ./try.sh ``` @@ -50,13 +50,13 @@ parameters: If you have `xvidtune` installed you can get the `pixelclock` and `horizontal_total` with the following command -``` +``` xvidtune -show | head -n 1 | awk '{ print "pixelclock " $2 * 1000000 " horizontal_total = " $6 }' ``` Example from my laptops: -``` +``` ./grothe 65000000 10000000 1344 < twinkle.txt ``` diff --git a/2006/hamre/README.md b/2006/hamre/README.md index df2e650e3..c5f1110ce 100644 --- a/2006/hamre/README.md +++ b/2006/hamre/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./hamre math_expression_string ``` ## Try: -``` +``` ./try.sh ``` @@ -42,7 +42,7 @@ supported operators are: `+`, `-` (binary and unary), `*`, `/` and `()`. Run it by supplying an expression as the first argument, and the normalized result will be written to `stdout`. -``` +``` ./hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2' 2/3 ``` diff --git a/2006/meyer/README.md b/2006/meyer/README.md index 3e0afc604..265b4790b 100644 --- a/2006/meyer/README.md +++ b/2006/meyer/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./meyer [SEED] ``` ## Try: -``` +``` ./meyer [SEED] ``` @@ -75,7 +75,7 @@ you write is what it does'). It may be tempting to think that might do something similar as -``` +``` struct not_an_object o; ``` @@ -100,7 +100,7 @@ implementation in a popular object-oriented programming language. ### Starting the game -``` +``` ./meyer [SEED] ``` diff --git a/2006/monge/README.md b/2006/monge/README.md index a876a978d..6b3aa8e0c 100644 --- a/2006/monge/README.md +++ b/2006/monge/README.md @@ -2,7 +2,7 @@ Make sure you have the SDL1 (not SDL2!) development environment installed. -``` +``` make ``` @@ -24,7 +24,7 @@ For more detailed information see [2006 monge bugs](../../bugs.html#2006_monge). ## To use: -``` +``` ./monge expression ... ``` @@ -33,7 +33,7 @@ Incorrect formulas will ungracefully crash the program. ## Try: -``` +``` ./try.sh ``` @@ -49,7 +49,7 @@ as the number of iterations to perform. To use the default values, the same as [monge.c](monge.c), just do: -``` +``` make alt ``` @@ -58,13 +58,13 @@ of the variables `W`, `H` and `I`. The defaults are (respectively) 400, 300 and \128. If you wish to change the image size to 500x500 but keep the iterations the same then do: -``` +``` make clobber WIDTH=500 HEIGHT=500 alt ``` If you wish to keep the dimensions the same but change the iterations to 512: -``` +``` make clobber ITERATIONS=512 alt ``` @@ -82,7 +82,7 @@ Use `monge.alt` exactly as you would `monge` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -109,13 +109,13 @@ effort to work on both `i386` and `x86_64`. Portable it is! :) 0. Compile using the Makefile, or just run: -``` +``` gcc monge.c -o monge -O3 `sdl-config --libs --cflags` ``` 1. Run: -``` +``` ./monge "z = 0" "z = z*z + c; Abs2(z) < 4" ``` @@ -171,49 +171,49 @@ Here are a few examples of fractals you can draw: - Mandelbrot: -``` +``` ./monge "z=1" "z=z*z+c; Abs2(z)<4" ``` - Mandelbrot (return time variation): -``` +``` ./monge "z=c" "z=z*z+c; Abs2(z-c)>0.0001" ``` - Julia, for `c=0.31+i*0.5`: -``` +``` ./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z)<4" ``` - Julia (return time variation), `for c=0.31+i*0.5`: -``` +``` ./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z-c)>0.0001" ``` - Newton, for `x^3-1`: -``` +``` ./monge "z=c" "p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) > 0.001" ``` - Newton-Mandelbrot: -``` +``` ./monge "z=0" "p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) > 0.001" ``` - Phoenix, Mandelbrot version: -``` +``` ./monge "z=0; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4" ``` - Phoenix, Julia version for `c=0.56667-i*0.5`: -``` +``` ./monge "z=c; c=0.56667-i*0.5; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4" ``` diff --git a/2006/night/README.md b/2006/night/README.md index 30866c181..2517ec18d 100644 --- a/2006/night/README.md +++ b/2006/night/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ code](#alternate-code) section below. ## To use: -``` +``` ./night ``` @@ -23,7 +23,7 @@ keys. ### Alternate build: -``` +``` make alt ``` @@ -129,7 +129,7 @@ to deobfuscate. Keypad support was removed to save space. To restore, modify the following two macros to: -``` +``` #define ATG srand(time(0)); initscr(); cbreak(); noecho(); start_color(); keypad(stdscr,1); #define AGG A&2?KEY_UP:KEY_DOWN:A&1?KEY_RIGHT:KEY_LEFT ``` diff --git a/2006/sloane/README.md b/2006/sloane/README.md index c40ac5ad5..25956ffb7 100644 --- a/2006/sloane/README.md +++ b/2006/sloane/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make alt ``` @@ -11,7 +11,7 @@ code](#original-code) below. ## To use: -``` +``` ./slone.alt ``` @@ -24,7 +24,7 @@ problematic for some people, can be configured to different speeds by way of the value used in `usleep()`. The default is `75000` but you can easily change it. To do so try: -``` +``` make clobber SLEEP=70000 clobber alt ./sloane.alt ``` @@ -32,7 +32,7 @@ it. To do so try: If you wish to make it like the original, as if the below [Original code](#original-code) was being used, you can do: -``` +``` make SLEEP=0 clobber alt ./sloane.alt ``` @@ -46,14 +46,14 @@ Should you wish to see the original you may do so with the original code, ### Original build: -``` +``` make clobber all ``` ### Original use: -``` +``` ./sloane ``` diff --git a/2006/stewart/README.md b/2006/stewart/README.md index b83423947..23aeffed9 100644 --- a/2006/stewart/README.md +++ b/2006/stewart/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./stewart width_and_height iterations file > file.xbm convert file.xbm file.png ``` @@ -29,7 +29,7 @@ NOTE: `convert(1)` belongs to [ImageMagick](https://imagemagick.org/index.php). ## Try: -``` +``` ./try.sh ``` @@ -58,7 +58,7 @@ a reasonably experienced user who can parse formats in their mind. :-) The program should be run with the following -``` +``` ./stewart ``` @@ -77,7 +77,7 @@ are 3. Wrong arguments will cause the program to bomb out. #### Example: -``` +``` ./stewart 1024 1000000 gasket > gasket.xbm ``` diff --git a/2006/sykes1/README.md b/2006/sykes1/README.md index d51e17857..36fee17f9 100644 --- a/2006/sykes1/README.md +++ b/2006/sykes1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -22,7 +22,7 @@ For more detailed information see [2006 sykes1 bugs](../../bugs.html#2006_sykes1 ## To use: -``` +``` ./sykes1 ``` @@ -31,7 +31,7 @@ Next point your browser to the file: `sykes1.html`. ## Try: -``` +``` ./sykes1 10 ``` @@ -39,7 +39,7 @@ Refresh your browser. You might also try: -``` +``` ./try.sh ``` @@ -52,7 +52,7 @@ If you have all day :-) and wish to find out how fast your machine can solve the maximum: -``` +``` time ./sykes1 19186 ``` @@ -81,7 +81,7 @@ This alternate code is based on the author's remarks. ### Alternate build: -``` +``` make alt ``` @@ -96,7 +96,7 @@ Use `sykes1.alt` as you would `sykes1` above. The [try.sh](try.sh) script will use both versions to show some differences. You can do so like: -``` +``` ./try.sh ``` @@ -106,7 +106,7 @@ can do so like: Read the [sykes1.html](sykes1.html) page source. Now then read the C source. Confused? :-) If it's not clear try: -``` +``` diff -s sykes1.c sykes1.html ``` @@ -138,7 +138,7 @@ need to be very lucky indeed to stumble across a solution. Compile the program, then test that it works: -``` +``` ./sykes1 ``` @@ -154,7 +154,7 @@ cube. Rendered in glorious 3D color. Want to see another solution? Try: -``` +``` ./sykes1 some_number ``` @@ -165,7 +165,7 @@ Try some more - there are exactly `19186` solutions to choose from. If you have a fast machine you might try the last solution: -``` +``` ./sykes1 19186 ``` @@ -178,7 +178,7 @@ The implementation is an optimized recursive algorithm that tries to fit the pieces into the cube one by one. The cube pieces are defined near the start of the program: -``` +``` int s[ ] = { 186, 94, 1426, 3098 ,1047 , 122 , 1082 , 3083 , 1039 , 569 , 527 , 1054 , 531 } ; @@ -233,7 +233,7 @@ the pieces, and provided that a solution is possible, it will be found. For example, if you modify line 13 of the source like this, the program will solve for a different piece set: -``` +``` int s[ ] = { 187, 94, 402, 3098 ``` diff --git a/2006/sykes2/README.md b/2006/sykes2/README.md index c0d579da2..cc10d2878 100644 --- a/2006/sykes2/README.md +++ b/2006/sykes2/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./sykes2 ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2006/toledo1/README.md b/2006/toledo1/README.md index 9f3907dfd..965bccfca 100644 --- a/2006/toledo1/README.md +++ b/2006/toledo1/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./toledo1 [0-9][0-9] ``` @@ -16,7 +16,7 @@ where `[0-9][0-9]` is a two digit number. ## Try: -``` +``` ./try.sh ``` @@ -38,7 +38,7 @@ visit the 64 squares without repeating them? If not, this program does it, just run it with an argument giving initial position. -``` +``` ./toledo1 11 # start is A8 ./toledo1 18 # start is H8 ./toledo1 81 # start is A1 diff --git a/2006/toledo2/README.md b/2006/toledo2/README.md index 3d6b31c4c..3c4846b33 100644 --- a/2006/toledo2/README.md +++ b/2006/toledo2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -22,7 +22,7 @@ For more detailed information see [2006 toledo2 bugs](../../bugs.html#2006_toled ## To use: -``` +``` ./toledo2 ``` @@ -33,7 +33,7 @@ does not seem to happen in macOS or linux in 2023. ## Try: -``` +``` ./toledo2 ``` @@ -56,7 +56,7 @@ functions in place of `read(2)` and `write(2)`. ### Alternate build: -``` +``` make alt ``` @@ -112,7 +112,7 @@ Journal](https://en.wikipedia.org/wiki/Dr._Dobb%27s_Journal). Type using uppercase letters. Here are three example programs. Press Enter after each line: -``` +``` 10 PRINT "Hello, world!" LIST RUN @@ -155,7 +155,7 @@ from the `SOURCE` directory: To import them, you must run the emulator with an argument, by example: -``` +``` ./toledo2 DDT.COM ``` diff --git a/2006/toledo3/README.md b/2006/toledo3/README.md index 7542733db..aa26efb83 100644 --- a/2006/toledo3/README.md +++ b/2006/toledo3/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,14 +11,14 @@ tested with Windows. See [alternate code](#alternate-code) below. ## To use: -``` +``` ./toledo3 [1 | 2 | 3 [b]] ``` ## Try: -``` +``` ./toledo3 1 ``` @@ -62,7 +62,7 @@ So I managed to do a graphical X11 chess program ('`WYSIAIE`', or 'What You See Is An IOCCC Entry'). Pointing and clicking to move pieces is the only required action, and of course the command-line options: -``` +``` ./toledo3 # Two-players mode (useful if you don't have a board at hand) ./toledo3 1 # Human white - Computer black, level 1 (fast) ./toledo3 2 # Human white - Computer black, level 2 (medium) @@ -97,7 +97,7 @@ number generator. Because it is resource-hungry, I strongly recommend to compile it using maximum optimization. With GCC you can use: -``` +``` gcc -O3 -fexpensive-optimizations prog.c -o prog -lX11 ``` diff --git a/2011/akari/README.md b/2011/akari/README.md index e4136da81..33a8ec3ef 100644 --- a/2011/akari/README.md +++ b/2011/akari/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./akari [ input_file | - ] [ output_file | - ] [even] ``` ## Try: -``` +``` ./try.sh ``` @@ -56,7 +56,7 @@ keep odd pixels on odd [scanlines](https://en.wikipedia.org/wiki/Scan_line). ### Examples: -``` +``` gcc akari.c -o akari ./akari < example.ppm > odd_output.ppm ./akari - - even < example.ppm > even_output.ppm @@ -82,7 +82,7 @@ Anything that is not parsable as `PGM` or `PPM` will be downsampled as ASCII art. Since the source code is formatted as ASCII art, it's only natural to try: -``` +``` ./akari akari.c akari2.c ``` @@ -91,7 +91,7 @@ By default, this second program reads text from `stdin` and writes expanded output to `stdout`. If the extra argument is specified, the output text will also pass through a rot13 filter. -``` +``` gcc akari2.c -o akari2 ./akari2 < input.txt > expanded_output.txt ./akari2 rot13 < input.txt > expanded_and_rot13_output.txt @@ -100,20 +100,20 @@ output text will also pass through a rot13 filter. You can combine the two programs together to have just a regular rot13 filter: -``` +``` ./akari2 rot13 < input.txt | ./akari > rot13.txt ``` Of course, we wouldn't stop with just 2 programs, you can downsample the source *again* and get yet another C program: -``` +``` ./akari < akari.c | ./akari > akari3.c ``` We must go deeper: -``` +``` ./akari < akari.c | ./akari | ./akari > akari4.c ``` diff --git a/2011/blakely/README.md b/2011/blakely/README.md index d607d4ea2..1b4f674bf 100644 --- a/2011/blakely/README.md +++ b/2011/blakely/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -9,20 +9,20 @@ Zoom out and make your terminal window 53 or more lines deep. -``` +``` ./blakely < blakely.c | head -300 ``` ## Try: -``` +``` ./try.sh ``` For those who have a lot of time, try: -``` +``` ./blakely < t0_3.dat ``` @@ -40,7 +40,7 @@ is a [Garden of Eden](http://en.wikipedia.org/wiki/Garden_of_Eden_%28cellular_au If you have enough time to spare, put the plan of your garden in a text file, and run: -``` +``` ./blakely - < garden.txt ``` @@ -54,7 +54,7 @@ over tabs. In order to see the main feature of the code, type: -``` +``` ./blakely < blakely.c ``` @@ -72,7 +72,7 @@ layout of the source-code is such that it evolves to a digital representation of the first 15 decimal places of pi after 4 time steps. This was setup using the other feature of the program which can be demonstrated as follows: -``` +``` ./blakely - < 3.dat ``` @@ -81,7 +81,7 @@ more grids (taking a few minutes to display the last). Waiting for any more grids will take a substantial amount of time. The final grid has been put into [evolve_to_3.dat](evolve_to_3.dat), and if you type -``` +``` ./blakely < evolve_to_3.dat ``` diff --git a/2011/borsanyi/README.md b/2011/borsanyi/README.md index 064418901..e76101ee7 100644 --- a/2011/borsanyi/README.md +++ b/2011/borsanyi/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2011 borsanyi bugs](../../bugs.html#2011_bors ## To use: -``` +``` ./borsanyi < some_data_file ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2011/dlowe/README.md b/2011/dlowe/README.md index ec7638b56..2a43a09f7 100644 --- a/2011/dlowe/README.md +++ b/2011/dlowe/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -19,7 +19,7 @@ For more detailed information see [2011 dlowe bugs](../../bugs.html#2011_dlowe). ## To use: -``` +``` ./dlowe - corpus1/ [...] corpus0/ < start.net > trained.net ``` @@ -27,7 +27,7 @@ NOTE: In the above command, the directory args MUST end in a `/`. Then to use `trained.net`: -``` +``` ./dlowe file [file ...] < trained.net ``` @@ -36,7 +36,7 @@ Then to use `trained.net`: Try these pre-trained networks: -``` +``` ./try.sh ``` @@ -44,7 +44,7 @@ NOTE: The `dlowe-aux-data/` directory, which [try.sh](try.sh) refers to, was created by: -``` +``` tar -jxf dlowe-aux-data.tar.bz2 ``` @@ -63,7 +63,7 @@ on the C code of entries that were supplied to the 20Th IOCCC. The `ioccc-winlose-trained.net` was trained using the [earlystop.pl](earlystop.pl) tool: -``` +``` rm -f ioccc-winlose-trained.net ./earlystop.pl ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/ ``` @@ -101,7 +101,7 @@ The resulting `ioccc-winlose-trained.net` file was included in the The [dlowe.c](dlowe.c) was explicitly excluded from this trailing set, so this test is interesting: -``` +``` ./dlowe dlowe.c < dlowe-aux-data/ioccc-winlose-trained.net ``` @@ -127,7 +127,7 @@ data sets on which to test: We created the [english-trained.net](dlowe-aux-data/english-trained.net) as follows: -``` +``` ./dlowe -8000 dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ < /dev/null > dlowe-aux-data/english-trained.net ``` @@ -139,7 +139,7 @@ We created the [english-trained.net](dlowe-aux-data/english-trained.net) as foll We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows: -``` +``` ./dlowe -8000 png-1/ png-0/ < /dev/null > dlowe-aux-data/png-trained.net ``` @@ -151,7 +151,7 @@ We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows: We created the [xor-trained.net](dlowe-aux-data/xor-trained.net) as follows: -``` +``` ./dlowe -8000 dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ < /dev/null > dlowe-aux-data/xor-trained.net ``` @@ -189,7 +189,7 @@ The neurons' activation function is the logistic function `1 / (1 + e ^ -x)`. ### Classifying -``` +``` ./dlowe file [file ...] < trained.net ``` @@ -205,7 +205,7 @@ trained, but it's geared toward interpretation as a *probability* or a ### Training -``` +``` ./dlowe - corpus1/ [...] corpus0/ < start.net > end.net ``` diff --git a/2011/eastman/README.md b/2011/eastman/README.md index 16143d677..e0c8478bb 100644 --- a/2011/eastman/README.md +++ b/2011/eastman/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./eastman ``` @@ -19,7 +19,7 @@ NOTE: to restore your cursor in your shell, try `reset`. Run the program. Quit it (ctrl-c/intr). Resize your terminal window. Run it again. Try doing this a number of times with different sizes each time. -``` +``` ./eastman ``` @@ -60,7 +60,7 @@ program is running, though. It only checks the size once, when it starts up. To compile: -``` +``` cc -lm eastman.c ``` diff --git a/2011/fredriksson/README.md b/2011/fredriksson/README.md index 562108af2..9c04ae94d 100644 --- a/2011/fredriksson/README.md +++ b/2011/fredriksson/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2011 fredriksson bugs](../../bugs.html#2011_f ## To use: -``` +``` ./fredriksson [-icvtnk#] regexp < file ``` ## Try: -``` +``` ./try.sh ``` @@ -55,7 +55,7 @@ Implements a variant of `grep`. To search regexp from file, do: -``` +``` ./fredriksson [-icvtnk#] regexp < file ``` @@ -123,13 +123,13 @@ expressions by putting `]` as the first character, and putting `-` last. Just say -``` +``` ./fredriksson -k3 cat < file ``` * Like with `cat`, you can append line numbers too: -``` +``` ./fredriksson -nk3 cat < file ``` @@ -173,7 +173,7 @@ Just say * Depending on the file, it might require a lot of stack space. If the program segfaults (because of this), say -``` +``` ulimit -s unlimited ``` @@ -207,7 +207,7 @@ Just say extracts and builds that, and then calls it. More precisely, the command to build is -``` +``` gcc -O3 ag.c -o ag ``` @@ -260,14 +260,14 @@ Just say * No numerical values, other than in the initialized char array, try -``` +``` ./fredriksson -ck0 [0-9] < fredriksson.c ``` This should print 1, as there is a number `3` in the char array (only). You can also try -``` +``` ./fredriksson -ck0 [0-9] < ag.c ``` diff --git a/2011/goren/README.md b/2011/goren/README.md index ecc7bd32d..20ca3e9e2 100644 --- a/2011/goren/README.md +++ b/2011/goren/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` echo "some text" | ./goren ``` ## Try: -``` +``` ./try.sh ``` @@ -27,13 +27,13 @@ In the words of [René François Ghislain Magritte Magritte](http://en.wikipedia One may ask the surrealist question: -``` +``` echo 'If | is just a representation of a pipe, then how can data stuff it?' | ./goren ``` However if one takes a firm stand and declares: -``` +``` echo '| is just a representation of a pipe because I say so! So stuff it!' | ./goren ``` diff --git a/2011/hamaji/README.md b/2011/hamaji/README.md index 06bc5da0c..1f05494db 100644 --- a/2011/hamaji/README.md +++ b/2011/hamaji/README.md @@ -1,27 +1,27 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./hamaji < a_nonogram_file ``` ## Try: -``` +``` ./try.sh ``` If you have perl installed you should be able to reproduce [dragon.nono](dragon.nono) like: -``` +``` perl c2nono.pl hamaji.c | ./hamaji ``` @@ -181,7 +181,7 @@ with the well obfuscated code. This program uses two C99 features. One line comments and `long long`. GCC's `-ansi -pedantic` check should pass: -``` +``` cc -ansi -pedantic -std=c99 hamaji.c ``` @@ -196,7 +196,7 @@ memory layout, undefined evaluation order (e.g., `a[i++]=i`), etc. This program won't work if the size of `long long` literal is less than 8. By grepping the source code of gcc -``` +``` grep LONG_LONG_TYPE_SIZE gcc/config/*/* ``` @@ -224,7 +224,7 @@ was randomly generated. The [codegolf.nono](codegolf.nono) and You can reproduce [dragon.nono](dragon.nono) from [hamaji.c](hamaji.c) using [c2nono.pl](c2nono.pl): -``` +``` perl c2nono.pl hamaji.c | ./hamaji ``` diff --git a/2011/hou/README.md b/2011/hou/README.md index 254d9b072..fedf45023 100644 --- a/2011/hou/README.md +++ b/2011/hou/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./hou 'expression' ``` ## Try: -``` +``` ./try.sh ``` @@ -32,7 +32,7 @@ source code. What does it mean? The calculator obeys the precedence rules and allows parenthesis. -``` +``` ./hou '1+2*3' ./hou '(1+2)*3' ``` @@ -41,7 +41,7 @@ What exactly does the text formatting do? What does this evaluate to in C? -``` +``` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ ``` diff --git a/2011/konno/README.md b/2011/konno/README.md index da53d68cc..87597f2c1 100644 --- a/2011/konno/README.md +++ b/2011/konno/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./konno lower_case_word ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2011/richards/README.md b/2011/richards/README.md index f4f6ca68b..0a34636f5 100644 --- a/2011/richards/README.md +++ b/2011/richards/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2011 richards bugs](../../bugs.html#2011_rich ## To use: -``` +``` echo expression | ./richards ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2011/toledo/README.md b/2011/toledo/README.md index c9c92d985..41ec92921 100644 --- a/2011/toledo/README.md +++ b/2011/toledo/README.md @@ -2,7 +2,7 @@ If you have X11 installed: -``` +``` make ``` @@ -13,7 +13,7 @@ Windows](toledo.alt2.c). See [Alternate code](#alternate-code) below. ## To use: -``` +``` ./toledo ``` @@ -49,7 +49,7 @@ but you can change them about however you like, even with other keys. For instance to swap `LEFT` and `RIGHT`: -``` +``` make clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt ``` @@ -75,7 +75,7 @@ the source early on, right before the code gets hard to follow, or using the Like Oscar's previous winning X11 program for the 19th IOCCC, if you remove both the X11 include files and replace them with -``` +``` #include "layer.c" ``` diff --git a/2011/vik/README.md b/2011/vik/README.md index a23661849..a75f5cc48 100644 --- a/2011/vik/README.md +++ b/2011/vik/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,20 +21,20 @@ For more detailed information see [2011 vik bugs](../../bugs.html#2011_vik). ## To use: -``` +``` ./vik file.mod > audio_file.raw ``` If you have `mplayer(1)`: -``` +``` ./vik file.mod | mplayer -demuxer rawaudio - ``` Alternatively, you can convert the file to a WAV: -``` +``` ./vik file.mod > file.raw; ./raw2wav file.raw > file.wav ``` @@ -43,7 +43,7 @@ and then play `file.wav` with a program that can play WAV files. ## Try: -``` +``` ./try.sh ``` @@ -66,7 +66,7 @@ This version is based on the author's remarks and it should work for Windows. Assuming that `make` is similar enough try: -``` +``` make alt ``` @@ -87,7 +87,7 @@ initialization for? Does it take your system a long time to compile? You may want to do: -``` +``` cc -S vik.c ``` @@ -153,7 +153,7 @@ Bertilsson, also known as Deelite: Compiling for Unix systems (including cygwin) is straight forward: -``` +``` gcc -o vik vik.c ``` @@ -162,13 +162,13 @@ Compiling for Unix systems (including cygwin) is straight forward: #### Convert MOD file to raw 44.1kHz stereo audio file -``` +``` ./vik mad_world.mod > audio_file.raw ``` #### Listen to the MOD file (streaming to mplayer) -``` +``` ./vik randowan.mod | mplayer -demuxer rawaudio - ``` @@ -210,7 +210,7 @@ Microsoft compilers adds a carriage return to newlines, and to compile the program with this platform, the following line can be added after the main declaration in order for the program to run correctly: -``` +``` _setmode(_fileno(stdout), 0x8000); ``` diff --git a/2011/zucker/README.md b/2011/zucker/README.md index 35e73d2a7..eab5c9ab7 100644 --- a/2011/zucker/README.md +++ b/2011/zucker/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ binary mode from text mode. See [alternate code](#alternate-code) below. ## To use: -``` +``` ./zucker > image.ppm ``` @@ -19,7 +19,7 @@ Now open `image.ppm` with your image viewer of choice. ## Try: -``` +``` ./try.sh ``` @@ -36,7 +36,7 @@ that distinguish binary and text. ### Alternate build: -``` +``` make alt ``` @@ -68,7 +68,7 @@ This entry uses no local variables. None! At! All! This program makes pretty pictures. To see the default output, try running -``` +``` ./zucker > ioccc2011.ppm ``` @@ -82,7 +82,7 @@ Netpbm files, and are available on multiple platforms. With macOS you can type at the command line: -``` +``` open ioccc2021.ppm ``` @@ -90,7 +90,7 @@ and it will open image in the default application Preview.app. To use ImageMagick you might do something like: -``` +``` convert ioccc2011.ppm ioccc2011.png ``` @@ -98,7 +98,7 @@ and then open `ioccc2011.png` in your viewer of choice. To use GraphicsMagick you might do something like: -``` +``` gm convert ioccc2011.ppm ioccc2011.png ``` @@ -107,14 +107,14 @@ and then open `ioccc2011.png` in your viewer of choice. Aside from the default image, you may create your own by running the program as follows: -``` +``` ./zucker "your text" > image.ppm ``` To mitigate long runtime, the program can be invoked in a "preview" mode by appending `-preview` to the command line arguments, like so: -``` +``` ./zucker faster\! -preview > image.ppm ``` diff --git a/2012/blakely/README.md b/2012/blakely/README.md index d2cbcae27..ddb3b3359 100644 --- a/2012/blakely/README.md +++ b/2012/blakely/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2012 blakely bugs](../../bugs.html#2012_blake ## To use: -``` +``` ./blakely "RPN formula" resolution > output.gif ``` ## Try: -``` +``` ./try.sh ``` @@ -59,7 +59,7 @@ output to `stdout`. The program should be run as: -``` +``` ./blakely xy* 32 > pic.gif ``` @@ -105,7 +105,7 @@ resolution of `ripple.gif` to 250 took ~35 minutes to render on an [i7 processor](https://en.wikipedia.org/wiki/Intel_Core#Core_i7). -``` +``` ./blakely xy* 32 > saddle.gif ./blakely xx*yy*1++d5*ct/ 64 > ripple.gif diff --git a/2012/deckmyn/README.md b/2012/deckmyn/README.md index c8bb59a8f..9d9a19ba7 100644 --- a/2012/deckmyn/README.md +++ b/2012/deckmyn/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2012 deckmyn bugs](../../bugs.html#2012_deckm ## To use: -``` +``` ./deckmyn "$(cat deckmyn.c)" "$(cat musicfile.txt)" > sheetmusic.pbm ``` ## Try: -``` +``` ./try.sh ``` @@ -59,13 +59,13 @@ You need the source code and example input (either one of the example files, or manual input as below) ready and a program capable of showing [.pbm bitmap format](https://en.wikipedia.org/wiki/Netpbm) images. -``` +``` ./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm ``` If you have macOS you can open the image like: -``` +``` open greensleeves.pbm ``` @@ -73,13 +73,13 @@ If you have macOS you can open the image like: normally open an image. -``` +``` ./deckmyn "`cat deckmyn.c`" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm ``` If you have macOS you can open the image like: -``` +``` open short_bass.pbm ``` diff --git a/2012/deckmyn/deckmyn.md b/2012/deckmyn/deckmyn.md index aad09ef7c..9f5266dd6 100644 --- a/2012/deckmyn/deckmyn.md +++ b/2012/deckmyn/deckmyn.md @@ -3,7 +3,7 @@ ## Calling the program -``` +``` ./deckmyn "`cat deckmyn.c`" "`cat musicfile`" > output.pbm ``` @@ -85,7 +85,7 @@ musical element of a line is only 2 characters! Blank music paper (with G clef): -``` +``` ./deckmyn "`cat deckmyn.c`" "sz sa x s1 x s1 x s1 x s1 x s1 "> blank.pbm ``` diff --git a/2012/dlowe/README.md b/2012/dlowe/README.md index e43821d11..9dab3ccab 100644 --- a/2012/dlowe/README.md +++ b/2012/dlowe/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2012 dlowe bugs](../../bugs.html#2012_dlowe). ## To use: -``` +``` ./dlowe ``` ## Try: -``` +``` ./dlowe ``` diff --git a/2012/endoh1/README.md b/2012/endoh1/README.md index 5c293ad15..a14ce7a4d 100644 --- a/2012/endoh1/README.md +++ b/2012/endoh1/README.md @@ -1,5 +1,5 @@ -``` +``` make ``` @@ -14,7 +14,7 @@ section below for more details. ## To use: -``` +``` ./endoh1 < file ``` @@ -25,7 +25,7 @@ see what this looks like not going so fast then you might wish to try the ## Try: -``` +``` ./try.bw.sh endoh1.c ./try.sh endoh1.c @@ -50,7 +50,7 @@ the fluid and change the behaviour of the fluid. The file For the default values, try: -``` +``` make alt ``` @@ -59,13 +59,13 @@ one can more easily go through the list of files to see them all in succession, for fun. That is controlled by the variable `TIMER` at compilation. For instance if you wish to change the value to 5: -``` +``` make clobber TIMER=5 alt ``` If you want to disable the alarm time, set it to 0: -``` +``` make clobber TIMER=0 alt ``` @@ -76,7 +76,7 @@ see and to not flash too quickly. The code protects against a value < 0 and defaults to 12321 but you can change it to. For instance to slow it down you could increase the sleep time from `12321` to `50000`: -``` +``` make clobber SLEEP=50000 alt ``` @@ -84,7 +84,7 @@ could increase the sleep time from `12321` to `50000`: If you wish to speed it up you might decrease the sleep time from `12321` to `9999`: -``` +``` make clobber SLEEP=9999 alt ``` @@ -97,7 +97,7 @@ viscosity factor, you should redefine the values `GRAVITY`, `PRESSURE` and/or `VISCOSITY` macros, respectively. For instance if you wish to change the viscosity and pressure factors but leave the other values alone: -``` +``` make clobber VISCOSITY=X PRESSURE=Y alt ``` @@ -111,13 +111,13 @@ You might also wish to try redefining the macros `G`, `P` and/or `V`. For instance: -``` +``` make clobber GRAVITY=5 PRESSURE=5 VISCOSITY=5 alt ``` You might try even: -``` +``` make clobber GRAVITY=I alt ``` @@ -141,7 +141,7 @@ and `endoh1_color` above. To see two different ways run on the source file and each of the text files, try: -``` +``` ./try.alt.sh ``` @@ -149,7 +149,7 @@ The second run of each will be with the gravity factor set to `I`. To see the same thing but in the original uncoloured version, try: -``` +``` ./try.alt.bw.sh ``` @@ -178,7 +178,7 @@ entry](https://web.archive.org/web/20230711134609/https://whatif.xkcd.com/6/). **DO NOT FORGET** `-DG=1 -DP=4 -DV=8` and make your terminal window larger than 80 x 25. -``` +``` cc endoh1.c -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -o endoh1 -lm ./endoh1 < endoh1.c ./endoh1 < logo.txt @@ -246,7 +246,7 @@ to build with no warning. Under these conditions, it should be portable. At least, recent compilers with `-std=c99 -Wall -W -Wextra -pedantic` say nothing. -``` +``` gcc -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -std=c99 -Wall -W -Wextra -pedantic endoh1.c clang -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -std=c99 -Wall -W -Wextra -pedantic endoh1.c diff --git a/2012/endoh2/README.md b/2012/endoh2/README.md index d66080869..5f24cc5ea 100644 --- a/2012/endoh2/README.md +++ b/2012/endoh2/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./endoh2 > pi.c gcc -o pi pi.c ./pi > 314.c @@ -15,7 +15,7 @@ and: -``` +``` ./endoh2 e > e.c\ gcc -o e e.c ./e > 271.c @@ -26,7 +26,7 @@ and: ## Try: -``` +``` ./try.sh ``` @@ -112,7 +112,7 @@ characters and not requiring a return in `main()`. In fact, recent compilers with `-std=c99 -Wall -W -Wextra -pedantic` would say nothing. -``` +``` gcc -std=c99 -Wall -W -Wextra -pedantic spigot.c clang -std=c99 -Wall -W -Wextra -pedantic spigot.c ``` @@ -123,7 +123,7 @@ and gcc-4.5.3 and clang-3.1 on Cygwin. ### Synopsis -``` +``` cc endoh2.c -o endoh2 ./endoh2 > pi.c diff --git a/2012/grothe/README.md b/2012/grothe/README.md index ed8e02736..ab6b53133 100644 --- a/2012/grothe/README.md +++ b/2012/grothe/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -9,7 +9,7 @@ To create a shared secret shared among `M` people with `N+1` needed to reconstruct: -``` +``` ./grothe -secret 1-/dev/urandom 2-/dev/urandom ... \ N-/dev/urandom 1+shared1 2+shared2 ... M+sharedM ``` @@ -17,14 +17,14 @@ To create a shared secret shared among `M` people with `N+1` needed to reconstru To reconstruct the original (an arbitrary combination of `N+1` or more shared files with their proper numbers): -``` +``` ./grothe I-sharedI J-sharedJ K-sharedK ... +reconstructed ``` ## Try: -``` +``` ./try.sh ``` @@ -75,7 +75,7 @@ To share a secret. For example: To split a secret into 4 pieces of which at least 3 will be needed to get it (in this case the cookie recipe) back: -``` +``` ./grothe \ -cookie_recipe.txt\ 1-/dev/urandom 2-/dev/urandom\ @@ -84,7 +84,7 @@ this case the cookie recipe) back: To put the recipe back together using the first, second and fourth pieces: -``` +``` ./grothe \ 1-cookie_piece1.dat 2-cookie_piece2.dat 4-cookie_piece4.dat +cookie_recipe_restore.txt diff --git a/2012/hamano/README.md b/2012/hamano/README.md index c1a283eae..0526f0d9a 100644 --- a/2012/hamano/README.md +++ b/2012/hamano/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./hamano < textfile > output.pdf ``` ## Try: -``` +``` ./try.sh ``` @@ -30,7 +30,7 @@ README.md! That procedure looks like: -``` +``` ./hamano < README.md > hint.pdf cc -xc hint.pdf -o hint ./hint @@ -40,7 +40,7 @@ Another PDF generated is an obfuscated `Hello World!` program (obfuscated inside the PDF). Once this is done it will compile the PDF as if it was C (itself!). It will look like: -``` +``` echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf cc -xc hello.pdf -o hello ./hello | cc -Wno-implicit-function-declaration -xc - -o ./hello2 diff --git a/2012/hou/README.md b/2012/hou/README.md index 19e567c29..38b40f3af 100644 --- a/2012/hou/README.md +++ b/2012/hou/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./hou syntax-file file-to-process ``` ## Try: -``` +``` ./try.sh ``` @@ -80,7 +80,7 @@ The following regular expression operators are supported: For example, one can use the following expression to match a certain declaration statement in [hou.c](hou.c): -``` +``` "char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*; ``` @@ -89,7 +89,7 @@ The regex engine is also algorithmically efficient. To illustrate the point, hang for the competing Perl engine while matching itself. Try to compare these two engines: -``` +``` ./hou ansi.txt ansi.txt perl patho.pl < ansi.txt ``` diff --git a/2012/hou/hint.md b/2012/hou/hint.md index 64124bc35..e706f5d7a 100644 --- a/2012/hou/hint.md +++ b/2012/hou/hint.md @@ -2,13 +2,13 @@ ### To build: -``` +``` make hou ``` ### To run: -``` +``` ./hou syntax-file file-to-process ``` @@ -81,7 +81,7 @@ The following regular expression operators are supported: For example, one can use the following expression to match a certain declaration statement in hou.c: -``` +``` "char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*; ``` @@ -89,7 +89,7 @@ The regex engine is also algorithmically efficient. To illustrate the point, ansi.txt contains a pathological expression [2] that guarantees a hang for the competing Perl engine while matching itself. Try to compare these two engines: -``` +``` ./hou ansi.txt ansi.txt perl patho.pl < ansi.txt ``` diff --git a/2012/kang/README.md b/2012/kang/README.md index 708428292..8a513c942 100644 --- a/2012/kang/README.md +++ b/2012/kang/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ See [Alternate code](#alternate-code) below for the (fun) rationale here. ## To use: -``` +``` echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang ``` ## Try: -``` +``` ./try.sh # try various languages ./en.sh # English 0 through 13 @@ -43,14 +43,14 @@ subtlety of this entry even more. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang.alt echo vier | ./kang.alt @@ -61,7 +61,7 @@ subtlety of this entry even more. ### Alternate try: -``` +``` ./try.alt.sh # try various languages ./en.alt.sh # English 0 through 13 @@ -88,13 +88,13 @@ We've added a linefeed to the print format for convenience. Can you explain why: -``` +``` echo f hundr|./kang ``` correctly reports 500 but: -``` +``` echo hundr|./kang ``` diff --git a/2012/konno/README.md b/2012/konno/README.md index e5e962e3f..afbeaa3c9 100644 --- a/2012/konno/README.md +++ b/2012/konno/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ code](#alternate-code) below. ## To use: -``` +``` ./konno N ``` ## Try: -``` +``` ./try.sh # you can also specify numbers to try before the random and preselected ones: @@ -36,7 +36,7 @@ This alternate code is an unobfuscated version of the winning code. ### Alternate build: -``` +``` make alt ``` @@ -64,7 +64,7 @@ patterns. Try: -``` +``` ./konno 30 ./konno 90 ./konno 102 @@ -79,13 +79,13 @@ There are 256 (from 0 through 255) possible rules. This program uses bit operations. I think -``` +``` 7&O<>!o+29 ``` is an interesting operation. This isn't equal to -``` +``` 7&O>>29 ``` diff --git a/2012/omoikane/README.md b/2012/omoikane/README.md index 50820868c..b43d5b1e4 100644 --- a/2012/omoikane/README.md +++ b/2012/omoikane/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -12,7 +12,7 @@ theoretically work with Windows which distinguishes binary and text. See ## To use: -``` +``` ./nyaruko [seed.txt] < original.bin > output.c bash output.c > key.c perl output.c > data.c @@ -30,7 +30,7 @@ binary itself. ## Try: -``` +``` ./try.sh ``` @@ -53,13 +53,13 @@ binary mode on `stdin` and `stdout`. For the first version: -``` +``` make alt ``` For the second version: -``` +``` make alt2 ``` @@ -73,7 +73,7 @@ Use `nyaruko.alt` or `nyaruko.alt2` as you would `nyaruko` above. For the first alternate version: -``` +``` ./try.alt.sh ``` @@ -93,7 +93,7 @@ The judges have nothing to add that has not already been written about in the `Nyaruko` is a binary to text filter. Given some input on `stdin`, `Nyaruko` will produce C code that reproduces this input on `stdout`: -``` +``` ./nyaruko < original.bin > output.c gcc output.c -o output ./output > regenerated.bin @@ -102,7 +102,7 @@ The judges have nothing to add that has not already been written about in the Output is encrypted, but both key and data are included in the output. To separate the key from the data, run these commands: -``` +``` bash output.c > key.c perl output.c > data.c ``` @@ -114,7 +114,7 @@ why the code is formatted the way it is. To combine the key and data, concatenate them together in either order: -``` +``` cat key.c data.c > output.c cat data.c key.c > output.c ``` @@ -123,7 +123,7 @@ By default, `Nyaruko` generates a unique random key for every message, using `/dev/urandom` as the seed. If given an extra command line argument, `Nyaruko` will seed using that file instead of `/dev/urandom`: -``` +``` ./nyaruko seed.txt < input.bin > output.c ``` diff --git a/2012/tromp/README.md b/2012/tromp/README.md index e14d41860..0c0931f42 100644 --- a/2012/tromp/README.md +++ b/2012/tromp/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all # On a 64-bit machine (default) make tromp32 # On a 32-bit machine @@ -20,7 +20,7 @@ For more detailed information see [2012 tromp bugs](../../bugs.html#2012_tromp). ## To use: -``` +``` ./tromp [-b] ``` @@ -29,7 +29,7 @@ Use `./tromp32` as you would `./tromp` if on a 32-bit machine. ## To use: -``` +``` cat ascii-prog.blc data | ./tromp -b cat binary-prog.Blc data | ./tromp ``` @@ -37,7 +37,7 @@ Use `./tromp32` as you would `./tromp` if on a 32-bit machine. ## Try: -``` +``` ./try.sh ``` @@ -113,7 +113,7 @@ identity function. When its encoding `0010` is fed into the universal machine, it will simply copy the input to the output (well, not that simply, since each byte is smashed to bits and rebuilt from scratch). Voila: a half byte cat: -``` +``` $ echo " Hello, world" | ./tromp Hello, world ``` @@ -122,7 +122,7 @@ Since the least significant 4 bits of the first byte are just arbitrary padding that is ignored by the program, any character from ASCII 32 (space) through 47 (`/`) will do, e.g.: -``` +``` $ echo "*Hello, world" | ./tromp Hello, world ``` @@ -134,7 +134,7 @@ If the input doesn't start with a valid program, that is, if the interpreter reaches end-of-file during program parsing, it will crash in some way. E.g. the following might dump core: -``` +``` echo -n "U" | ./tromp ``` @@ -143,7 +143,7 @@ closed, that is, variable `n` can only appear within at least `n` enclosing lambdas. For instance, here the term `\ 5` is not closed, causing the interpreter to crash when looking into a null-pointer environment: -``` +``` echo ">Hello, world" | ./tromp ``` @@ -200,7 +200,7 @@ The byte oriented BLC8 version weighs in at 43 bytes (shown in hexadecimal). ``` -``` +``` $ (cat uni8.Blc; echo " Ni hao") | ./tromp Ni hao ``` @@ -225,7 +225,7 @@ Even shorter than the self-interpreter is this prime number sieve in 167 bits The `n`th bit in the output indicates whether n is prime: -``` +``` $ cat primes.blc | ./tromp -b | head -c 70 0011010100010100010100010000010100000100010100010000010000010100000100 ``` @@ -265,7 +265,7 @@ The program `hilbert.Blc`, at 143 bytes, is a very twisty "one-liner" (shown in It expects `n` arbitrary characters of input, and draws a space filling [Hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve) of order `n`: -``` +``` $ (cat hilbert.Blc; echo -n "1") | ./tromp _ | | @@ -344,7 +344,7 @@ Writing BLC programs can be made slightly less painful with this parser that translates single-letter-variable lambda calculus into BLC: -``` +``` $ echo "\f\x f (f (f x))" > three $ cat parse.Blc three | ./tromp 000001110011100111010 @@ -358,21 +358,21 @@ into BLC8: So we could assemble an input reversing program as -``` +``` echo "\a a ((\b b b) (\b \c \d \e d (b b) (\f f c e))) (\b \c c)" > reverse cat parse.Blc reverse | ./tromp > reverse.blc ``` and change it to BLC8 with -``` +``` $ cat deflate.Blc reverse.blc | ./tromp > rev.Blc $ wc rev.Blc 0 1 9 rev.Blc ``` and then try it out with: -``` +``` $ cat rev.Blc - | ./tromp Hello, world! ^D @@ -384,7 +384,7 @@ and then try it out with: BLC8 program `symbolic.Blc` shows individual reduction steps on symbolic lambda terms. Here it is used to show the calculation of 2^3 in Church numerals: -``` +``` $ echo "(\f\x f (f (f x))) (\f\x f (f x))" > threetwo $ cat parse.Blc threetwo | ./tromp > threetwo.blc $ cat symbolic.Blc threetwo.blc | ./tromp @@ -412,7 +412,7 @@ Taking only the first line of output gives us a sort of BLC disassembler, an exact inverse of the above assembler. The prime number sieve disassembles as follows: -``` +``` $ cat symbolic.Blc primes.blc | ./tromp | head -1 \a (\b b (b ((\c c c) (\c \d \e e (\f \g g) ((\f c c f ((\g g g) (\g f (g g)))) (\f \g \h \i i g (h (d f))))) (\c \d \e b (e c))))) (\b \c c (\d \e d) b) ``` @@ -421,7 +421,7 @@ Hardly any less obfuscated... The last line of -``` +``` cat symbolic.Blc primes.blc | ./tromp | head -16 ``` @@ -459,7 +459,7 @@ under the interpreter perform much worse than that same program written in Haske Our interpreter copes well with extra levels of interpretation: -``` +``` $ time cat primes.blc | ./tromp -b | head -c 210 > /dev/null real 0m0.043s $ time cat uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null diff --git a/2012/vik/README.md b/2012/vik/README.md index 3e6a8450a..0a25b1cb8 100644 --- a/2012/vik/README.md +++ b/2012/vik/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -25,38 +25,38 @@ For more detailed information see [2012 vik bugs](../../bugs.html#2012_vik). To embed text (from file or command line): -``` +``` ./vik e base.png filename > encodedimg.png ``` or -``` +``` ./vik e base.png SomeRandomText > encodedimg.png ``` To extract the embedded text: -``` +``` ./vik d encodedimg.png ``` To embed a PNG into another: -``` +``` ./vik e base.png source.png > encodedimg.png ``` To extract the embedded PNG: -``` +``` ./vik d encodedimg.png > restored.png ``` ## Try: -``` +``` ./try.sh ``` @@ -68,7 +68,7 @@ For those few who might use Windows this alternate code might work. ### Alternate build: -``` +``` make alt ``` @@ -116,7 +116,7 @@ possible to get the bitmap data from the extracted image, and run it through any of the previous winning brainfuck interpreters, but I thought it would be easier to include an interpreter in the program to avoid the hassle: -``` +``` ./vik e ioccc.png chocolate.png > encodedimg.png ./vik b encodedimg.png ``` @@ -125,7 +125,7 @@ It is of course also possible to embed a [brainfuck](https://en.wikipedia.org/wiki/Brainfuck) program as a text file (as explained above) and decode it, e.g.: -``` +``` ./vik e ioccc.png .+[.+] > encodedimg.png ./vik b encodedimg.png ``` @@ -154,7 +154,7 @@ compile the program on this platform, the following line can be added after the variable declarations in the main declaration in order to run correctly: -``` +``` _setmode(_fileno(stdout), 0x8000); ``` diff --git a/2012/zeitak/README.md b/2012/zeitak/README.md index af170b91f..88f19133e 100644 --- a/2012/zeitak/README.md +++ b/2012/zeitak/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ code](#alternate-code) below. ## To use: -``` +``` ./zeitak < file ``` @@ -21,7 +21,7 @@ text files that are not code. ## Try: -``` +``` make test ``` @@ -38,7 +38,7 @@ understand this extremely subtle entry. ### Alternate build: -``` +``` make alt ``` @@ -92,7 +92,7 @@ around it's position. * Ignores parenthesis inside strings or character constants, so no errors will be detected in the following line: -``` +``` printf(")"); ``` @@ -104,7 +104,7 @@ around it's position. * Escapes (e.g. `\"`) are ignored, so the following line will produce an error: -``` +``` printf("\""); ``` diff --git a/2013/README.md b/2013/README.md index b9960cb1d..69d163e0d 100644 --- a/2013/README.md +++ b/2013/README.md @@ -43,13 +43,13 @@ had to print a value 2053 or less when the `-i` flag was used. Several people discovered an undocumented feature in that certain comments such as: -``` +``` ///* ``` or: -``` +``` *\ / ``` diff --git a/2013/birken/README.md b/2013/birken/README.md index e6b3901a7..e957f9982 100644 --- a/2013/birken/README.md +++ b/2013/birken/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make alt ``` @@ -11,7 +11,7 @@ version see the [original code](#original-code) section below. ## To use: -``` +``` ./birken.alt < 17_columns_wide_paint_by_numbers_file ``` @@ -30,7 +30,7 @@ it should you wish (see below). To see the program run on each text file, try: -``` +``` ./try.alt.sh ``` @@ -44,7 +44,7 @@ other entries where this was made an alternate version it is configurable at compile time. If you wish to speed it up by 100% you can instead do: -``` +``` make clobber SLEEP=7500 alt ``` @@ -55,7 +55,7 @@ If you wish to speed that up 200% (300% total) you can use instead try ctrl-c to terminate the program early but note that the terminal is likely to be messed up. In that case try: -``` +``` reset ``` @@ -70,7 +70,7 @@ hard to see the art of the entry but you may do so if you wish. ### Original build: -``` +``` make all ``` @@ -84,7 +84,7 @@ Use `birken` as you would `birken.alt` above. To use the demo script with the original code, try: -``` +``` ./try.sh ``` @@ -96,7 +96,7 @@ PLEASE be careful if you are sensitive to flashing colours! This program also wins the "Most amusing abuse of the iocccsize tool" award; although not the absolute best: it is possible to achieve 0 by writing: -``` +``` /* *\ /.... ``` @@ -319,7 +319,7 @@ This program demonstrates how to exploit a bug in IOCCC size tool version If that line is added to the top of any program, the tool will report a size of 8. -``` +``` $ ./iocccsize -i < prog.c 8 ``` @@ -327,7 +327,7 @@ If that line is added to the top of any program, the tool will report a size of When that line is deleted from this program, the tool properly reports the secondary size limit of the program as 2048. -``` +``` $ ./iocccsize -i < birken.c 2048 ``` @@ -357,7 +357,7 @@ Carefully selected variable names also yielded wonderful expressions like `l=0`, `O=0`, `O=1` and `while(O)`. `"Tetris"` also makes a second appearance of sorts: -``` +``` [T][e][t]--; while(R+i) { s ``` diff --git a/2013/cable1/README.md b/2013/cable1/README.md index 60ccaaaba..87fddc93a 100644 --- a/2013/cable1/README.md +++ b/2013/cable1/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./cable1 name group1 group2 ``` ## Try: -``` +``` ./try.sh ``` @@ -26,39 +26,39 @@ We need not limit ourselves to the two major political parties in the US today. Let us consider: -``` +``` ./cable1 Cooper Mac PC ``` Simon works for Apple, so you would expect Mac. :-) Landon is a long time Mac user: -``` +``` ./cable1 Noll Mac PC ``` That works too! Now Leo brings PCs to the IOCCC judging for cross-platform testing: -``` +``` ./cable1 Broukhis Mac PC ``` We can test other people. The late Steve Jobs: -``` +``` ./cable1 Jobs Mac PC ``` That works! How about Bill? -``` +``` ./cable1 Gates Mac PC ``` A PC guy as expected. What about that other Steve? -``` +``` ./cable1 Ballmer Mac PC ``` diff --git a/2013/cable2/README.md b/2013/cable2/README.md index fceb15381..8c48bd5c9 100644 --- a/2013/cable2/README.md +++ b/2013/cable2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2013 cable2 bugs](../../bugs.html#2013_cable2 ## To use: -``` +``` ./cable2 file.bmp [color] ``` @@ -27,7 +27,7 @@ For more detailed information see [2013 cable2 bugs](../../bugs.html#2013_cable2 For different OCR examples: -``` +``` ./try.sh ``` diff --git a/2013/cable3/README.md b/2013/cable3/README.md index b3c876d8e..8b0f43e0c 100644 --- a/2013/cable3/README.md +++ b/2013/cable3/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ available. See the [Alternate code](#alternate-code) section below. ## To use: -``` +``` ./cable3 bios-image-file floppy-image-file [harddisk-image-file] ``` ## Try: -``` +``` ./cable3.sh ``` @@ -46,7 +46,7 @@ An alternate version, which should compile in Windows, is provided. Assuming `make` is available and will function: -``` +``` make alt ``` @@ -173,7 +173,7 @@ non-UNIX platforms. For example, for Windows/MS Visual Studio, instead of the Makefile definition of KB, use something slightly different - add the following entry to the Preprocessor Definitions list in the Project Properties page: -``` +``` KB=(kb=H(8),kbhit())&&(r[1190]=getch(),H(7)) ``` @@ -189,7 +189,7 @@ offsets) this is not the case, and to run successfully on these systems, you will need to explicitly declare these functions by adding the appropriate include to the top of the source: -``` +``` #include ``` @@ -197,7 +197,7 @@ NOTE: this has been done in [cable3.c](cable3.c). ### Usage -``` +``` ./cable3 bios-image-file floppy-image-file [harddisk-image-file] ``` @@ -205,7 +205,7 @@ PLEASE NOTE that under Unices the keyboard must be in raw mode for the emulator to work properly. Therefore the emulator is best run from a shell script that looks something like: -``` +``` stty cbreak raw -echo min 0 ./cable3 bios floppy.img harddisk.img stty cooked echo @@ -223,7 +223,7 @@ put the keyboard into raw mode (and afterwards it needs to be put back to cooked). So, run the emulator using something like this script (provided as [cable3.sh](cable3.sh)): -``` +``` stty cbreak raw -echo min 0 ./cable3 bios fd.img stty cooked echo @@ -237,7 +237,7 @@ whole bunch of software which is in the included file `hd.img`. For the more adventurous, you can start off with (for example) a blank 40MB image file called hd.img made using e.g. Makefile. Then use: -``` +``` stty cbreak raw -echo min 0 ./cable3 bios fd.img hd.img stty cooked echo diff --git a/2013/dlowe/README.md b/2013/dlowe/README.md index 2bc4747e9..693a2a7c7 100644 --- a/2013/dlowe/README.md +++ b/2013/dlowe/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2013 dlowe bugs](../../bugs.html#2013_dlowe). ## To use: -``` +``` ./dlowe [number...] ``` @@ -27,13 +27,13 @@ where `[number...]` is one or more number, space separated. ## Try: -``` +``` ./try.sh ``` What is different about the above if you do something like: -``` +``` echo 'IOCCC winning entry 2013/dlowe' > ioccc.txt ./try.sh rm -f ioccc.txt @@ -43,7 +43,7 @@ What is different about the above if you do something like: To make it simpler to see try showing just the different line like: -``` +``` ./diff.sh ``` @@ -58,7 +58,7 @@ with one argument or when all arguments are equal? For extra fun, compile and run [fun.c](fun.c): -``` +``` #include int main() { printf("%d %d %d\n", (int)(-1.0/0.0), (int)(0.0/0.0), (int)(1.0/0.0)); @@ -91,7 +91,7 @@ Which one is correct? :) NOTE: `make all` will compile [fun.c](fun.c) but to provide a different compiler you can do something like: -``` +``` make CC=clang fun ``` @@ -105,7 +105,7 @@ A tiny implementation of command-line ### Synopsis -``` +``` $ ./sparkl 0 1 2 3 4 5 6 7 ▁▂▃▄▅▆▇▉ @@ -115,7 +115,7 @@ A tiny implementation of command-line NOTE: this has been provided in [slflen.sh](slflen.sh) so you can try: -``` +``` ./slflen.sh ``` diff --git a/2013/endoh1/README.md b/2013/endoh1/README.md index e6308563d..19243d2d8 100644 --- a/2013/endoh1/README.md +++ b/2013/endoh1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,20 +18,20 @@ For more detailed information see [2013 endoh1 bugs](../../bugs.html#2013_endoh1 ## To use: -``` +``` ./endoh1 [file.lazy] ``` ## Try: -``` +``` ./try.sh ``` You might also enjoy running: -``` +``` cc -E endoh1.c | less ``` @@ -50,7 +50,7 @@ This entry can be considered an abuse of the GCC's optimizer; it takes GCC about ### Remarks -``` +``` less endoh1.c gcc -o endoh1 endoh1.c ./endoh1 @@ -66,7 +66,7 @@ especially, [Lazy K][2]. This program will shine when it is used as a library. For example, [hello.lazy](hello.lazy) is a "Hello world" program written in Lazy K. -``` +``` $ lazy hello.lazy Hello, world! ``` @@ -75,7 +75,7 @@ where `lazy` is [a reference implementation of Lazy K][3]. At the same time, [hello.lazy](hello.lazy) is *a valid C program* that uses [endoh1.c](endoh1.c) as a library. -``` +``` $ gcc -o hello -xc hello.lazy $ ./hello Hello, world! @@ -136,7 +136,7 @@ I confirmed that the program successfully worked with the following compilers: Recent compilers with `-Wall -W -Wextra -pedantic` say nothing. -``` +``` gcc -Wall -W -Wextra -pedantic prog.c clang -Wall -W -Wextra -pedantic prog.c tcc -Wall -W -Wextra -pedantic prog.c @@ -173,7 +173,7 @@ combinator calculus. The rewriting rules are shown in the shape of the code. Consider a sequence of function applications in C: -``` +``` s(x)(x)(x)(x)... ``` @@ -182,7 +182,7 @@ type", such as `typedef f (*f)();`. So, I used a heavily nested function pointer type: -``` +``` typedef void *(*(*(*...(*(f))()...)())()) ``` @@ -207,7 +207,7 @@ However, no type in C is callable and has a reference at the same time. So, I addressed this issue by generating many function definitions statically by (ab)using macros: -``` +``` void *x1; void f1(void *y) { return apply(x1, y); } void *x2; void f2(void *y) { return apply(x2, y); } void *x3; void f3(void *y) { return apply(x3, y); } diff --git a/2013/endoh2/README.md b/2013/endoh2/README.md index 21ba12f91..9a716cfe3 100644 --- a/2013/endoh2/README.md +++ b/2013/endoh2/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` make check ``` @@ -23,7 +23,7 @@ download one or both before exiting. ## Try: -``` +``` less jpeg.c ``` diff --git a/2013/endoh3/README.md b/2013/endoh3/README.md index 9bf023360..1a764788e 100644 --- a/2013/endoh3/README.md +++ b/2013/endoh3/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2013 endoh3 bugs](../../bugs.html#2013_endoh3 ## To use: -``` +``` ./endoh3 ``` @@ -29,7 +29,7 @@ system up for this or if you want to verify that everything is oky. ## Try: -``` +``` ./try.sh ./try.sh ABC @@ -75,7 +75,7 @@ notation](http://en.wikipedia.org/wiki/ABC_notation). Try: -``` +``` cc -o endoh3 endoh3.c echo "CDEFGABc" | ./endoh3 > /dev/dsp ``` @@ -83,20 +83,20 @@ Try: If `/dev/dsp` is not available on your system, use an OSS sound wrapper such as `padsp` or `aoss`: -``` +``` echo "CDEFGABc" | ./endoh3 | padsp tee /dev/dsp > /dev/null ``` If you are using Mac OS X, try [sox](http://sox.sourceforge.net/) like so: -``` +``` echo "CDEFGABc" | ./endoh3 | sox -q -traw -r8000 -b8 -e unsigned-integer - -tcoreaudio ``` If that does not work, use the attached script to convert the output into a wave file format: -``` +``` echo "CDEFGABc" | ./endoh3 | ruby wavify.rb > cde.wav ``` @@ -107,7 +107,7 @@ You can also enjoy some music scores that I attached. With `/dev/dsp` you can do so like: -``` +``` cat twinkle.abc | ./endoh3 > /dev/dsp cat menuet.abc | ./endoh3 > /dev/dsp ``` @@ -185,7 +185,7 @@ You know, it is ["the famous song"](http://en.wikipedia.org/wiki/4%E2%80%B233%E2 Here is a magical expression which I found by brute-force: -``` +``` (c % 32 + 5) * 9 / 5 % 13 + n / 32 * 12 - 22 ``` @@ -228,7 +228,7 @@ frequency by multiplying the value by `n` times. Finally, the following code generates a saw wave: -``` +``` for(c = 0; c < len; c++) putchar(a = n * D); ``` diff --git a/2013/endoh4/README.md b/2013/endoh4/README.md index 926ebb01b..0e263a6c3 100644 --- a/2013/endoh4/README.md +++ b/2013/endoh4/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -8,7 +8,7 @@ If you wish to change the size (see the [Author's remarks](#authors-remarks) below) you can do so with the `SIZE` variable. For instance you can do: -``` +``` make clobber SIZE=50,50 all ``` @@ -29,7 +29,7 @@ For more detailed information see [2013 endoh4 bugs](../../bugs.html#2013_endoh4 ## To use: -``` +``` ./endoh4 < file ./endoh4.sh file ``` @@ -41,7 +41,7 @@ line it will feed to the program [endoh4.c](endoh4.c). ## Try: -``` +``` ./endoh4.sh cube.txt ``` @@ -51,13 +51,13 @@ The author recommends the use of xterm. For an example, if you are a football/soccer fan, try: -``` +``` ./endoh4.sh solids/archimedian-solid/a11-truncated-icosahedron.txt ``` You can provide more than one file: -``` +``` ./endoh4.sh solids/archimedian-solid/a11-truncated-icosahedron.txt cube.txt ``` @@ -66,7 +66,7 @@ Hit ctrl-c/intr to go to the next file. If you wish to change the size to `50,50` without passing any arg: -``` +``` SIZE=50,50 ./endoh4.sh ``` @@ -115,7 +115,7 @@ clang, and tcc. It should not trigger warnings with `-pedantic` and `-Wextra`. You may want to use `tput` to hide the terminal cursor. -``` +``` tput civis ./endoh4 < cube.txt tput cnorm @@ -123,7 +123,7 @@ You may want to use `tput` to hide the terminal cursor. or -``` +``` ./endoh4.sh cube.txt ``` @@ -131,14 +131,14 @@ or You can change the screen size. Let the aspect ratio be about 3:1. -``` +``` cc -DS=120,40 -o endoh4 endoh4.c ``` The shape of this code is the geometric net of a regular tetrahedron. So, try: -``` +``` ./endoh4 < endoh4.c # or ./endoh4.sh ``` diff --git a/2013/hou/README.md b/2013/hou/README.md index 47e9ad813..69fbeeb65 100644 --- a/2013/hou/README.md +++ b/2013/hou/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make all ``` @@ -18,7 +18,7 @@ For more detailed information see [2013 hou bugs](../../bugs.html#2013_hou). ## To use: -``` +``` ./hou [scene-file-name] [options] ``` @@ -29,7 +29,7 @@ effects should be more or less recognizable when you see 16. ## Try: -``` +``` ./try.sh ``` @@ -62,7 +62,7 @@ This program will loop infinitely while progressively refining a NOTE: the author refers to [a.c](a.c), placed in a gzipped file `a.c.gz`. We do not include it but it can be generated like: -``` +``` cc -Wall hou.c -o hou -lm ./hou > a.c ``` @@ -78,7 +78,7 @@ needing to create a temporary file. This program is a programmable rendering engine with a built-in default scene. The standard command line is: -``` +``` ./hou [scene-file-name] [options] ``` diff --git a/2013/mills/README.md b/2013/mills/README.md index 1ef786457..e5547c2da 100644 --- a/2013/mills/README.md +++ b/2013/mills/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2013 mills bugs](../../bugs.html#2013_mills). ## To use: -``` +``` ./mills ``` ## Try: -``` +``` ./mills & ``` @@ -61,7 +61,7 @@ while you are there, click on an ad. They could use the money. It would be possible to fix this by adding -``` +``` n=1,setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&n,sizeof n), ``` diff --git a/2013/misaka/README.md b/2013/misaka/README.md index 26db6c50d..e1f07e5b0 100644 --- a/2013/misaka/README.md +++ b/2013/misaka/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ information on all of these builds. ## To use: -``` +``` ./horizontal_cat [files...] > [output] ./vertical_cat [files...] > [output] ``` @@ -20,19 +20,19 @@ information on all of these builds. To understand the various intermediate source files that are built, try: -``` +``` make understanding ``` Also try: -``` +``` ./try.sh ``` NOTE: Use - for standard input. For example: -``` +``` ./vertical_cat - - ``` @@ -69,7 +69,7 @@ judging this entry. `Misaka` is a file concatenation utility, with at least two modes of operation: -``` +``` cc misaka.c -o horizontal_cat ./horizontal_cat [files...] > [output] @@ -94,7 +94,7 @@ files vertically. I thought the lack of horizontal concatenation must have been an oversight, so I implemented this utility: -``` +``` cc misaka.c -o horizontal_cat ./horizontal_cat files... ``` @@ -109,7 +109,7 @@ can specify `-` multiple times to get `stdin` multiplied horizontally. For example, if you have `seq(1)` in your shell, you can add line numbers to both sides of [misaka.c](misaka.c) like this: -``` +``` seq -f ' %.0f ' 45 | ./horizontal_cat - misaka.c - ``` @@ -126,7 +126,7 @@ files vertically, so I included a vertical mode. But supporting vertical mode with command line options would be no fun. Instead, vertical mode is enabled by concatenating the source code horizontally: -``` +``` ./horizontal_cat misaka.c misaka.c > misaka2.c gcc misaka2.c -o vertical_cat ./vertical_cat files... @@ -135,7 +135,7 @@ enabled by concatenating the source code horizontally: `vertical_cat` works more or less like `cat`, except you can use `vertical_cat` to duplicate `stdin`: -``` +``` ./vertical_cat - - ``` @@ -147,7 +147,7 @@ was just more [cats](https://rationalwiki.org/wiki/Fun:Cat). So I implemented one more mode, this one is enabled by concatenating [misaka.c](misaka.c) vertically: -``` +``` ./vertical_cat misaka.c misaka.c > misaka3.c gcc misaka3.c -o long_cat ./long_cat @@ -157,7 +157,7 @@ vertically: exponentially longer by concatenating more files vertically (up to 31 levels high, depending on `sizeof(int)` for your compiler): -``` +``` ./vertical_cat misaka.c misaka.c misaka.c > misaka4.c gcc misaka4.c -o loong_cat @@ -171,7 +171,7 @@ high, depending on `sizeof(int)` for your compiler): If your terminal has really thin fonts, you can also make this output fatter by concatenating files horizontally: -``` +``` ./vertical_cat misaka.c misaka.c | ./horizontal_cat - - > misaka7.c gcc misaka7.c -o long_fat_cat @@ -182,7 +182,7 @@ by concatenating files horizontally: Output width is determined by the first level of stacked programs, so a triangle like the following will not have horizontally expanded output: -``` +``` ./horizontal_cat misaka.c misaka.c | ./vertical_cat misaka.c - > misaka9.c gcc misaka9.c -o same_as_long_cat ``` @@ -192,7 +192,7 @@ together, you can feed the source to a [brainfuck](https://en.wikipedia.org/wiki/Brainfuck) interpreter to get an overview of how the programs are stacked. Example: -``` +``` perl bf.pl misaka9.c ``` diff --git a/2013/morgan1/README.md b/2013/morgan1/README.md index e47c4e898..e2790cb60 100644 --- a/2013/morgan1/README.md +++ b/2013/morgan1/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` echo "YYYY/MM/DD" | ./morgan1 ``` @@ -23,7 +23,7 @@ follows: ## Try: -``` +``` ./try.sh ``` diff --git a/2013/morgan2/README.md b/2013/morgan2/README.md index 71fde4f8f..51d786c7a 100644 --- a/2013/morgan2/README.md +++ b/2013/morgan2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -9,13 +9,13 @@ For the console version (ncurses): -``` +``` ./morgan2 ``` For the graphical version (X11): -``` +``` ./morgan2 X ``` diff --git a/2013/robison/README.md b/2013/robison/README.md index 64d09cef4..bf300e170 100644 --- a/2013/robison/README.md +++ b/2013/robison/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./robison # enter an expression @@ -17,7 +17,7 @@ ## Try: -``` +``` ./try.sh ``` diff --git a/2014/birken/README.md b/2014/birken/README.md index 0e877e99d..e99332a53 100644 --- a/2014/birken/README.md +++ b/2014/birken/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,7 +11,7 @@ there is a firewall issue, and also lets you redefine the timing constant, ## To use: -``` +``` ./prog < some_secret_or_something ./prog http://host[:port] @@ -20,19 +20,19 @@ there is a firewall issue, and also lets you redefine the timing constant, ## Try: -``` +``` ./prog < README.md ``` or maybe: -``` +``` echo "IOCCC 2014!" | ./prog ``` Next, try in another terminal, as the above one is running: -``` +``` ./prog http://127.0.0.1:1701 ``` @@ -55,13 +55,13 @@ described by the author. See [configuration](#configuration) below. To specify the port to say, 31337, try: -``` +``` make clobber PORT=31337 alt ``` To change the timing constant, `STARDATE`, try: -``` +``` make clobber TIME=5000000 alt ``` @@ -101,26 +101,26 @@ the server. ## To use web server -``` +``` ./prog < secret_file_to_be_downloaded ``` Try using the program's source code as the secret file: -``` +``` ./prog < prog.c ``` ## To use client-side downloader -``` +``` ./prog http://host[:port] ``` The optional port defaults to 1701. If the web server instance is started on the same box, try: -``` +``` ./prog http://127.0.0.1:1701 ``` @@ -246,7 +246,7 @@ numerical values. For space considerations, the following include statements were dropped resulting in compiler warnings: -``` +``` #include #include #include diff --git a/2014/deak/README.md b/2014/deak/README.md index d49f08cf3..f171d10fc 100644 --- a/2014/deak/README.md +++ b/2014/deak/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -12,14 +12,14 @@ code](#alternate-code) below. ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./prog ``` @@ -36,7 +36,7 @@ recognisable and also to let you reconfigure the coordinates. ### Alternate build: -``` +``` make alt ``` @@ -45,7 +45,7 @@ If you wish to redefine the coordinates you can do so by defining `X1`, `X2`, For instance: -``` +``` make clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt ``` @@ -59,7 +59,7 @@ Use `prog.alt` as you would `prog`. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -94,7 +94,7 @@ The usage of recognizable elements from the C programming language in the application source code is intentionally kept to a bare minimum. If this phrase would not be true, the application would be the following: -``` +``` double _[]={-2 ,1,-1.3 ,1.3, 0, 0,0,0 ,0 ,0,50, 80, 0,0,0 ,255 diff --git a/2014/endoh1/README.md b/2014/endoh1/README.md index d00af19ec..b5c226da3 100644 --- a/2014/endoh1/README.md +++ b/2014/endoh1/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog > foo.c ``` ## Try: -``` +``` ./try.sh ``` @@ -36,14 +36,14 @@ What is the difference between running `./prog` and `main`? Big terminals with tiny fonts have their uses in certain cases. One of them is: -``` +``` make treacl ./treacl ``` which is shorthand for: -``` +``` ./prog < prog.c > treacle.c make treacle ./treacle diff --git a/2014/endoh1/spoilers.md b/2014/endoh1/spoilers.md index 9b6a7c5e8..f5ff25b05 100644 --- a/2014/endoh1/spoilers.md +++ b/2014/endoh1/spoilers.md @@ -18,7 +18,7 @@ Do you think that it is possible to write QR code encoder in C within *1kB*? It is known that we can mitigate the quine restriction by `eval`. For example, this is a quine written in Ruby: -``` +``` eval s="print 'eval s='; p s" ``` @@ -122,7 +122,7 @@ The compiler tool chain is the following. You can run the process by `rake` command. `ruby-minisat` gem is needed. -``` +``` $ gem install ruby-minisat $ rake ``` @@ -145,7 +145,7 @@ but it appears to no longer exist. You can use [tool.rb](tool.rb) to convert the output to a png file. -``` +``` ./main Hello | ruby tool.rb > hello.png $ zbarimg -q hello.png diff --git a/2014/endoh2/README.md b/2014/endoh2/README.md index 09de3a71d..1b22f4872 100644 --- a/2014/endoh2/README.md +++ b/2014/endoh2/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog < input > output ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2014/maffiodo1/README.md b/2014/maffiodo1/README.md index 9318eca63..654e60f91 100644 --- a/2014/maffiodo1/README.md +++ b/2014/maffiodo1/README.md @@ -3,7 +3,7 @@ This entry requires SDL to be installed. See [FAQ 3.8](../../faq.html#SDL) if you don't know how to do this for your system. -``` +``` make ``` @@ -21,7 +21,7 @@ For more detailed information see [2014 maffiodo1 bugs](../../bugs.html#2014_maf ## To use: -``` +``` cat game.level | ./prog 320 200 800 300 128 144 game.rgba game.wav 10343679 ``` @@ -41,7 +41,7 @@ note on macOS. ## Try: -``` +``` ./giana.sh ./mario.sh @@ -61,7 +61,7 @@ try: If you wish to change the width and height, defaulting at 640 x 480, say to 800 x 800, try: -``` +``` ROWS=800 COLS=800 ./mario.sh ROWS=800 COLS=800 ./giana.sh @@ -92,14 +92,14 @@ immediately take effect. Use `tabsize=4` to see the magic. -``` +``` expand -t 4 prog.c ``` The program returns 0 if the player wins or *non-zero* if the player loses so you can test it and make something useful (or not), like this: -``` +``` cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet telehack.com 23 ``` @@ -228,7 +228,7 @@ You can input as many objects as you want but the maximum number of objects handled by the program is 333. You can modify this value by editing the source here: -``` +``` C[333*7],d=333; ``` diff --git a/2014/maffiodo2/README.md b/2014/maffiodo2/README.md index cd0256e5c..2686e0c3d 100644 --- a/2014/maffiodo2/README.md +++ b/2014/maffiodo2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,14 +21,14 @@ For more detailed information see [2014 maffiodo2 bugs](../../bugs.html#2014_maf ## To use: -``` +``` ./prog arg ``` ## Try: -``` +``` ./try.sh ``` @@ -41,14 +41,14 @@ as fun but it's 121 bytes instead of 140. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` cat image.rgb | ./prog.alt ``` @@ -91,7 +91,7 @@ The program will crash if run without parameters. If you have a terminal geometry than is different from the common 80x25 you can modify the *output width* by changing the value of the first variable: -``` +``` d=80, ``` @@ -99,14 +99,14 @@ modify the *output width* by changing the value of the first variable: Type this: -``` +``` cat image.rgb | ./prog " .:;Y0" ``` You can use your own image. Convert the image to a raw RGB image. Using ImageMagick it's very simple: -``` +``` convert -geometry 80x source.jpg image.rgb ``` @@ -116,7 +116,7 @@ program is the *conversion ramp*. You can use different ramps or create your own These are some ramps you can try: -``` +``` ./prog " :1" ./prog " .:;Y0" ./prog " .:-=+*#%@" @@ -127,7 +127,7 @@ These are some ramps you can try: An alternative version of this program is only 121bytes long: -``` +``` d=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}} ``` diff --git a/2014/morgan/README.md b/2014/morgan/README.md index 28dd3e03c..654d6a876 100644 --- a/2014/morgan/README.md +++ b/2014/morgan/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog [arg ..] ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2014/sinon/README.md b/2014/sinon/README.md index 21fca6b31..bcf7ab2f1 100644 --- a/2014/sinon/README.md +++ b/2014/sinon/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./hecate.sh ./glock.sh @@ -16,7 +16,7 @@ ## Try: -``` +``` ./try.sh ``` @@ -41,7 +41,7 @@ under one minute. To start, compile and run the program. To resume, compile and run the output repeatedly until you have won/lost the game. For example: -``` +``` cp prog.c run.c gcc -O0 run.c -o run && ./run | tee run.c gcc -O2 run.c -o run && ./run | tee run.c @@ -106,7 +106,7 @@ a primary input. that there are no files named "run" and "run.c" in current directory (they will be overwritten) and run: -``` +``` perl prog.c | bash ``` diff --git a/2014/skeggs/README.md b/2014/skeggs/README.md index 450b1f4d6..b3d42b4fe 100644 --- a/2014/skeggs/README.md +++ b/2014/skeggs/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` diff --git a/2014/vik/README.md b/2014/vik/README.md index 117183dd4..9e992304b 100644 --- a/2014/vik/README.md +++ b/2014/vik/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -22,7 +22,7 @@ For more detailed information see [2014 vik bugs](../../bugs.html#2014_vik). ## To use: -``` +``` echo foo | ./prog > audio_file.raw echo foo | ./prog | mplayer -demuxer rawaudio - @@ -31,7 +31,7 @@ For more detailed information see [2014 vik bugs](../../bugs.html#2014_vik). ## Try: -``` +``` ./try.sh ``` @@ -44,7 +44,7 @@ instructions on how to get it to work with Windows. ### Alternate build: -``` +``` make alt ``` @@ -59,13 +59,13 @@ Use `prog.alt` as you would `prog` above as well as below. This program sets a new tone for obfuscation. But do you understand what it says about obfuscation? Perhaps: -``` +``` ./prog < prog.c > prog.raw ``` might speak to your coding style? If not, then perhaps: -``` +``` ./prog < README.md | mplayer -demuxer rawaudio - ``` @@ -87,7 +87,7 @@ Don't forget the last '`-`' as it makes `mplayer(1)` read from `stdin`. ## Convert audio file with Morse signals to text -``` +``` ./prog e < audio_file.raw ``` @@ -106,7 +106,7 @@ Microsoft compilers add a carriage return to newlines, and to compile the program with this platform, the following line can be added to `main()` before any code in order for the program to run correctly: -``` +``` _setmode(_fileno(stdout), 0x8000); ``` diff --git a/2014/wiedijk/README.md b/2014/wiedijk/README.md index a5b70fe87..dd1163902 100644 --- a/2014/wiedijk/README.md +++ b/2014/wiedijk/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -22,7 +22,7 @@ By default that will use `indent(1)` found by the shell `type -P indent` and `sed(1)` found by the shell `type -P sed` but if you want to change these, say to try a different beautifier, you can do it like: -``` +``` INDENT=bcpp ./try.sh ``` diff --git a/2015/burton/README.md b/2015/burton/README.md index cb6fcc0bc..4cf96b2a3 100644 --- a/2015/burton/README.md +++ b/2015/burton/README.md @@ -1,19 +1,19 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog "expression" ``` or: -``` +``` ./prog ``` @@ -22,13 +22,13 @@ Type in expressions on standard input. ## Try: -``` +``` ./try.sh ``` Notice how the script reads in from a file. If you type just: -``` +``` ./prog ``` @@ -37,7 +37,7 @@ it will prompt you in the same way. Send ctrl-c to exit. Finally, if you wish to read the man page: -``` +``` man ./calc.1 ``` @@ -51,7 +51,7 @@ author's remarks below. ### Alternate build: -``` +``` make alt ``` @@ -109,7 +109,7 @@ Yes, this is another calculator program. However, unlike any other calculator source code the author is aware of, this one contains no digits. At all. Anywhere. As in -``` +``` grep '[0-9]' prog.c || echo no digits! ``` @@ -222,7 +222,7 @@ With `-Wall -std=c99`, both are quite noisy, and all can be ignored: If the program name begins with an `e`, it echoes `stdin` to `stdout`. This allows for a convenient test suite: -``` +``` ln -sf prog eprog PATH=. eprog < test.in | diff - test.out ``` diff --git a/2015/dogon/README.md b/2015/dogon/README.md index ceb901160..1015ef623 100644 --- a/2015/dogon/README.md +++ b/2015/dogon/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` To change the dimensions you can use the `WIDTH` and `HEIGHT` variables when compiling (default 1024 x 800): -``` +``` make clobber WIDTH=640 HEIGHT=480 ``` @@ -22,14 +22,14 @@ code](#alternate-code) below. ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./prog ``` @@ -77,7 +77,7 @@ This alt version does this for you. ### Alternate build: -``` +``` make alt ``` @@ -174,7 +174,7 @@ important support of up to 32 function keys keyboards without spilling over the size limit, and allows us to use such fun expression for arrow view control as the following: -``` +``` *(a&1?&C:&B)-=(.05 -a/2%2*.1)*!(a-1&4092^3920) ``` diff --git a/2015/duble/README.md b/2015/duble/README.md index a66439c62..8575428de 100644 --- a/2015/duble/README.md +++ b/2015/duble/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ See [Alternate code](#alternate-code) below. ## To use: -``` +``` echo Some text | ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -34,7 +34,7 @@ author in the '[prog.c](prog.c) vs [prog.alt.c](prog.alt.c)' section of their re ### Alternate build: -``` +``` make alt ``` @@ -84,13 +84,13 @@ been shortened in this file. If you have `clang`: -``` +``` CC=clang make -e ``` Otherwise (gcc): -``` +``` make ``` @@ -116,7 +116,7 @@ needed in this case). #### Basic mode: -``` +``` $ echo 'I am testing this thing.' | ./prog [... rendering ...] @@ -127,7 +127,7 @@ needed in this case). #### Interactive mode: -``` +``` $ ./prog > hello world!!! [... rendering ...] @@ -206,7 +206,7 @@ simple text documents. Thus, if you try for example: -``` +``` $ ./prog < prog.c ``` @@ -219,7 +219,7 @@ you are curious. :) Defining an environment variable called `DRAFT` will enable the 'draft-mode'. Try for example: -``` +``` $ echo 'testing the draft mode' | DRAFT=1 ./prog ``` diff --git a/2015/endoh1/README.md b/2015/endoh1/README.md index 1d3fe2ed1..29bba5e68 100644 --- a/2015/endoh1/README.md +++ b/2015/endoh1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,7 +11,7 @@ require it](../../faq.html#tcpserver). ## To use: -``` +``` tcpserver -v 127.0.0.1 10333 ./prog ioccc.txt ``` @@ -44,7 +44,7 @@ his work. Compile the program as follows: -``` +``` cc -O3 -std=c99 \ -Wall -Wextra -pedantic -o prog prog.c \ -Delta_u="Du*laplacian(u)-u*v*v+F*(1-u)" \ @@ -59,7 +59,7 @@ Then, run it with the `tcpserver` command in the [Daniel J. Bernstein](../../authors.html#Daniel_J_Bernstein)'s [1991/brndstd](../../1991/brnstnd/index.html) "Best of Show". -``` +``` tcpserver -v 127.0.0.1 10333 ./prog ioccc.txt ``` diff --git a/2015/endoh2/README.md b/2015/endoh2/README.md index 4c03bea91..f87e5fda1 100644 --- a/2015/endoh2/README.md +++ b/2015/endoh2/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -31,7 +31,7 @@ At this point you might be wondering, [WTF](http://acronyms.thefreedictionary.co How is this code obfuscated? Well look again: -``` +``` less prog.c more prog.c @@ -49,7 +49,7 @@ If you are still puzzled, look at [prog.c](prog.c) with your favorite text edito **Follow these instructions literally!** -``` +``` cat prog.c gcc -w -o prog prog.c ./prog diff --git a/2015/endoh3/README.md b/2015/endoh3/README.md index 6fe56a12b..b8b26149d 100644 --- a/2015/endoh3/README.md +++ b/2015/endoh3/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` @@ -16,7 +16,7 @@ To see the original [mullender](mullender.c) in action: -``` +``` ./try.sh ``` @@ -26,7 +26,7 @@ like at the end. Send INTR to end the program. More generally use: -``` +``` cc -o prog prog.c foo.c ./prog ^C # if necessary, where ^C is ctrl-C, interrrupt @@ -71,7 +71,7 @@ Read it upside down.) You got it? This program is supposed to be used in this way: -``` +``` wget https://www.ioccc.org/1984/mullender.c clang -o prog prog.c mullender.c ./prog diff --git a/2015/endoh4/README.md b/2015/endoh4/README.md index f5fedc363..baa90edd2 100644 --- a/2015/endoh4/README.md +++ b/2015/endoh4/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,14 +11,14 @@ code](#alternate-code) below for details. ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -32,7 +32,7 @@ Dogon](../../authors.html#Gil_Dogon); it is the author's original entry. ### Alternate build: -``` +``` make alt ``` @@ -54,7 +54,7 @@ experiment with numbers that have more or larger factors? Visual factorization 1-liner. Try: -``` +``` gcc -o prog prog.c ./prog @ ./prog @ @ diff --git a/2015/hou/README.md b/2015/hou/README.md index 6690ff7d4..3cd2bb6f8 100644 --- a/2015/hou/README.md +++ b/2015/hou/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2015 hou bugs](../../bugs.html#2015_hou). ## To use: -``` +``` echo something | ./prog ./prog < file ``` @@ -26,7 +26,7 @@ For more detailed information see [2015 hou bugs](../../bugs.html#2015_hou). ## Try: -``` +``` ./try.sh ``` @@ -42,7 +42,7 @@ the reference code! Some things that make you go, "huh?" -``` +``` ./prog < prog.c | cut -c-5 ./prog < Makefile | cut -c-4 ``` @@ -51,7 +51,7 @@ How are those values magically returned? What happens with a large file? Something over 256K. -``` +``` ./prog < large_file ``` diff --git a/2015/howe/README.md b/2015/howe/README.md index 4d741f51b..76399316d 100644 --- a/2015/howe/README.md +++ b/2015/howe/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ below. ## To use: -``` +``` ./prog file1 file2 ./prog -d file1 file2 @@ -19,7 +19,7 @@ below. ## Try: -``` +``` ./try.sh ``` @@ -32,7 +32,7 @@ entry but was changed to be the alt version. ### Alternate build: -``` +``` make alt ``` diff --git a/2015/mills1/README.md b/2015/mills1/README.md index bdfd62035..a2be6e599 100644 --- a/2015/mills1/README.md +++ b/2015/mills1/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./prog ``` @@ -27,13 +27,13 @@ Did you find that mobile application game a bit frustrating? Well you can adjust the Makefile parameters to make life a bit easier for you: -``` +``` ./try.sh ``` which runs: -``` +``` make clobber all DW=199999 DW=22 DH=16 DA=50 DI=-150 ./prog ``` @@ -147,13 +147,13 @@ to make some changes to the `Makefile` to get emojis to work on your system. To help you get started, I've included some example substitutions for emojis sprites and instruction text; for example, type -``` +``` make EMOJI=beer LANGUAGE=spanish ``` or -``` +``` make EMOJI=globe ``` diff --git a/2015/mills2/README.md b/2015/mills2/README.md index 0151a9a8c..c5b11a858 100644 --- a/2015/mills2/README.md +++ b/2015/mills2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2015 mills2 bugs](../../bugs.html#2015_mills2 ## To use: -``` +``` ./prog compressed_file.Z ``` ## Try: -``` +``` ./try.sh ``` @@ -39,7 +39,7 @@ for a `compress(1)`-like compressor using a similar idea. Why is the sad smiley on line 12 in that particular place? -``` +``` c=0) :( O ``` @@ -66,7 +66,7 @@ on the command line. On the odd chance you don't have `compress(1)` hanging abo on your system, I've provided compressed copies of this year's IOCCC rules and guidelines files. To print them, just do -``` +``` ./prog ioccc_guidelines.txt.Z ./prog ioccc_rules.txt.Z ``` diff --git a/2015/muth/README.md b/2015/muth/README.md index 2f325f02b..d644c4fda 100644 --- a/2015/muth/README.md +++ b/2015/muth/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` make -B [MACHINE=your_machine.h] [TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] run ``` ## Try: -``` +``` ./try.sh ``` @@ -68,13 +68,13 @@ files for examples. Every symbol used (except `_`) must be explicitly declared using -``` +``` #define sym_SYMBOL(sym, _SYMBOL) sym ``` Example: -``` +``` #define sym_1(sym, _1) sym ``` @@ -84,7 +84,7 @@ Example: The initial content of the tape must be defined in the tape header using a triple like: -``` +``` #define tape ((((,),...l2), l1), c, (r1, (r2..., (,)))) ``` @@ -119,7 +119,7 @@ machine. To halt the machine, use the keyword `break` as in -``` +``` #define A_1 (2, break) ``` diff --git a/2015/schweikhardt/README.md b/2015/schweikhardt/README.md index 1349e84e6..2d9baf049 100644 --- a/2015/schweikhardt/README.md +++ b/2015/schweikhardt/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2015 schweikhardt bugs](../../bugs.html#2015_ ## To use: -``` +``` ./prog n ``` @@ -30,7 +30,7 @@ doing something else. The author explains this in more details. ## Try: -``` +``` ./try.sh ``` @@ -44,7 +44,7 @@ where zeroes move to the right. This code is clean. When you compile with all warnings enabled, such as with clang: -``` +``` cc -Weverything -pedantic -std=c11 -Dtyp=uint64\_t -O3 prog.c -o prog ``` @@ -73,7 +73,7 @@ the [Collatz conjecture](https://en.wikipedia.org/wiki/Collatz_conjecture). You may explore this famous conjecture using this entry: -``` +``` ./prog 2410 ./prog abfff ./prog 27f8cebf @@ -158,7 +158,7 @@ prefix) as the first argument. The program prints the given number in zero-padded hex and each iteration along with a line count in decimal. The example above looks like this (compiled with 64 bit word size): -``` +``` $ ./prog 6 0000000000000006 0000000000000003 1 @@ -175,7 +175,7 @@ The size of `n` is only limited by the argument size limit of your shell/OS (the program implements arbitrary size `bignum`s). To query this on your POSIX system, run -``` +``` $ getconf ARG_MAX 262144 ``` @@ -187,7 +187,7 @@ Fear not, [bc(1)](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html) to the rescue: -``` +``` $ printf 'obase=16;10^100\n' | bc 1249AD2594C37CEB0B2784C4CE0BF38ACE408E211A7CAAB24308A82E8F1000000000\ 0000000000000000 @@ -333,7 +333,7 @@ hard, I could use `__LINE__` and `stdio.h` macros `EOF`, `L_tmpnam`, Another identity operation. I've done it for you already. Use this `.indent.pro` with FreeBSD indent: -``` +``` $ cat .indent.pro -bad /* blank line after decls */ -bap /* blank line after functions */ @@ -383,7 +383,7 @@ Spoilers ahead. Duh! Pseudocode, with comments matching those in the C source: -``` +``` /* run */ if (non-NULL and nonempty argv[1]) { n = convert(argv[1]) @@ -404,7 +404,7 @@ Pseudocode, with comments matching those in the C source: `Bignum`s are represented as the two member `struct`s: -``` +``` typedef struct { size_t places; /* number of places in base 2 to the power of (8*sizeof(type)) */ type *number; /* dynamically allocated memory for number */ @@ -438,7 +438,7 @@ into a starting number (which is output as the first line), and starts crunching. Nothing stops you from executing -``` +``` ./prog "$(cat prog.c)" # Kind of quine? ./prog "$(cat rules guidelines)" # A jackpot? Maybe next year... ./prog "$(cat /bin/ls)" # Number cut short at first NUL byte. @@ -473,7 +473,7 @@ The open source static checker [cppcheck](http://cppcheck.sourceforge.net/) checks various problems with respect to style, performance, portability and general fishiness. To enable all checks, run -``` +``` cppcheck --enable=all --force -I/usr/include -Dtyp=uint32_t prog.c ``` @@ -486,7 +486,7 @@ checks various problems with respect to security like buffer overflows, function arguments to known troublemaker functions and more. It doesn't need to pre-process code, so can be run without the `typ` macro being defined: -``` +``` $ flawfinder prog.c Flawfinder version 1.31, (C) 2001-2014 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 169 @@ -592,7 +592,7 @@ use for checking your C programs and I highly recommend trying it. For a start, paste the well know first program in the form and press "Analyze Code". Note the FlexeLint configuration options in comments (no space between `/*` and `lint`). -``` +``` /*lint -w4 turn on everything */ /*lint +esym(534,*) no demonstrator defaults */ /*lint -e966 indirectly included header file not used */ @@ -705,7 +705,7 @@ expressions other than assignments to `char` objects. A consequence is that printing digits with `'0' + digit` is not allowed (even though `'0'` is technically an `int`!) so I am forced to output hex digits with -``` +``` printf("%c", (met)tyr + 32 + 16 + ((8 + EOF) * ((met)tyr / (8 + 2)))); ``` @@ -730,7 +730,7 @@ precedence rules in expressions." This requires parentheses for almost all expressions involving more than one operator, especially those for which a cast is required, leading to hard to understand expressions such as -``` +``` const ser glx = (ser)((asx > (ser)64u) ? (ser)((ser)asx + (ser)8u + (ser)1u) : (ser)asx); not.not[leu] = (and)((and)not.not[leu] | (and)(((and)glx % (and)16u) << (and)lys)); ``` @@ -747,7 +747,7 @@ MISRA 16.10: "If a function returns error information, then that error information shall be tested." A cast to `void` would draw a lint warning, so I use the `printf(3)` result in expressions, -``` +``` lys -= 4 * printf("%c", (met)tyr + 32 + 16 + ((8 + EOF) * ((met)tyr / (8 + 2)))); val += printf("\n") / ((__LINE__ * L_tmpnam) + TMP_MAX); val -= (printf(" %d\n", val) > BUFSIZ) ? FILENAME_MAX : EOF; @@ -755,7 +755,7 @@ I use the `printf(3)` result in expressions, which are, in the absence of errors, equivalent to -``` +``` lys -= 4; /*nop*/ ++val; @@ -772,7 +772,7 @@ declared as pointer to `const` if the pointer is not used to modify the addressed object." in conjunction with lint's "Note 952: Parameter could be declared `const`" causes `const`-poisoning for all functions, -``` +``` static void phe(const ala not); static void gly(ala *const not, const and his); met main(met val, const pro *const his[]); @@ -792,13 +792,13 @@ up :-) (humor really helps!)" If your compiler supports a 128 bit wide type (e.g. clang, gcc) then you can use it via the `typ` macro: -``` +``` clang -Dtyp=__uint128_t -o prog prog.c ``` Indeed, the program can use (and lints clean for) all of -``` +``` clang -Dtyp=uint8_t -o prog8 prog.c clang -Dtyp=uint16_t -o prog16 prog.c clang -Dtyp=uint32_t -o prog32 prog.c diff --git a/2015/yang/README.md b/2015/yang/README.md index 304af9a2c..0e2ebe181 100644 --- a/2015/yang/README.md +++ b/2015/yang/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` echo Some text | ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -37,7 +37,7 @@ so you need not worry about this. `Fuuko` is a [sea star](https://en.wikipedia.org/wiki/Starfish) generator. Feed her some input through `stdin` to get lots of sea star patterns on `stdout`. -``` +``` cc -O3 -std=c90 fuuko.c -lm -o fuuko_c90 echo IOCCC | ./fuuko_c90 > output_c90.c ``` @@ -45,7 +45,7 @@ her some input through `stdin` to get lots of sea star patterns on `stdout`. If you compile with a C99 compiler instead of C90, the sea stars will have eyes. -``` +``` cc -O3 -std=c99 fuuko.c -lm -o fuuko_c99 echo IOCCC | ./fuuko_c99 > output_c99.c ``` @@ -53,7 +53,7 @@ have eyes. Don't like [sea stars](https://en.wikipedia.org/wiki/Starfish)? Use a C++98 compiler to get a [dango](https://en.wikipedia.org/wiki/Dango) instead. -``` +``` g++ -O3 -std=c++98 fuuko.c -lm -o fuuko_cpp98 echo IOCCC | ./fuuko_cpp98 > output_cpp98.c ``` @@ -63,7 +63,7 @@ compiler to get just [circles](https://en.wikipedia.org/wiki/Circle) (or [Swiss cheese](https://en.wikipedia.org/wiki/Swiss_cheeses_and_dairy_products), if you prefer that). -``` +``` g++ -O3 -std=c++11 fuuko.c -lm -o fuuko_cpp11 echo IOCCC | ./fuuko_cpp11 > output_cpp11.c ``` @@ -71,7 +71,7 @@ prefer that). Don't like any of these patterns? Use a C11 compiler and there will be no extra pattern. -``` +``` cc -O3 -std=c11 fuuko.c -lm -o fuuko_c11 echo IOCCC | ./fuuko_c11 > output_c11.c ``` diff --git a/2018/algmyr/README.md b/2018/algmyr/README.md index 290432773..d224e50ce 100644 --- a/2018/algmyr/README.md +++ b/2018/algmyr/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -22,7 +22,7 @@ For more detailed information see [2018 algmyr bugs](../../bugs.html#2018_algmyr ## To use: -``` +``` ./prog < prog.c # Print garbage: might mess up your terminal ./prog > out.raw ./prog -d 2 0 out.raw # Decode the first (0th) channel out of two @@ -31,7 +31,7 @@ For more detailed information see [2018 algmyr bugs](../../bugs.html#2018_algmyr ## Try: -``` +``` ./try.sh ``` @@ -164,13 +164,13 @@ standards compliant). This is used to print the usage instructions. Compiling using -``` +``` gcc -Wall -Wextra -pedantic ``` gives only `-Wmisleading-indentation` which is sensible considering the source code. While -``` +``` clang -Wall -Wextra -pedantic ``` @@ -179,7 +179,7 @@ bodies), `-Wstring-plus-int` (since apparently some people think string+`int` is concatenation) and one of the weirder warnings I have seen from me splitting a negative constant with whitespace. Compiling using -``` +``` clang -Wall -Wextra -pedantic -Weverything ``` diff --git a/2018/anderson/README.md b/2018/anderson/README.md index 313369022..a9a8cefe3 100644 --- a/2018/anderson/README.md +++ b/2018/anderson/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ code](#alternate-code) below for more details. ## To use: -``` +``` ./prog < textfile ``` ## Try: -``` +``` ./try.sh ``` @@ -31,7 +31,7 @@ it was not the shape of the Roman V that we, or the compiler, didn't like. ### Alternate build: -``` +``` make alt ``` @@ -43,7 +43,7 @@ Use `prog.alt` as you would `prog` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -58,7 +58,7 @@ down](http://en.wikipedia.org/wiki/River_%28typography%29)! ### Compiling the program: -``` +``` cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog ``` diff --git a/2018/bellard/README.md b/2018/bellard/README.md index f2edcdcfd..ab9eae83c 100644 --- a/2018/bellard/README.md +++ b/2018/bellard/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ code](#alternate-code) below. ## To use: -``` +``` ./prog > lena.ppm ``` @@ -21,7 +21,7 @@ First open [Lenna.png](Lenna.png) in your graphics viewer of choice. Next, after running the above command (`./prog > lena.ppm`), open `lena.ppm` in your graphics viewer of choice. After that try: -``` +``` ./try.sh ``` @@ -44,7 +44,7 @@ for Windows. ### Alternate build: -``` +``` make alt ``` @@ -99,7 +99,7 @@ Although the program was optimized to decompress its built-in image, it accepts to decompress image files from its standard input. Examples: -``` +``` ./prog d < lena512.bin > lena512.ppm ./prog d < fruits.bin > fruits.ppm ./prog d < vintage_cars.bin > vintage_cars.ppm diff --git a/2018/burton1/README.md b/2018/burton1/README.md index e947c8bb6..1a425fdee 100644 --- a/2018/burton1/README.md +++ b/2018/burton1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ code](#alternate-code) below. ## To use: -``` +``` ./prog < any-file ``` ## Try: -``` +``` ./try.sh ``` @@ -32,7 +32,7 @@ with `-Wno-` options. ### Alternate build: -``` +``` make alt ``` @@ -82,7 +82,7 @@ and without bypassing the solution using `execve(2)`, or functions built upon it E.g: -``` +``` main(){system("hd");} // it's turtles all the way down! ``` @@ -96,7 +96,7 @@ This solution is pleasing, but a true one-liner was the hoped-for goal. Here is the 157 character version in it's entirety: -``` +``` char O,o[ 20];L(O){ putchar ( O+ 48+39 *(9< O));} I(O) {L(~ 15); @@ -115,7 +115,7 @@ The progression to the present size is interesting, and it is interesting that the same algorithm can be expressed so differently by slight rearrangement of its parts. -``` +``` // 119 char O,o[20];main(l){for(;~(l=getchar());O||puts(o))o[O++]=isprint(l)?l:46,O&=15,printf("%02x ",l);O[o]=0;O&&puts(o);} // 116 @@ -139,7 +139,7 @@ These do not compete in the same category, since their output is materially diff They are derived from the solutions above, but are still fascinating as concise utilities, so here is their progression, for the curious: -``` +``` // 102 I;O(O){putchar(O+48+39*(9>4),O(l&15);O(-38);} // 80 @@ -156,7 +156,7 @@ It is possible to reduce the size of each of these by one by eliding the trailin This was not reported above since the newline kept getting appended by processing software, and it is more interesting to remove characters by changing code than by filtering: -``` +``` $ tr -d '\012' < 109.c | wc -c 108 $ tr -d '\012' < 76.c | wc -c @@ -257,13 +257,13 @@ the expression within the ternary remains too complex. Try: -``` +``` cat prog.c prog.alt.c ``` or -``` +``` cmp -b prog.c prog.alt.c ``` diff --git a/2018/burton2/README.md b/2018/burton2/README.md index 0c48ad63a..1e6c5cc2d 100644 --- a/2018/burton2/README.md +++ b/2018/burton2/README.md @@ -1,26 +1,26 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog [-tcksri] < file.c ``` ## Try: -``` +``` ./try.sh ``` If you get really stuck, try: -``` +``` man ./tac.1 ``` @@ -113,7 +113,7 @@ There is one (known) remaining problem with detection: * Comments between preprocessor hash and keyword are not replaced with whitespace; the following counts #include as two tokens, `#` and `include` (not as a reserved word): -``` +``` #/*this will not be counted*/include/*correctly*/ ``` @@ -128,14 +128,14 @@ counting words correctly absent `-k`. `tac` was run over all 366 previous IOCCC winning entries: -``` +``` find ~/src/obc -type f -name \*.c | wc ``` The discrepancies found are documented and explained in the file [discrepancies.html](discrepancies.html). -``` +``` find ~/src/obc -type f -a -name "*.c" | xargs ./spotcheck.sh ./prog | ./spotdiff.sh | grep -v keep | diff -bw - discrep* | grep "[<>] cl " ``` @@ -181,14 +181,14 @@ For instance, here is a simple token counter, useful in finding repeated long to frequency, or counting the references to identifiers, constants, or breadth of use of the language: -``` +``` #!/usr/bin/env bash cat $* | ./prog -t | sort | uniq -c | sort -k1nr ``` And here is a C keyword frequency counter: -``` +``` #!/usr/bin/env bash function iskeyword { awk 'BEGIN{f="c11";while(getline +``` #!/usr/bin/env bash script=' BEGIN { @@ -342,7 +342,7 @@ which is neither complete (`#define`, `#ifndef`, `#undef` are missing -- yes, Virginia knows about `#define` omitted on purpose), nor correct (many more are added: `I`, `true`, `bool`, `compl`, ...): -``` +``` (sed -n '1p' c11; sed -n '2,$p' ioccc.kw.freq | sort) | comm -3 - c11 ``` @@ -383,7 +383,7 @@ NB: This is *not* a portability concern, the one string holds only printable ASC Thus: -``` +``` cc -ansi -Wall -trigraphs -Wno-trigraphs -Wno-parentheses -Wno-empty-body -Wno-char-subscripts -Wno-pointer-sign -DU=O -DW=\"keywords\" -o prog prog.c ``` @@ -403,7 +403,7 @@ are not recognised when written as `-rs` in prose). Try: -``` +``` ./manpage.sh tac ./manpage.sh -h diff --git a/2018/ciura/README.md b/2018/ciura/README.md index 34b6a8780..1d10eef2d 100644 --- a/2018/ciura/README.md +++ b/2018/ciura/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,14 +11,14 @@ below for more details. ## To use: -``` +``` ./prog < text ``` ## Try: -``` +``` ./try.sh ``` @@ -32,7 +32,7 @@ useful bug fix. ### Alternate build: -``` +``` make alt ``` @@ -44,7 +44,7 @@ Use `prog.alt` as you would `prog` above. ### Alternate try: -``` +``` ./try.alt.sh ``` diff --git a/2018/endoh1/README.md b/2018/endoh1/README.md index 35ac6dd74..1d1cc8e99 100644 --- a/2018/endoh1/README.md +++ b/2018/endoh1/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog < textfile > output.gif ``` @@ -16,7 +16,7 @@ To see the input files and feed them to the program, redirecting to GIF files: -``` +``` ./try.sh ``` @@ -40,7 +40,7 @@ least 2MiB of memory to run in. This program generates an animated GIF from a plain text. Run: -``` +``` cc -o prog prog.c ./prog < invisible.txt > invisible.gif ``` @@ -51,14 +51,14 @@ letters that leave the mark and ones that do not? Other examples: -``` +``` ./prog < golem.txt > golem.gif ./prog < smily.txt > smily.gif ``` The program itself has a hidden message. -``` +``` ./prog < prog.c > prog.gif ``` diff --git a/2018/endoh2/README.md b/2018/endoh2/README.md index 6c0e827bd..886940556 100644 --- a/2018/endoh2/README.md +++ b/2018/endoh2/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2018/ferguson/README.md b/2018/ferguson/README.md index b2ff88d50..9d4a1c3a5 100644 --- a/2018/ferguson/README.md +++ b/2018/ferguson/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ monkey Eric. See [Alternate code](#alternate-code) below. ## To use: -``` +``` ./weasel ``` ## Try: -``` +``` ./try.sh # For those who believe in '"intelligent" design' or want to see how easy it is @@ -47,7 +47,7 @@ about this under the [keyboards](#keyboards) section, briefly referred to in the ### Alternate build: -``` +``` make alt ``` @@ -59,7 +59,7 @@ Use `weasel.alt` as you would `weasel` above. ### Alternate try: -``` +``` ./try.alt.sh # For those who believe in '"intelligent" design' or want to see how easy it is @@ -80,7 +80,7 @@ detail in the [S, M and N Constants](#constants) section. The script above will make use of some of these. -``` +``` ./try.alt.sh ``` @@ -107,7 +107,7 @@ while using more Cenozoic minded code migration, read [rpm.html](rpm.html). If you find yourself in an evolutionary dead end, try: -``` +``` man ./weasel.1 ``` @@ -139,7 +139,7 @@ texts. To resolve this I think the best way is referencing the judges' remarks: if you want a quick rundown of the entry try what they suggest and view the man page (it explains all the options and describes the program briefly): -``` +``` man ./weasel.man ``` @@ -444,7 +444,7 @@ has more than one word (that is it contains spaces) or anything else interpreted specially by your shell e.g. parentheses. For instance if you just want to find `METHINKS` you could do one of: -``` +``` ./weasel METHINKS ./weasel "METHINKS" ./weasel 'METHINKS' @@ -452,14 +452,14 @@ specially by your shell e.g. parentheses. For instance if you just want to find If you wanted `YOU ARE A MONKEY`: -``` +``` ./weasel "YOU ARE A MONKEY" ./weasel 'YOU ARE A MONKEY' ``` If you do one of: -``` +``` ./weasel "METHINKS IT IS A" "MONKEY" ./weasel METHINKS IT IS A MONKEY ``` @@ -472,7 +472,7 @@ If you actually do want to search for a string starting with a `-` you must disable further parsing of options by using the `-` option itself; for example if you were to do any of: -``` +``` ./weasel -q- -- -test ./weasel -q- -test ./weasel -q -- -test @@ -480,7 +480,7 @@ example if you were to do any of: The target string will be: `-TEST`. This means though that here: -``` +``` ./weasel -q -- -test -r5 ``` @@ -498,7 +498,7 @@ are equivalent: As for the caveat I referenced what does the following do? -``` +``` ./weasel -qr 5 ``` @@ -510,7 +510,7 @@ note on the parsing of the `-` option; if the program is currently parsing the other options are in the command line it might still parse the options. Thus you have: -``` +``` $ ./weasel -qr-r5 quiet output mutation rate out of range @@ -522,14 +522,14 @@ you have: Similarly this would set quiet output, then an invalid mutation rate and then a mutation rate of 5: -``` +``` ./weasel --qrr5 ``` If you were instead to do one of (for example): -``` +``` ./weasel -q -- -r ./weasel -q -q- -r ``` @@ -568,7 +568,7 @@ requested? There are at least two ways to go about it: I took the monkey safe ('fool safe') method; *if you explicitly request monkey mode you cannot disable it in the same invocation of `weasel`! -``` +``` $ ./weasel -qr101r5r101r1r test quiet output mutation rate out of range @@ -633,7 +633,7 @@ in monkey mode. Another example: -``` +``` $ ./weasel -q -r101 test -r5 quiet output mutation rate out of range @@ -649,7 +649,7 @@ which means that it'll use the genetic algorithm. One more example of monkey mode: -``` +``` $ ./weasel -q -mr101 test -r5 quiet output mutation rate out of range @@ -771,13 +771,13 @@ with. Try: -``` +``` make test ``` This will essentially make sure the program is compiled and then do: -``` +``` chmod +x test.sh ./test.sh ``` @@ -793,7 +793,7 @@ processed). You can pass additional options directly to the script but remember that it stops when there are no more strings in the file - so if you try: -``` +``` ./test.sh -q test ``` @@ -825,7 +825,7 @@ program prints an error message and then exits (returning 1). But since the keyboard doesn't have `'\n'` if you were to type a `'` and send a `'\n'` before the closing `'` you might see something like: -``` +``` $ ./weasel '!! > ' @@ -858,7 +858,7 @@ as well as some C keywords. 2. The way `main()` is declared is: -``` +``` /* Special C main() handler (encapsulation): */ #define r(main) main r(k main(k a, E **V)) { @@ -952,7 +952,7 @@ somewhere!). The Makefile simplifies how to reconfigure this value with the variable `MAX_SIZE`: -``` +``` make clobber MAX_SIZE=55 all ``` @@ -965,7 +965,7 @@ number attempts without waiting for a very long time. The Makefile simplifies how to reconfigure this value with the variable `MAX_ATTEMPTS`: -``` +``` make clobber MAX_ATTEMPTS=100 all ``` @@ -982,7 +982,7 @@ and the larger the values the more memory it'll require. The Makefile simplifies how to reconfigure this value with the variable `OFFSPRING`: -``` +``` make clobber OFFSPRING=55 all ``` @@ -993,7 +993,7 @@ Skip to [Portability](#portability). The following options **must always be passed to the compiler:** -``` +``` -DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)' ``` @@ -1003,13 +1003,13 @@ which running `make` will always do. If you want to increase the number of offspring to `50` (`N`) and the size of the chromosome to `75` (`S`) you would do: -``` +``` make clobber OFFSPRING=50 MAX_SIZE=75 everything ``` If you wanted to change `N` to `3`: -``` +``` make clobber OFFSPRING=3 everything ``` @@ -1020,7 +1020,7 @@ result. Remember too that `S` (`MAX_SIZE`) cannot be less than `38`. Both `S` an If you wanted to change the maximum number attempts to 100 you could do: -``` +``` make clobber MAX_ATTEMPTS=100 everything ``` @@ -1038,7 +1038,7 @@ Originally I tested it on the below systems. #### Fedora 26: -``` +``` $ clang --version|head -n1 clang version 4.0.1 (tags/RELEASE_401/final) $ gcc --version|head -n1 @@ -1051,7 +1051,7 @@ Originally I tested it on the below systems. #### CentOS Linux release 7.4.1708 (Core) -``` +``` $ clang --version|head -n1 clang version 3.4.2 (tags/RELEASE_34/dot2-final) $ gcc --version|head -n1 @@ -1064,7 +1064,7 @@ Originally I tested it on the below systems. #### Fedora 27: -``` +``` $ clang --version|head -n1 clang version 5.0.1 (tags/RELEASE_501/final) $ gcc --version|head -n1 @@ -1080,7 +1080,7 @@ Originally I tested it on the below systems. System Version: macOS 10.13.4 (17E199) Kernel Version: Darwin 17.5.0 -``` +``` $ gcc -v Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 9.1.0 (clang-902.0.39.1) @@ -1209,7 +1209,7 @@ When we found others were actually trying to programs with A, we quickly added additional cryptic features and evolved into B, BCPL, and finally C. We stopped when we got a clean compile on the following syntax: -``` +``` for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/ 8)%2))P("|"+(*u/4)%2); ``` @@ -1252,7 +1252,7 @@ is a lack of common sense but since he was part of its creation I don't think it's a bad thing; **on the contrary it makes all of us C programmers even more talented! :)** I do wonder if he tested that bit of C code though: -``` +``` for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/ 8)%2))P("|"+(*u/4)%2); ``` diff --git a/2018/giles/README.md b/2018/giles/README.md index 7c76d3247..ea584d2a0 100644 --- a/2018/giles/README.md +++ b/2018/giles/README.md @@ -4,21 +4,21 @@ This entry requires SDL2 to be installed. See [FAQ 3.8: How do I compile an IOCCC entry that requires SDL1 or SDL2?](../../faq.html#SDL) if you don't have it installed and don't know how to do so. -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./prog ioccc.txt ./prog prog.c diff --git a/2018/hou/README.md b/2018/hou/README.md index b72aae28a..d9598730f 100644 --- a/2018/hou/README.md +++ b/2018/hou/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2018 hou bugs](../../bugs.html#2018_hou). ## To use: -``` +``` ./prog < input.json > output.html ``` @@ -27,7 +27,7 @@ View `output.html` in a browser. ## Try: -``` +``` ./try.sh ``` diff --git a/2018/mills/README.md b/2018/mills/README.md index 4719ee36b..ff7cb4700 100644 --- a/2018/mills/README.md +++ b/2018/mills/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -8,7 +8,7 @@ If you wish to save state so that you can run the program and keep files changed (for instance you don't want to compile `mullender.c` again) you can compile it like: -``` +``` make clobber SAVE=1 all ``` @@ -31,14 +31,14 @@ For more detailed information see [2018 mills bugs](../../bugs.html#2018_mills). ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./prog ``` @@ -47,7 +47,7 @@ At the `>boot` prompt, type return. At the `:` prompt, type `rk(0,0)rkunix` and wait for it to initialise itself. Now try typing: -``` +``` cat > prog.c main(){ printf("Hello, world!\n"); } ^D @@ -59,7 +59,7 @@ where `^D` is EOF. Next try: -``` +``` cc mullender.c a.out ``` @@ -81,7 +81,7 @@ Do small machines only need small programs? This program weighs in at just This program can take you back to the start of everything, it is possible to run v0. Just type: -``` +``` ./v0 ``` @@ -91,7 +91,7 @@ You will be greeted with a familiar prompt of "login". The username and password are "dmr" and "dmr". To make things more familiar you'll need to create '.' as it hasn't been invented yet on this image! -``` +``` @ ln dd dmr . ``` @@ -102,7 +102,7 @@ together like `ops.s bl.s hello.s bi.s` (in that order) to produce a.out! But wait, we said this was the start of it all! This program can also run a program that replaces an even larger machine that can run BSD 2.9. To start this, -``` +``` ./prog ``` @@ -118,7 +118,7 @@ shown earlier. But wait, there is even more! Try: -``` +``` ./v6 ``` @@ -220,7 +220,7 @@ only a quarter of a century ago -- how much could things have changed?). Let's try some: -``` +``` # ls .cshrc .profile boot hkunix mnt tmp .login 2.9stamp dev lib mullender.c unix diff --git a/2018/poikola/README.md b/2018/poikola/README.md index 4f52e100b..39b301358 100644 --- a/2018/poikola/README.md +++ b/2018/poikola/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` @@ -17,7 +17,7 @@ On a terminal that supports 24 bit color, has black background, and size at least 125x38, try: -``` +``` ./try.sh ``` @@ -40,13 +40,13 @@ And those in the deep south might wish to go north for a better view. ### How to build: -``` +``` cc -o prog -std=gnu11 -O3 prog.c ``` or -``` +``` make ``` diff --git a/2018/vokes/README.md b/2018/vokes/README.md index 2495403af..b314e3fb2 100644 --- a/2018/vokes/README.md +++ b/2018/vokes/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2018 vokes bugs](../../bugs.html#2018_vokes). ## To use: -``` +``` ./prog < file.txt ``` ## Try: -``` +``` ./try.sh ``` diff --git a/2018/yang/README.md b/2018/yang/README.md index cbba77996..483a68968 100644 --- a/2018/yang/README.md +++ b/2018/yang/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ The author suggested that after compilation one should look at the generated files. For instance: -``` +``` less generated1.c less generated2.c less generated3.c @@ -19,7 +19,7 @@ files. For instance: ## Try: -``` +``` ./try.sh ``` @@ -44,7 +44,7 @@ of `./left`, `./right` and `./shift` and the additionally generated programs. The final message can be revealed using -``` +``` ./msg9 < prog.c ``` @@ -59,7 +59,7 @@ But what combinations will generate `./msg3`, `./msg4`, `./msg5`, `./msg6`, `Nuko` is a text rotator: given some text in `stdin`, `Nuko` will write the same text to `stdout`, but rotated 90 degrees counterclockwise. -``` +``` cc prog.c -o left ./left < input.txt > rotated_counterclockwise.txt ``` @@ -68,7 +68,7 @@ Due to static memory allocation, only the first 1K columns by 1K rows are rotated, the rest are silently ignored. But fear not, a separate tool with dynamic memory allocation is included: -``` +``` ./left < prog.c > r1.c cc r1.c -o right ./right < input.txt > rotated_clockwise.txt @@ -83,7 +83,7 @@ rotate counterclockwise once more, we get another program. This program outputs a single message to `stdout`, which is the name of the series that `Nuko` came from. -``` +``` ./left < prog.c | ./left > r2.c cc r2.c -o msg0 ./msg0 @@ -92,7 +92,7 @@ series that `Nuko` came from. There is one final rotation, which produces a tool that removes leading whitespaces: -``` +``` ./left < prog.c | ./left | ./left > r3.c cc r3.c -o shift ./shift < input.txt > no_leading_space.txt @@ -112,7 +112,7 @@ side). This shifted code behaves slightly different from the original program. For example, here are two more messages that can be produced: -``` +``` ./shift < prog.c | ./right > msg1.c && gcc msg1.c -o msg1 && ./msg1 ./shift < prog.c | ./left > msg2.c && gcc msg2.c -o msg2 && ./msg2 ``` diff --git a/2019/adamovsky/README.md b/2019/adamovsky/README.md index 106110192..ee8565c7f 100644 --- a/2019/adamovsky/README.md +++ b/2019/adamovsky/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2019 adamovsky bugs](../../bugs.html#2019_ada ## To use: -``` +``` ./prog file.unl ``` ## Try: -``` +``` ./try.sh ``` @@ -47,7 +47,7 @@ Functional programming is not a panacea against core dumps, after all. This can be demonstrated by: -``` +``` ./prog crash.unl ``` @@ -84,7 +84,7 @@ by the sheer length of the dividing line and totally overlooks the rest of the p When built directly using -``` +``` make ``` @@ -92,7 +92,7 @@ the program (`prog`) accepts a single parameter with the name of an Unlambda pro download the [Colossal Cave Adventure][1] (the [advent.unl](advent.unl) file) and run it like this: -``` +``` ./prog advent.unl ``` @@ -105,7 +105,7 @@ entries from [quine contest][4]. There is an alternative build path that requires the 2018 IOCCC size tool to complete. Put the tool source [iocccsize_2018.c](iocccsize_2018.c) in the project directory and call -``` +``` make identify ``` diff --git a/2019/burton/README.md b/2019/burton/README.md index 33e509a4e..51043ca12 100644 --- a/2019/burton/README.md +++ b/2019/burton/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2019 burton bugs](../../bugs.html#2019_burton ## To use: -``` +``` ./prog < file ./cow file @@ -27,7 +27,7 @@ For more detailed information see [2019 burton bugs](../../bugs.html#2019_burton ## Try: -``` +``` ./try.sh ``` @@ -51,7 +51,7 @@ The output should look familiar. Compiles cleanly with: -``` +``` WARN="-Wno-implicit-int -Wno-missing-variable-declarations -Wno-parentheses" cc -Wall -Wextra -Weverything -pedantic $WARN -include stdio.h -o prog prog.c ``` @@ -63,7 +63,7 @@ programs, it is silent upon success; any output demonstrates an error. Instead of checking correctness, the [check.sh](check.sh) script can simply output the results: (The Makefile contains the spoiler): -``` +``` out=cat ./check.sh ./prog ``` @@ -97,7 +97,7 @@ interface. Included is a version without compilation warnings: -``` +``` cc -Wall -Wextra -Weverything -pedantic -include stdio.h -o prog.clean prog.clean.c ``` diff --git a/2019/ciura/README.md b/2019/ciura/README.md index 5edf5d0cc..9e64be785 100644 --- a/2019/ciura/README.md +++ b/2019/ciura/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -22,14 +22,14 @@ For more detailed information see [2019 ciura bugs](../../bugs.html#2019_ciura). ## To use: -``` +``` ./getwords.sh en | grep .. | ./prog string ``` ## Try: -``` +``` ./try.sh ``` @@ -42,7 +42,7 @@ newline. See the Author's remarks for more information. ### Alternate build: -``` +``` make alt ``` @@ -54,7 +54,7 @@ Use `prog.alt` as you would `prog` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -83,7 +83,7 @@ of the alphabet exactly once. #### Example execution: -``` +``` $ grep .. /usr/share/dict/words | ./prog abcdefghijklmnopqrstuvwxyz qualm fjord wiz pyx vs beg kc nth quartz jinx vs fed kc womb glyph diff --git a/2019/diels-grabsch1/README.md b/2019/diels-grabsch1/README.md index e9a5d01eb..3cbb27d9b 100644 --- a/2019/diels-grabsch1/README.md +++ b/2019/diels-grabsch1/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog < file > file.Z ``` ## Try: -``` +``` ./try.sh ``` @@ -37,19 +37,19 @@ compresses differently? The judges know. :) #### Usage: -``` +``` ./prog < input.txt > input.txt.Z ``` #### Example: -``` +``` ./prog < guidelines.txt > guidelines.txt.Z ``` #### Check for correctness: -``` +``` zcat guidelines.txt.Z > guidelines2.txt diff -s guidelines.txt guidelines2.txt ``` diff --git a/2019/diels-grabsch2/README.md b/2019/diels-grabsch2/README.md index 22a25e0ae..09d6c3c94 100644 --- a/2019/diels-grabsch2/README.md +++ b/2019/diels-grabsch2/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -33,7 +33,7 @@ that you are dreaming? Or is it, wake up from the simulation? This program prints its own SHA-512 hash. To verify, run: -``` +``` $ sha512sum prog.c; ./prog 43bd0c4381a5078d2850fca9ae5e0647596bcc03cd67d8d973ad02ff35c316c728e7b347ca70abe6c74e745e63646cc7643cb0cffcd3d9a969cbf31a7ce5bf68 prog.c 43bd0c4381a5078d2850fca9ae5e0647596bcc03cd67d8d973ad02ff35c316c728e7b347ca70abe6c74e745e63646cc7643cb0cffcd3d9a969cbf31a7ce5bf68 diff --git a/2019/dogon/README.md b/2019/dogon/README.md index f6aa9accf..0468472b4 100644 --- a/2019/dogon/README.md +++ b/2019/dogon/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2019 dogon bugs](../../bugs.html#2019_dogon). ## To use: -``` +``` ./prog < pattern.mc ``` ## Try: -``` +``` ./try.sh ``` @@ -247,13 +247,13 @@ of his vast knowledge regarding GOL programming and hashlife. As a free bonus, Tom has allowed me to show his code which is probably the most efficient yet most obfuscated way of calculating the GOL function on a 64 bits `8*8` leaf: -``` +``` unsigned long life8x8(long a) { unsigned long aw = a << 1, ae = a >> 1, s0 = aw ^ ae, s1 = aw & ae, hs0 = s0 ^ a, hs1 = (s0 & a) | s1, hs0w8 = hs0 >> 8, hs0e8 = hs0 << 8, hs1w8 = hs1 >> 8, hs1e8 = hs1 << 8, ts0 = hs0w8 ^ hs0e8, ts1 = (hs0w8 & hs0e8) | (ts0 & s0); return (hs1w8 ^ hs1e8 ^ ts1 ^ s1) & ((hs1w8 | hs1e8) ^ (ts1 | s1)) & ((ts0 ^ s0) | a); } -``` +``` This uses only 19 bitwise operations and six shifts to calculate the inner 6x6 next generation bits of the input 8x8 ! diff --git a/2019/dogon/index.html b/2019/dogon/index.html index ea07d6cca..705440d73 100644 --- a/2019/dogon/index.html +++ b/2019/dogon/index.html @@ -321,7 +321,11 @@ master, who reviewed some earlier versions of the entry and freely shared some of his vast knowledge regarding GOL programming and hashlife. As a free bonus, Tom has allowed me to show his code which is probably the most efficient yet most obfuscated way of calculating the GOL function on a 64 bits 8*8 leaf:

-

<!---`c--> unsigned long life8x8(long a) { unsigned long aw = a << 1, ae = a >> 1, s0 = aw ^ ae, s1 = aw & ae, hs0 = s0 ^ a, hs1 = (s0 & a) | s1, hs0w8 = hs0 >> 8, hs0e8 = hs0 << 8, hs1w8 = hs1 >> 8, hs1e8 = hs1 << 8, ts0 = hs0w8 ^ hs0e8, ts1 = (hs0w8 & hs0e8) | (ts0 & s0); return (hs1w8 ^ hs1e8 ^ ts1 ^ s1) & ((hs1w8 | hs1e8) ^ (ts1 | s1)) & ((ts0 ^ s0) | a); }

+
    unsigned long life8x8(long a) { unsigned long aw = a << 1, ae = a >> 1, s0 = aw
+    ^ ae, s1 = aw & ae, hs0 = s0 ^ a, hs1 = (s0 & a) | s1, hs0w8 = hs0 >> 8, hs0e8 =
+    hs0 << 8, hs1w8 = hs1 >> 8, hs1e8 = hs1 << 8, ts0 = hs0w8 ^ hs0e8, ts1 = (hs0w8
+    & hs0e8) | (ts0 & s0); return (hs1w8 ^ hs1e8 ^ ts1 ^ s1) & ((hs1w8 | hs1e8) ^
+    (ts1 | s1)) & ((ts0 ^ s0) | a); }

This uses only 19 bitwise operations and six shifts to calculate the inner 6x6 next generation bits of the input 8x8 !

+``` make ``` @@ -21,20 +21,20 @@ For more detailed information see [2019 duble bugs](../../bugs.html#2019_duble). ## To use: -``` +``` ./prog file ``` ## Try: -``` +``` ./prog /tmp/drawing ``` Open another window / terminal. -``` +``` ./prog /tmp/drawing ``` @@ -42,13 +42,13 @@ Open more terminals and repeat... You might also wish to try a full screen size. For this try: -``` +``` make clobber fullscreen ``` Alternatively, if you want to change the size, do something like: -``` +``` make clobber LINES=20 COLUMNS=20 all ``` @@ -69,7 +69,7 @@ the editor. After editing the file and quitting, try: -``` +``` /tmp/drawing ``` @@ -97,7 +97,7 @@ alternate code might not work as well in macOS. ### Alternate build: -``` +``` make alt ``` @@ -132,7 +132,7 @@ To build, type `make` (assuming gcc) or `make CC=clang`. Then you can start the program. It expects a file path as its first argument: -``` +``` ./prog /tmp/drawing ``` @@ -216,7 +216,7 @@ Note: the drawing files `prog` generates are probably even more portable than The default size is the one of my xterm (see top of Makefile). You may set it to the full size of your terminal window by typing: -``` +``` make clobber fullscreen ``` diff --git a/2019/endoh/README.md b/2019/endoh/README.md index ba192b442..6a68cdb54 100644 --- a/2019/endoh/README.md +++ b/2019/endoh/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,7 +21,7 @@ For more detailed information see [2019 endoh bugs](../../bugs.html#2019_endoh). ## To use: -``` +``` ./prog ``` @@ -30,7 +30,7 @@ For more detailed information see [2019 endoh bugs](../../bugs.html#2019_endoh). If you have `gdb(1)` installed: -``` +``` ./try.sh ``` @@ -40,7 +40,7 @@ only been tested with linux. You might also wish to try: -``` +``` gdb ./prog || lldb ./prog ``` @@ -59,20 +59,20 @@ ascii` when debugging it to reveal its purpose. Compile prog.c with no optimization. -``` +``` cc -g -O0 -o prog prog.c ``` Then, run it. You will see a segmentation fault. -``` +``` $ ./prog Segmentation fault (core dumped) ``` Let's debug. As usual, run it under gdb. -``` +``` $ gdb ./prog (gdb) run Starting program: /home/.../prog @@ -132,7 +132,7 @@ The original program can be used as a GDB command file. By using this, you can confirm that it is actually a quine. -``` +``` gdb -q -x prog.c ./prog | sed -n -r 's/#.*:([0-9]+)/\1/p' | awk '{printf "%c",$1}' > prog2.c diff prog.c prog2.c ``` diff --git a/2019/giles/README.md b/2019/giles/README.md index 465c2afe2..503a29c36 100644 --- a/2019/giles/README.md +++ b/2019/giles/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog infile.wav outfile.wav ``` ## Try: -``` +``` ./try.sh ``` @@ -62,7 +62,7 @@ Interesting fact: The size of the program from `./iocccsize -i` is 2019. #### How to use: -``` +``` ./prog input [output [size [dry [wet [damping]]]]] prog.exe input [output [size [dry [wet [damping]]]]] ``` @@ -87,7 +87,7 @@ The default settings are designed to make the effect obvious rather than subtle, so it may be a good idea to adjust the ratio of "dry" to "wet", to give a more pleasant result: -``` +``` ./prog in.wav out.wav 1.8 80% 15% ``` diff --git a/2019/karns/README.md b/2019/karns/README.md index ecffd2819..f4a028f16 100644 --- a/2019/karns/README.md +++ b/2019/karns/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -21,13 +21,13 @@ For more detailed information see [2019 karns bugs](../../bugs.html#2019_karns). ## To use: -``` +``` ./prog < textfile_that_fits_on_the_screen ``` You might want to type: -``` +``` reset ``` @@ -36,13 +36,13 @@ after running the program to restore the terminal to its previous state. ## Try: -``` +``` ./try.sh ``` If you have more time you might want to try: -``` +``` ./prog < README.md ``` @@ -82,7 +82,7 @@ connected with anything. This program usually compiles under both GCC and clang. Build with: -``` +``` $(CC) -std=c99 -o tbfs prog.c ``` @@ -90,13 +90,13 @@ where `$(CC)` is cc, gcc, clang, or some other C compiler. You can then run it with: -``` +``` cat | ./tbfs ``` Examples: -``` +``` ./tbfs < maze ./tbfs < prog.c ``` diff --git a/2019/lynn/README.md b/2019/lynn/README.md index dea764f68..654d4fbe9 100644 --- a/2019/lynn/README.md +++ b/2019/lynn/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2019 lynn bugs](../../bugs.html#2019_lynn). ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -62,7 +62,7 @@ typeclasses. Just pass dictionaries explicitly. Build the compiler: -``` +``` cc -o prog prog.c ``` @@ -72,7 +72,7 @@ Build the compiler: Test the compiler on [fib.hs](fib.hs): -``` +``` (./prog < fib.hs ; cat prog.c) > fib.c ``` @@ -81,7 +81,7 @@ Compiling the output produces a binary that prints the 30th Fibonacci number. The file [ghcfib.hs](ghcfib.hs) includes [fib.hs](fib.hs) with some glue code, and shows GHC also accepts our subset of Haskell: -``` +``` ghc ghcfib.hs ``` @@ -93,7 +93,7 @@ instead provide [hint.hs](hint.hs), the output of a certain stage of the compiler when run on itself. This intermediate output is hopefully difficult to understand, yet is accepted by our compiler: -``` +``` (./prog < hint.hs ; cat prog.c) > hint.c make hint ./hint @@ -116,7 +116,7 @@ languages"](https://www.cs.dartmouth.edu/~doug/nfa.pdf). We exercise it by showing the first entries of the length-ordered list of all strings consisting of the characters `a` and `b` that contain an even number of `a`s. -``` +``` (./prog < lol.hs ; cat prog.c) > lol.c make lol ./lol @@ -124,7 +124,7 @@ of the characters `a` and `b` that contain an even number of `a`s. A GHC wrapper is provided: -``` +``` ghc ghclol.hs ``` @@ -135,14 +135,14 @@ See [scc.hs](scc.hs) (and its GHC wrapper [ghcscc.hs](ghcscc.hs)) for an elegant way to print the strongly-connected components of a graph in reverse topological order. -``` +``` (./prog < scc.hs ; cat prog.c) > scc.c ``` It expects the input to be in a similar format as a previous entry (2018 vokes). For example: -``` +``` make scc ./scc < example-1.txt ./scc < example-2.txt diff --git a/2019/mills/README.md b/2019/mills/README.md index 8444eb3c0..4e4791458 100644 --- a/2019/mills/README.md +++ b/2019/mills/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2019 mills bugs](../../bugs.html#2019_mills). ## To use: -``` +``` make cpclean # Let this run for about about an hour and then kill it: ./prog Shakespeare.txt @@ -27,7 +27,7 @@ For more detailed information see [2019 mills bugs](../../bugs.html#2019_mills). ## Try: -``` +``` ./try.sh ``` @@ -92,19 +92,19 @@ OMLET has three operating modes: For your first OMLET experiment, we will try training a simple single-level RNN to write some [Shakespeare][5] plays. Start by typing -``` +``` make ``` After it builds, train it using -``` +``` ./prog Shakespere.txt ``` This will immediately start outputting gibberish to the output, e.g. -``` +``` ./prog Shakespere.txt ``` @@ -259,7 +259,7 @@ doing `Control-C`. You can continue training from a previous checkpoint by providing the checkpoint file name as the second parameter, for example: -``` +``` ./prog Shakespeare.txt cp01_1.970 ``` @@ -275,7 +275,7 @@ parameters to generate data. Inference mode takes the checkpoint file as *standard input* (not on the command line) and hence must be run with a command like -``` +``` ./prog < cp55_1.807 ``` @@ -294,7 +294,7 @@ The default network for OMLET (the one you get if you type `make` with the executable name `prog`) is the simplest recurrent neural network. It looks like -``` +``` h = tanh(Wxh * x + Whh * h' + Bh) y = Why * h + By ``` @@ -317,26 +317,26 @@ It is the presence of the hidden state vector that allows the RNN to "remember" the past. We can see what would happen if we removed this hidden state. If you type -``` +``` make lin1 ``` OMLET will create an [ADALINE][10] network that does -``` +``` y = Wxy * x + By ``` This is a simple [linear][11] [feed-forward network][12]. You can run it with -``` +``` ./lin1 Shakespeare.txt ``` The linear network won't be able to get past the gibberish stage, because it lacks history: -``` +``` ./lin1 Shakespeare.txt ``` @@ -388,7 +388,7 @@ the language but `per` with the digit 1). We can try to improve the RNN's performance by stacking RNN modules atop each other: -``` +``` h1 = RNN(h1', x) h2 = RNN(h2', h1) y = Why * h2 + By @@ -414,13 +414,13 @@ the hard limit with `limit -h stacksize` and set it with You can try the deeper network by doing -``` +``` make rnn2 ``` (or even `make rnn3` if you want a three-layer RNN) and train it with -``` +``` ./rnn2 Shakespeare.txt ``` @@ -444,13 +444,13 @@ gradient, worsening the exploding and vanishing gradient problem. solve this problem. Christopher Olah gives a good description of them at his [blog posting][20]. You can build a two-level LSTM by doing -``` +``` make lstm2 ``` and train with it with -``` +``` ./lstm2 Shakespeare.txt ``` @@ -464,7 +464,7 @@ its hidden state via "gates". These gates are called The basic LSTM equations are -``` +``` f = sigmoid(Wxf * x + Whf * h' + Bf) i = sigmoid(Wxi * x + Whi * h' + Bi) o = sigmoid(Wxo * x + Who * h' + Bo) @@ -496,7 +496,7 @@ simplified versions of an LSTM which combine the gates together, meaning they require fewer learned parameters. This allows them to train faster than a generic LSTM. You can build a two-layer GRU with -``` +``` make gru2 ``` @@ -510,7 +510,7 @@ compiler's command-line by using `-D` directives. The network is defined by a `-DNW='...'` command which consists of a series of comma-separated assignments. For example, the simple one-layer RNN could be defined like -``` +``` -DNW=' x = I(n), hp = I(128), \ h = C(hp, T(A(L(128, x), L(128, hp)))), \ y = L(n, h)' @@ -555,7 +555,7 @@ training mode, this is used to generate the loss which is backpropagated. As an example of a more complicated network, we can look at a two-layer GRU network: -``` +``` -DHS=128, \ -DNW=' x = I(n), \ y = L(n, MD(MD(x)))' \ diff --git a/2019/poikola/README.md b/2019/poikola/README.md index f4acd2fc1..908a6917d 100644 --- a/2019/poikola/README.md +++ b/2019/poikola/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -26,7 +26,7 @@ For more detailed information see [2019 poikola bugs](../../bugs.html#2019_poiko ## To use: -``` +``` ./prog 512 ./prog sleep 86400; make clobber prog @@ -38,7 +38,7 @@ For more detailed information see [2019 poikola bugs](../../bugs.html#2019_poiko If you wish for some documentation: -``` +``` make docs ``` @@ -49,7 +49,7 @@ This will create the file `poikola.pdf` for your enjoyment. If you don't have a few days, try: -``` +``` ./try.sh ``` @@ -65,7 +65,7 @@ what can be done with the original entry. ### Alternate build: -``` +``` make alt ``` @@ -77,7 +77,7 @@ Use `prog.alt` as you would `prog` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -103,19 +103,19 @@ Nykänen](https://en.wikipedia.org/wiki/Matti_Nyk%C3%A4nen). ### How to build: -``` +``` gcc -O0 -o prog prog.c ``` or -``` +``` clang -O[0123s] -o prog prog.c ``` e.g.: -``` +``` clang -O1 -o prog prog.c ``` @@ -166,7 +166,7 @@ unnecessary checks, but either fails or gets stuck if invoked erroneously. The program is invoked in this way: -``` +``` ./prog ``` diff --git a/2019/yang/README.md b/2019/yang/README.md index 1176f11d6..14f69463b 100644 --- a/2019/yang/README.md +++ b/2019/yang/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2019 yang bugs](../../bugs.html#2019_yang). ## To use: -``` +``` ./prog sample_input.txt a b c d cat a @@ -35,7 +35,7 @@ For more detailed information see [2019 yang bugs](../../bugs.html#2019_yang). ## Try: -``` +``` ./try.sh ``` @@ -52,7 +52,7 @@ output again. Scramble/unscramble to single file: -``` +``` ./prog original.txt > scrambled.txt ./prog < scrambled.txt > unscrambled.txt @@ -60,7 +60,7 @@ Scramble/unscramble to single file: Scramble/unscramble to multiple files: -``` +``` ./prog input.txt output1.txt output2.txt ... cat output1.txt output2.txt ... | ./prog > unscrambled.txt @@ -68,7 +68,7 @@ Scramble/unscramble to multiple files: Re-scramble: -``` +``` ./prog original.txt | ./prog - > scrambled1.txt ./prog original.txt | ./prog - | ./prog - > scrambled2.txt ./prog original.txt | ./prog - | ./prog - | ... > scrambled3.txt @@ -76,7 +76,7 @@ Re-scramble: Scramble slowly: -``` +``` ./prog input.txt | ruby prog.c ``` @@ -87,14 +87,14 @@ Input must be in UTF-8 encoding. This is a text scrambling utility. To scramble text, specify input file name as the first argument: -``` +``` ./prog input.txt > output.txt ``` If original input file was small enough to fit in your terminal, you can simply use `cat` to unscramble the output text. -``` +``` cat output.txt ``` @@ -106,7 +106,7 @@ order. This effect is more visible if there is a delay after each character is printed. For convenience, a utility is included in the source to output characters slowly: -``` +``` ./prog input.txt | ruby prog.c ``` @@ -114,14 +114,14 @@ Scrambling order is deterministic, but you can reshuffle the output by piping it through the same utility again, by specifying `-` as the first argument: -``` +``` ./prog input.txt | ./prog - | ./prog - | ... ``` You can also split the input to multiple files, each getting a subset of the original input characters: -``` +``` ./prog input.txt output1.txt output2.txt ... cat output1.txt output2.txt ... > unscrambled.txt ``` @@ -138,7 +138,7 @@ positions to be misaligned. But fear not, this utility also includes unscrambling functionality. If no argument is specified, input will be read through `stdin` and unscrambled to `stdout`: -``` +``` ./prog < scrambled.txt > unscrambled.txt ``` @@ -146,7 +146,7 @@ Where this is useful is that if you scramble the input to multiple files and unscramble each output file individually, those output files can be printed on transparencies and distributed separately. -``` +``` ./prog input.txt output1.txt output2.txt output3.txt ./prog < output1.txt > layer1.txt ./prog < output2.txt > layer2.txt @@ -159,7 +159,7 @@ In other words, this is a utility for facilitating This utility can also be used just for removing trailing whitespaces and expanding tabs to 8 spaces. -``` +``` ./prog input.txt | ./prog ``` diff --git a/2020/burton/README.md b/2020/burton/README.md index 40f183ca0..43da6d8e0 100644 --- a/2020/burton/README.md +++ b/2020/burton/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2020 burton bugs](../../bugs.html#2020_burton ## To use: -``` +``` ./prog arg ... ``` ## Try: -``` +``` ./try.sh ``` @@ -67,7 +67,7 @@ result? This code may be tested by: -``` +``` make test ``` @@ -107,19 +107,19 @@ Compiles cleanly under `clang -Wall -Weverything -pedantic`, but you need to add On a little-endian machine: -``` +``` clang -include stdio.h -include stdlib.h -Wall -Weverything -pedantic -DB=6945503773712347754LL -DI=5859838231191962459LL -DT=0 -DS=7 -o prog prog.c ``` On a big-endian machine: -``` +``` clang -include stdio.h -include stdlib.h -Wall -Weverything -pedantic -DB=7091606191627001958LL -DI=6006468689561538903LL -DT=1 -DS=0 -o prog_be prog.c ``` You might be interested to compile it both ways on the same host, and try: -``` +``` ./prog 1; ./prog_be 1 ``` diff --git a/2020/carlini/README.md b/2020/carlini/README.md index b4469a9c9..6911c5d97 100644 --- a/2020/carlini/README.md +++ b/2020/carlini/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,20 +18,20 @@ For more detailed information see [2020 carlini bugs](../../bugs.html#2020_carli ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` Or if you actually want to play: -``` +``` # Play with a friend, real or imagined, P1 and P2, squares are numbered 1..9 ./prog ``` @@ -51,7 +51,7 @@ HOW ABOUT A NICE GAME OF CHESSTIC-TAC-TOE? ### USAGE -``` +``` cc -o prog prog.c ./prog ``` @@ -92,7 +92,7 @@ compilers unhappy, and others slow. (For example, passing GCC the flags `-Wall Under some terminals the program may exit early. The following should always work: -``` +``` echo "1 2 3 4 5 6 7" | ./prog ``` @@ -100,7 +100,7 @@ Under some terminals the program may exit early. The following should always wor The entirety of the program consists of a single iterated call to `printf(3)`. -``` +``` int main() { while(*d) printf(fmt, arg); } @@ -144,13 +144,13 @@ Format specifiers can take extra "arguments". For example, the following expression -``` +``` printf("%1$.*2$d%3$hhn", 5, 10, &x) ``` will have the same effect as if we had written -``` +``` x = 10; ``` @@ -174,37 +174,37 @@ We can use format strings to compute the OR/NOT of arbitrary "bits". We'll start with the simplest, OR: -``` +``` printf("%1$s%2$s%3$hhn", a, b, c) ``` will compute -``` +``` *c = strlen(a) + strlen(b) ``` but given that `strlen(x)` is `1` for a 1-bit and `0` for a 0-bit, we have -``` +``` *c = a | b ``` Computing the NOT of a single value is also easy: -``` +``` printf("%1$255d%1$s%hhn", a, b) ``` will compute -``` +``` *b = (strlen(a)+255)%256 = strlen(a)-1 ``` and again, because `strlen(x)` is either `1` or `0` we have -``` +``` *c = !b ``` @@ -221,7 +221,7 @@ To detect who has won, we implement the following logic. Let `A`, `B`, and `C` b pointers to three squares in a row to test, and `D` be where to save if there is a win or not. -``` +``` "%A$s%B$s%C$s%1$253d%11$hhn" // r11 = !(*A & *B & *C) ZERO "%11$s%1$255d%11hhn" // r11 = !r11 @@ -235,7 +235,7 @@ possible three-in-a-row configurations, for both players. The ZERO macro ensures that the number of bytes written out is 0 mod 256 with the following expression -``` +``` "%1$hhn%1$s" (repeated 256 times) ``` @@ -254,13 +254,13 @@ bits to Xs and Os to print out. This is actually rather straightforward. Given in `1$` the pointer to player 1's square, and `2$` the pointer to player 2's, and in `3$` the pointer to the board string, we can compute -``` +``` "%1$s" (repeated 47 times) "%2$s" (repeated 56 times) %1$32d%3$hhn" ``` which will, in effect, compute -``` +``` *r3 = (*r1) * 47 + (*r2) * 56 + 32 ``` @@ -273,7 +273,7 @@ which will output `' '` if neither are true, `'X'` if `r1` is true, or `'O'` if In order to be able to finally display the board, while still only using one `printf(3)` statement, we finish the statement with -``` +``` "\n\033[2J\n%26$s" ``` @@ -299,7 +299,7 @@ won, or the game is over and it is a draw. This turns out not to be as hard as it might look. Using the same trick as before, we set byte four to be -``` +``` *byte4 = is_win * 'W' + is_tie * 'T' ``` @@ -313,7 +313,7 @@ ends. It should just exit. One option would be to implement the logic as -``` +``` printf() while (*ok) { scanf(); @@ -324,7 +324,7 @@ One option would be to implement the logic as but this would DOUBLE the number of calls to `printf(3)` we require. So instead we implement it like this -``` +``` while (*ok) { scanf(); printf(); diff --git a/2020/endoh1/README.md b/2020/endoh1/README.md index bebe74089..0c5dbbc47 100644 --- a/2020/endoh1/README.md +++ b/2020/endoh1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ code](#alternate-code) below. ## To use: -``` +``` # IMPORTANT for macOS: run under Terminal.app ./prog @@ -19,7 +19,7 @@ code](#alternate-code) below. ## Try: -``` +``` # IMPORTANT for macOS: run under Terminal.app # Try resizing the terminal window before the first click. @@ -41,7 +41,7 @@ Author's remarks for more details. ### Alternate build: -``` +``` make alt ``` @@ -94,7 +94,7 @@ All you have to do is (0). You can test if you are lucky or not. It uses ncurses: -``` +``` gcc -o prog prog.c -lncurses ./prog ``` @@ -200,7 +200,7 @@ Analyze the code. You can also play with a prepared map. -``` +``` ./prog ioccc.txt ``` diff --git a/2020/endoh2/README.md b/2020/endoh2/README.md index c8beae056..0804aac84 100644 --- a/2020/endoh2/README.md +++ b/2020/endoh2/README.md @@ -1,26 +1,26 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` What happens if you do -``` +``` ./prog prog.c ``` @@ -41,7 +41,7 @@ render for a larger terminal window? How about adding more glyphs? No! Try not. Do, or do not. There is no try. -``` +``` cc -std=c99 prog.c ./a.out ./a.out hello.txt diff --git a/2020/endoh3/README.md b/2020/endoh3/README.md index 4111a267d..f091a3d26 100644 --- a/2020/endoh3/README.md +++ b/2020/endoh3/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ code](#alternate-code) below. ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./run_clock # And watch closely for 15-20 seconds ``` @@ -31,7 +31,7 @@ alternate code uses Unicode letters. ### Alternate build: -``` +``` make alt ``` @@ -43,7 +43,7 @@ Use `prog.alt` as you would `prog` above. ### Alternate try: -``` +``` ./run_clock.alt # And watch closely for 15-20 seconds ``` @@ -63,7 +63,7 @@ time might depend on what time it is. Prepare a mirror! -``` +``` make clock ``` diff --git a/2020/ferguson1/COMPILING.md b/2020/ferguson1/COMPILING.md index 604f46099..d962fc846 100644 --- a/2020/ferguson1/COMPILING.md +++ b/2020/ferguson1/COMPILING.md @@ -33,7 +33,7 @@ I imagine that it works for 32-bit systems but I do not know for sure. You should be able to get the compiler with: -``` +``` sudo xcode-select --install ``` @@ -53,13 +53,13 @@ you want to use the Makefile) to compile and link this entry. With Fedora more recent versions there's the `dnf` package manager but I cannot help with any of the GUI installers since I don't use them. Something like: -``` +``` sudo dnf install ncurses-devel ncurses make gcc ``` or -``` +``` # dnf install ncurses-devel ncurses make gcc ``` @@ -69,25 +69,25 @@ Just like Fedora you will need `gcc`, `ncurses`, `ncurses-devel` (and if you want to use the Makefile `make`). CentOS uses `yum` and CentOS 8 uses `dnf`. So: -``` +``` sudo yum install ncurses-devel ncurses make gcc ``` or -``` +``` # yum install ncurses-devel ncurses make gcc ``` or -``` +``` sudo dnf install ncurses-devel ncurses make gcc ``` or -``` +``` # dnf install ncurses-devel ncurses make gcc ``` diff --git a/2020/ferguson1/HACKING.md b/2020/ferguson1/HACKING.md index f679f646b..17fc6f31a 100644 --- a/2020/ferguson1/HACKING.md +++ b/2020/ferguson1/HACKING.md @@ -78,7 +78,7 @@ initialise a pair (make it 5 so as to not interfere with the script customisability) and then you use the bkgd() function with the colour pair. Something like this: -``` +``` init_pair(5, COLOR_BLACK, COLOR_WHITE); bkgd(COLOR_PAIR(5)); ``` @@ -88,7 +88,7 @@ but that changes the background of the program anyway. The standard colour identifiers are: -``` +``` COLOR_BLACK COLOR_RED COLOR_GREEN @@ -124,7 +124,7 @@ Let's say you don't want to use arrow keys or you don't have arrow keys. Instead you might want the keys `l`, `r`, `u` and `d` for the directions. Find the case statements: -``` +``` case KEY_LEFT: case KEY_RIGHT: case KEY_UP: @@ -133,7 +133,7 @@ statements: Replace `KEY_LEFT` with: -``` +``` 'l' ``` @@ -141,7 +141,7 @@ and do the same thing for the other directions too. If you want more than one key e.g. the arrow keys and the letters just add another case statement e.g. for left it might be: -``` +``` case KEY_LEFT: case 'l': ``` @@ -166,13 +166,13 @@ different sets. Please also be aware that if you don't want any information you must set it to the below at the very least; defining it without a value is not enough (it amounts to the parameters to a printf call): -``` +``` #define J " " ); ``` If you don't care about brief displays of 'o' at 0,0 you can just have: -``` +``` #define J ""); ``` @@ -194,7 +194,7 @@ coordinates of where the snake is plus the other things that are there (a number of which were added over time). Obviously this would take many bug sized bytes (bites) even once let alone twice! Thus I made it into a define: -``` +``` #define J Z(X:%d/%d Y:%d/%d S:%zu/%zu B:%zu\n), Y, y[-2], X,*y,A,g, c); ``` @@ -220,7 +220,7 @@ For an example this would only include the size of the snake and the number of bugs eaten (I think I have this correct; I've made many changes to the point of not wanting to mess with anything that's unnecessary): -``` +``` #define J Z(SIZE: %zu BUGS: %zu\n), A, c); ``` @@ -257,13 +257,13 @@ come to mind as information that might be of interest. Quite simply change: -``` +``` X = H / 2; Y = *x / 2; ``` To be something like: -``` +``` X = R(1,H-1); Y = R(2,*x-1); ``` @@ -395,7 +395,7 @@ street!). If you look at the walls code you will see a ternary operator for both `X` and `Y` coordinates. This of course is very different now but the idea remains the same: -``` +``` if (p && !(*O>=O[1]||H>=M(1))) { if (X<1||X>=H) @@ -414,7 +414,7 @@ coordinates to the correct new location. If however you wanted the walls to act as a barrier you could do something like this instead (omitting the inner if statements here): -``` +``` X=X<1?1:*H-1; Y=Y<2?2:*O-1; diff --git a/2020/ferguson1/README.md b/2020/ferguson1/README.md index aaa7d1f22..9692f24f0 100644 --- a/2020/ferguson1/README.md +++ b/2020/ferguson1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2020 ferguson1 bugs](../../bugs.html#2020_fer ## To use: -``` +``` WAIT=N WALLS=[01] EVADE=N SIZE=N MAXSIZE=N GROW=N SHEDS=N SHED=N CANNIBAL=[01] ./prog # start pressing some arrow keys ``` @@ -87,7 +87,7 @@ and non-zero). ## Try: -``` +``` make test WAIT=75 WALLS=1 CANNIBAL=1 ./prog @@ -211,7 +211,7 @@ features. Because all IOCCC entries should have a man page I have included one (even though much of it is what's also above). To render try: -``` +``` man ./snake.1 ``` diff --git a/2020/ferguson1/bugs.md b/2020/ferguson1/bugs.md index b5596128a..4ca1464df 100644 --- a/2020/ferguson1/bugs.md +++ b/2020/ferguson1/bugs.md @@ -22,7 +22,7 @@ simply a fun consequence of the features I did implement. Let's say you want to verify that the evade mode is at the right count. How can you verify it without modifying the code? Try: -``` +``` SIZE=0 SHED=1 SHEDS=1 EVADE=10 ./prog ``` @@ -44,7 +44,7 @@ don't at this time remember any I might have done. One way to show this is in full is to set the initial size and growth size to a high value; then try each one individually. For example: -``` +``` SIZE=100 ./prog ``` @@ -113,7 +113,7 @@ Here's a fun output: That's from: -``` +``` SHED=1 SHEDS=-1 ./prog ``` @@ -126,7 +126,7 @@ And right after that you would see: Try this though: -``` +``` SHEDS=-1 SHED=25 ./prog ``` @@ -138,7 +138,7 @@ this is the basis of the grow/shrink mode of play that I talk about in the Here's another thing to be aware of. Let's say you do: -``` +``` SIZE=1 GROW=-1 ./prog ``` @@ -146,7 +146,7 @@ How many bugs will it take before you win? In fact it's two: you would see the head twice: the second time once you 'shrink' down to size 0; it would then be that if you get another bug you will be at the 'max size': -``` +``` YOU WIN! X:81/156 Y:35/41 S:997/997 B:2 ``` @@ -228,7 +228,7 @@ the game is 10 x 10. This includes the walls and score line. Now the default max snake size is 997 but when the terminal is too small it adjusts the max snake size. For 10 lines and 10 columns you would see: -``` +``` $ make test terminal supports cursor movement terminal supports making cursor invisible diff --git a/2020/ferguson1/cannibalism.log.md b/2020/ferguson1/cannibalism.log.md index 0e4f84aa2..90a5b2da7 100644 --- a/2020/ferguson1/cannibalism.log.md +++ b/2020/ferguson1/cannibalism.log.md @@ -184,7 +184,7 @@ most of them. Another example invocation where the snake head is in the snake and where the snake hadn't yet moved (that is it was still growing): -``` +``` CANNIBAL=1 SIZE=1500 GROW=2 MAXSIZE=1600 ./prog ``` diff --git a/2020/ferguson1/crazy.log.md b/2020/ferguson1/crazy.log.md index 46a6c83e7..018b94df8 100644 --- a/2020/ferguson1/crazy.log.md +++ b/2020/ferguson1/crazy.log.md @@ -1,6 +1,6 @@ The following are a few screen dumps of: -``` +``` SIZE=100 SHEDS=5 GROW=-10 SHED=50 MAXSIZE=250 ./prog ``` diff --git a/2020/ferguson1/gameplay.md b/2020/ferguson1/gameplay.md index df76efb96..414d26da6 100644 --- a/2020/ferguson1/gameplay.md +++ b/2020/ferguson1/gameplay.md @@ -415,7 +415,7 @@ default) or setting the size to higher than the default (or < 0 which will end up being > the max size though I suppose there might be some value that makes it less than again - I'm not going to try and figure that out however). Anyway: -``` +``` SIZE=-1 ./prog YOU WIN! X:24/49 Y:8/16 S:658/658 B:0 @@ -487,7 +487,7 @@ If you want to draw the snake wherever you like on the screen you can do this by modifying the wait time (for input) to -1 (or any value < 0): then the snake does not move until you press a movement key. For example: -``` +``` WAIT=-1 ./prog ``` @@ -495,7 +495,7 @@ does not move until you press a movement key. For example: When you eat a bug the snake will grow and you can draw more. If you want to make it so you can go through yourself: -``` +``` WAIT=-1 CANNIBAL=1 ./prog ``` @@ -503,7 +503,7 @@ If you don't want to start out so small (i.e. you want to be able to draw more quickly) you can just set the size to a bigger number (and you could do the same with growth and moult/shed): -``` +``` SIZE=50 CANNIBAL=1 WAIT=-1 ./prog ``` @@ -513,14 +513,14 @@ time. Okay but then if you get too many bugs the drawing will be over. If this proves to be a problem simply do: -``` +``` SIZE=100 CANNIBAL=1 WAIT=-1 GROW=0 ./prog ``` Or something like that (maybe make the size bigger but that's up to you). You could also set the max size to be the highest possible by saying -``` +``` MAXSIZE=-1 ``` @@ -556,7 +556,7 @@ too. If you're still here you can create this effect like: -``` +``` WAIT=0 WALLS=1 CANNIBAL=1 ./prog ``` @@ -582,7 +582,7 @@ so with fewer available it has a harder time finding a place in that one line. Here's how to make the bug move every time the snake moves: -``` +``` CANNIBAL=1 WALLS=1 WAIT=0 EVADE=1 ./prog ``` @@ -591,7 +591,7 @@ Here's how to make the bug move every time the snake moves: If you want to see the game 'win' try something like: -``` +``` CANNIBAL=1 WALLS=1 WAIT=0 EVADE=1 MAXSIZE=10 ./prog ``` @@ -601,7 +601,7 @@ If you want to see the game 'win' try something like: Here's a fun one I just thought of (a long time after these other modes were thought of): -``` +``` WAIT=0 EVADE=1 GROW=-1 SIZE=9 MAXSIZE=10 CANNIBAL=1 ./prog ``` @@ -616,7 +616,7 @@ then the head again (i.e. 1 then 0 in size) and then win! This is also in the Of course you can also do something like: -``` +``` WAIT=5 WALLS=1 CANNIBAL=1 ./prog ``` @@ -635,7 +635,7 @@ of success in catching bugs? Obviously the dimensions will affect this value. How long will it take for the snake to run into itself? For instance by doing: -``` +``` WAIT=0 ./prog ``` @@ -660,7 +660,7 @@ You have a negative shedding growth and a positive growth size: negative and positive winning. Depending on the parameters specified it might go one way over the other. Try: -``` +``` SIZE=150 SHEDS=-5 GROW=10 SHED=50 MAXSIZE=250 ./prog ``` @@ -683,7 +683,7 @@ You could also have it so that eating a bug makes you shrink and moving so many moves you grow. I tried this and for me it was far more fun. The [play.sh][] also has this mode: -``` +``` SIZE=100 SHEDS=5 GROW=-10 SHED=50 MAXSIZE=250 ./prog ``` @@ -705,7 +705,7 @@ snake moving too. Anyway this might sound absurd but it can be somewhat hypnotic by doing: -``` +``` EVADE=1 CANNIBAL=1 ./prog ``` @@ -721,7 +721,7 @@ the growth size to 0 and then just move the snake round and round eating bugs until you want to quit. You can enable cannibalism so that you don't have to worry about even running into yourself and losing: -``` +``` GROW=0 CANNIBAL=1 ./prog ``` @@ -752,13 +752,13 @@ this file discusses as well as allowing to easily change the colours. To do this use the [snake-colours][] script like so: -``` +``` ./snake-colours ``` If you want to pass in specific variables you can do that too e.g.: -``` +``` CANNIBAL=1 ./snake-colours ``` @@ -777,13 +777,13 @@ you choose uses then the script will override what you pass in. To use you can do something like: -``` +``` ./play.sh ``` Or to make it so walls are an obstacle: -``` +``` WALLS=0 ./play.sh ``` diff --git a/2020/ferguson1/spoilers.md b/2020/ferguson1/spoilers.md index 5c4dab325..1fdc50b18 100644 --- a/2020/ferguson1/spoilers.md +++ b/2020/ferguson1/spoilers.md @@ -818,13 +818,13 @@ returned. In either case curses is ended. One of these optimisations saved four bytes simply by taking advantage of the value of a loop iterator after the loop. The loop is: -``` +``` for (I = 0; A && I < A - 1; ++I) ``` However after the loop I had this: -``` +``` A > 1 && q(n[A - 1],e[A - 1], 'o'); ``` @@ -847,7 +847,7 @@ the problem. First, the function that turns on colours looked like: -``` +``` if (h) attron(m(PAIR(L))); else attroff(m(PAIR(L))); ``` @@ -857,14 +857,14 @@ that the `attroff()` is called first then I could just do an `if (h)` - therefore getting rid of the `else`! But then I thought why not do what I've done elsewhere? I had: -``` +``` attroff(m(PAIR(L))); if (h) attron(m(PAIR(L))); ``` But I then saved an extra byte by making it: -``` +``` attroff(m(PAIR(L))); h && attron(m(PAIR(L))); ``` @@ -875,7 +875,7 @@ Second let's look at the `B()` function: there were two things I thought of that would save some bytes (I no longer know how many but a few at least possibly six or even more). I had the following code: -``` +``` if (V && U && o) { S(N); b(1); } ``` @@ -886,13 +886,13 @@ called with `1` (thus `o` is 1 so the if is true) was if the bug actually is caught. That means I could remove the `V && U &&` part of the if! Thus it became instead: -``` +``` if (o) { S(N); b(1); } ``` Then this -``` +``` !o && V && U && q U,V,' '); ``` @@ -913,7 +913,7 @@ where the snake already is. So if I had to make sure the game had started (the snake has moved at least once) what could I check? In fact that means the direction is not 0! So I could just replace it with: -``` +``` !o && D && q *U,*V,' '); ``` @@ -930,7 +930,7 @@ the score line is updated: so the empty space will be overwritten anyway. And if the score line is made an empty string it doesn't matter because it'll appear as all spaces anyway. Thus I could save another three bytes by changing it to: -``` +``` !o && q *U,*V,' '); ``` diff --git a/2020/ferguson1/terminals.md b/2020/ferguson1/terminals.md index efe19fde6..1544f91ba 100644 --- a/2020/ferguson1/terminals.md +++ b/2020/ferguson1/terminals.md @@ -30,7 +30,7 @@ for the capabilities I use in the entry. It also tries to determine the minimum number of columns to play without the status line overflowing - even with the dynamic length. Try: -``` +``` $ make test ``` @@ -67,7 +67,7 @@ If I pass in any of the variables **GROW**, **MAXSIZE**, **SIZE** and/or **LINES** or **COLUMNS** it bases its calculations on those variables. For example: -``` +``` terminal supports cursor movement terminal supports making cursor invisible terminal supports bold @@ -129,7 +129,7 @@ To specify the lines/columns of curses program per instance use the `LINES` and For demonstration consider the following: -``` +``` $ echo $LINES $COLUMNS 42 157 ``` @@ -139,7 +139,7 @@ include the walls and score line but these values are for the terminal itself. Say you want 55 columns: -``` +``` $ COLUMNS=55 ./prog ``` @@ -166,7 +166,7 @@ In my tests there is one thing that at least allows you to see the final score and that is by running `clear` before running the program. That's what the prog.alt version does. You might run it as one of: -``` +``` LINES=20 ./prog.alt LINES=20 ./snake.alt ``` @@ -190,7 +190,7 @@ The Linux man page says: If you don't have the reset utility you can try: -``` +``` echo -e \\033c ``` @@ -209,14 +209,14 @@ along and thinks he/she will be clever and mess with the dimensions a bit. Let's say they have a 13" monitor and they think it'd be funny to see how 997 lines would work; they might try something like: -``` +``` LINES=997 ./prog ``` What then? Well expect trouble; curses will not know any better and the max number of lines will be 997. If they were to do: -``` +``` COLUMNS=997 ./prog ``` @@ -265,7 +265,7 @@ According to my tests for monochrome terminals the screen has the white and black background; if terminal is configured to be black background white foreground that is the order it is too. You can try that like: -``` +``` TERM=linux-m ./prog ``` @@ -301,7 +301,7 @@ Based on the two as well as the fact that monochrome terminals (I've tried under both Linux and macOS) seem to work fine I believe I am fine here too. And to confirm this I wrote the following code with the output below: -``` +``` #include int main() @@ -314,7 +314,7 @@ confirm this I wrote the following code with the output below: } ``` -``` +``` TERM=linux-m ./colour_pairs COLORS: 0 COLOR_PAIRS: 0 @@ -332,7 +332,7 @@ possible colour pairs than I have used so that's not a problem either. Perhaps even it would only be a runtime error if the colours are supported and the number is out of the range? To try and figure this out I did another test: -``` +``` int main() { initscr(); @@ -351,7 +351,7 @@ number is out of the range? To try and figure this out I did another test: Running it like -``` +``` TERM=linux-m ./colour_pairs ``` diff --git a/2020/ferguson1/troubleshooting.md b/2020/ferguson1/troubleshooting.md index 9f922bd6b..6c686f22d 100644 --- a/2020/ferguson1/troubleshooting.md +++ b/2020/ferguson1/troubleshooting.md @@ -328,7 +328,7 @@ hit a key every time to move because it is blocking. What happens if you do: -``` +``` WALLS= ./prog ``` @@ -342,20 +342,20 @@ for a number could have a better value than 0. If however you were to give valid input followed by invalid input the valid input would be parsed. For example: -``` +``` WALLS=1test ./prog ``` would let you go through the walls. On the other hand -``` +``` WALLS=test1 ./prog ``` would not. Furthermore if you specify the same variable more than once it's the last one that counts. For example: -``` +``` WALLS=0 WALLS=1 CANNIBAL=1 CANNIBAL=0 ./prog ``` @@ -414,7 +414,7 @@ If `calloc()` fails to obtain the needed memory you'll see something like (here was before I added proper - to make the perfect and obvious pun - capsizing so that by setting the size to -1 it went to the max unsigned value): -``` +``` $ MAXSIZE=-1 ./prog memory error X:0/157 Y:0/42 S:3/18446744073709551614 B:0 @@ -428,7 +428,7 @@ not know but what I do know is that because it's unsigned it can't be negative; if the max size is 0 then the array size will be 1 but it won't matter because the snake size will be >= that max anyway. But here's a curious output: -``` +``` SIZE=1 MAXSIZE=0 ./prog YOU WIN! X:78/156 Y:20/41 S:0/0 B:0 diff --git a/2020/ferguson2/README.md b/2020/ferguson2/README.md index b21ef2414..e2c1a6359 100644 --- a/2020/ferguson2/README.md +++ b/2020/ferguson2/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,7 +11,7 @@ at once. See [Alternate code](#alternate-code) below. ## To use: -``` +``` ./prog # get recode help: @@ -49,13 +49,13 @@ are allowed. ## Try: -``` +``` ./try.sh ``` What does: -``` +``` echo | ./recode echo | ./recode -v ``` @@ -72,14 +72,14 @@ and to make it a bit more like the real thing. ### Alternate build: -``` +``` make alt ``` The default time to sleep is 400000 microseconds but you can change this by doing: -``` +``` make clobber SLEEP=600000 alt ``` @@ -93,7 +93,7 @@ Use `prog.alt` as you would `prog` above. ### Alternate try: -``` +``` ./try.alt.sh ``` @@ -110,7 +110,7 @@ There is a good deal of useful documentation that is provided with this entry: * [enigma.1](enigma.1) - A useful man page for this entry. To render, try: -``` +``` man ./enigma.1 ``` @@ -251,7 +251,7 @@ the result (after finishing the enciphering). If you run it like: -``` +``` ./prog - ``` @@ -283,7 +283,7 @@ program as well as how to use the two winning entries of the [Morse code](https://en.wikipedia.org/wiki/Morse_code) that I referred to earlier: -``` +``` $ ./prog - Ring 1: 3 Setting 1: I @@ -317,7 +317,7 @@ default settings; as the judges suggest this invocation I will not show it here. But you can also type it out like this: -``` +``` $ ./prog IOCCC UUMMX @@ -328,7 +328,7 @@ The IOCCC comes from stdin; the `UUMMX` is written to stdout. If I compile the 2014 entry and copy it to my local directory as `vik` I might do: -``` +``` $ echo TEST|./prog |./vik | mplayer -demuxer rawaudio - ``` @@ -340,7 +340,7 @@ a bug in that entry (Fedora, CentOS and macOS all affected). For example I can use the syntax provided in the winning remarks along with my entry to write it to a file. Say: -``` +``` $ echo TEST|./prog |./vik > test.raw $ ./vik e < test.raw | ./prog LEST @@ -348,21 +348,21 @@ entry to write it to a file. Say: Why did that happen? This shows more details: -``` +``` $ ./vik e < test.raw SCWV ``` However as can be seen the first char is wrong: -``` +``` $ echo TEST|./prog KCWV ``` And piping the original output to my entry itself you get the original input: -``` +``` $ echo TEST | ./prog | ./prog TEST ``` @@ -372,7 +372,7 @@ idea anyway. Neither do I know if the original transcoding is correct. What if I use the input string `LEST` instead? In that case it worked fine: -``` +``` $ echo LEST | ./prog | ./vik > lest.raw $ ./vik e < lest.raw | ./prog LEST @@ -380,7 +380,7 @@ What if I use the input string `LEST` instead? In that case it worked fine: But there's one obvious question, right? Let's try the most important one: -``` +``` $ echo IOCCC | ./prog | ./vik > ioccc.raw $ ./vik e < ioccc.raw UUMMX @@ -396,7 +396,7 @@ too. Notice also how it showed the same output that my program gave it - `UUMMX` What about the other [Morse code entry](../../1998/dorssel/dorssel.c)? -``` +``` $ echo IOCCC | ./prog | ./dorssel ..- ..- -- -- -..- ``` @@ -441,7 +441,7 @@ The parser is in a sense rather rudimentary but allows for both interactive and automatic (e.g. via the [recode](recode.c) program) input. This does mean that something like the following can happen: -``` +``` $ ./prog - Ring 1: 1AB Setting 1: Position 1: Ring 2: 2CD @@ -504,7 +504,7 @@ should help you remember (though not at this time in our world it might help you later on?). This might become even more useful after the challenge is accepted, accomplished and made use of! :) -``` +``` $ echo ABC | ./prog GYM $ echo ABC | ./prog | ./prog @@ -536,7 +536,7 @@ ended his life. (I later made a bug fix but I consider this inconsequential). As for [recode.c][] though I really love this: -``` +``` /\ / This is *not* what you think: ``` @@ -552,13 +552,13 @@ It's an [Enigma machine](https://en.wikipedia.org/wiki/Enigma_machine) simulator that proof that it's obfuscated itself?! :) Silliness aside [obfuscation.txt][] has some of the ways I think this entry is obfuscated. To decipher try: -``` +``` ./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > obfuscation.md ``` To encipher: -``` +``` ./recode -Robfuscation.key -fobfuscation.md | ./prog - 2>/dev/null > obfuscation.txt ``` diff --git a/2020/ferguson2/obfuscation.md b/2020/ferguson2/obfuscation.md index 4d0ea37bc..889d94669 100644 --- a/2020/ferguson2/obfuscation.md +++ b/2020/ferguson2/obfuscation.md @@ -19,13 +19,13 @@ there is an aesthetic appeal to my eyes too). Y<:19:><:27:> but it's not the only example. Here the compound literal of 13 ints: -``` +``` int *z=(int[13]) { 0 } , *e, *g; ``` Then in main: -``` +``` e = z + 10; g = e + 1; @@ -39,14 +39,14 @@ ints: more confusing still. There are at least two other ways that are much easier to read that could accomplish the same thing. It continues on: -``` +``` /* ... */ e<:i-3:> = (j < 1 ? 1 : (j > 5 ? 5 : j))-1; ``` * Observe these two functions: -``` +``` void w(char *s, int k, int v) { for(e<:2:> = 0; s<:*P:>; ++e<:2:>) @@ -96,7 +96,7 @@ temporary variable instead of a regular int in the function (so make it global); and (2) I didn't want to risk changing all the offsets: thus I just made that address `e[1]`. Thus I also have: -``` +``` for (*g = 0 ; *g < 10; ++*g) { r<:-2:> = Y<:14:><:*(e+1):>; r<:-3:> = Y<:15:><:1<:e:>:>; @@ -117,7 +117,7 @@ address `e[1]`. Thus I also have: * The above function Z() takes a `char x` but you won't notice it being used at all. Why? In fact I call it like so: -``` +``` k = Z(r<:-1:>=k); ``` @@ -132,7 +132,7 @@ at all. Why? In fact I call it like so: refer to the same variable in more than one way (or in some cases maybe more correct to say 'same location'). In the Z() function for example: -``` +``` r<:-2:> = Y<:14:><:*(e+1):>; r<:-3:> = Y<:15:><:1<:e:>:>; ``` @@ -153,7 +153,7 @@ index (sort of). * Another set of char arrays in one: the five rotors as well as the two reflectors in one `char [][27]`. This makes for some fun code like: -``` +``` (Y<:e<:-10:>+5:><:k-'A':>) && (k = Y<:e<:-10:>+5:><:k-'A':>); ``` @@ -194,7 +194,7 @@ enough because as they rightly point out they can just use the C preprocessor itself. But although I have quite a few cpp directives I am not using them for obfuscation but rather to save bytes. For examples: -``` +``` %:define J(x) do(*x)=getchar(); while((*x)=='\n') ``` @@ -205,7 +205,7 @@ obfuscation but rather to save bytes. For examples: particular I want to bring up though because I think it's a curious one and it ties in to another point above: -``` +``` %:define A(y) *(&Y<:7:><:1:>+(y)) ``` @@ -213,7 +213,7 @@ obfuscation but rather to save bytes. For examples: to the notch settings (I think it was the notch settings anyway). Now I could have done say -``` +``` char a = Y[7][1], b = Y[7][3], c = Y[7][5]; ``` @@ -248,7 +248,7 @@ variables in recode.c, move them to prog.c, compile and expect it to work right. * Also what is this about ? -``` +``` /\ / This is *not* what you think: void D(char*x){ /* ... */ } diff --git a/2020/ferguson2/recode.md b/2020/ferguson2/recode.md index 42536b2dd..65072a7b4 100644 --- a/2020/ferguson2/recode.md +++ b/2020/ferguson2/recode.md @@ -55,7 +55,7 @@ wonderful 'challenge' for everyone. #
Options -``` +``` ./recode -h usage: ./recode [options] -v display selected settings @@ -71,7 +71,7 @@ if you don't give the option to read in a file for input. `-v` shows selected settings. For example combining `-r` and `-v`: -``` +``` $ echo IOCCC | ./recode -r -v Ring 1: ( I) EKMFLGDQVZNTOWYHXUSPAIBRCJ Ring 2: ( V) VZBRGITYUPSDNHLXAWMJQOFECK @@ -104,7 +104,7 @@ encipherment/decipherment). If the file cannot be opened it sets back to stdin. or is the same file name (see below) then only stdout will be used. Example of randomised output going to a file: -``` +``` $ ./recode -r -oconfig IOCCC 3PP4UB5GG1ELGTKFCOPVBNUYXJAWSDIOCCC @@ -143,7 +143,7 @@ what about if one exists but the other does not? Due to the way the parsing of options is done (no spaces between option char and argument) shell expansion will not work right so for example doing: -``` +``` $ ./recode -R~/config ``` @@ -163,7 +163,7 @@ the program interactively. If stdin is not a tty (`!isatty(0)`) and neither randomised mode nor reading in from a file is specified then you might just see something like: -``` +``` $ echo testing test tests | ./recode 1AB2BB3CC1testing test tests @@ -189,7 +189,7 @@ input manually (if you randomise or read in from previously saved file no input need be done at all) then make sure to redirect stderr to /dev/null. If you don't you might see something like: -``` +``` $ ./recode -r | ./prog - Ring 1: IOCCC Setting 1: Position 1: Ring 2: Setting 2: Position 2: Ring 3: Setting 3: Position 3: Reflector: Plugboard pair 1: Plugboard pair 2: Plugboard pair 3: Plugboard pair 4: Plugboard pair 5: Plugboard pair 6: Plugboard pair 7: Plugboard pair 8: Plugboard pair 9: Plugboard pair 10: DEVIY @@ -205,7 +205,7 @@ That's why after I sent EOF it printed out the remaining strings to stderr. # Manually test the recode program with the Enigma program -``` +``` $ cat input IOCCC @@ -249,7 +249,7 @@ than the simulator: because with the size restrictions on my entry I saved bytes by using the same loop where I could. It just felt more natural to have them grouped together in a configurator for the [simulator](prog.c). -``` +``` $ echo 1AA2AA3AA2ABCD..EFGHIJKLMNOPQRIOCCC | ./prog - 2>/dev/null HQNVO $ echo 1AA2AA3AA2ABCD..EFGHIJKLMNOPQRIOCCC | ./prog - 2>/dev/null | echo 1AA2AA3AA2ABCD..EFGHIJKLMNOPQRHQNVO | ./prog - 2>/dev/null @@ -273,21 +273,21 @@ What happens if the plugboard pairs are the same but in a different order? It's the same output: -``` +``` $ echo 1AA2AA3AA2AB..CDEFGHIJKLMNOPQRIOCCC|./prog - 2>/dev/null HQNVO ``` Also if you flip the order of the letters in the pair e.g. the AB as BA instead: -``` +``` $ echo 1AA2AA3AA2BA..CDEFGHIJKLMNOPQRIOCCC|./prog - 2>/dev/null HQNVO ``` # Only write config file -``` +``` $ ./recode -v -oconfig -finput >/dev/null Rotors: (1) I: EKMFLGDQVZNTOWYHXUSPAIBRCJ @@ -345,7 +345,7 @@ pair. This is because it consumes input overflow. It shouldn't be this way for the simulator though because that could cause inconsistent number of characters expected before the text to encipher. -``` +``` $ cat config 1AB2CD3EF2ABCDEFGHIJKLMNOPQRST @@ -363,7 +363,7 @@ directly type ctrl-d (or whatever you have EOF set to) or give it an empty file. The following are all equivalent in that they will write to a settings file (the first one will print a newline with the echo but that won't matter): -``` +``` $ echo | ./recode -r -osettings $ echo -n | ./recode -r -osettings $ > empty @@ -380,7 +380,7 @@ set another variable to indicate if it should be printed.) # Reusing a configuration -``` +``` $ echo -n|./recode -r -oconfig 4UH5II1RJ1SPIFEJLYGZWRTBHVCAMN$ @@ -405,7 +405,7 @@ set another variable to indicate if it should be printed.) Alternatively you can just use the `-R` and `-f` options: -``` +``` $ ./recode -finput.txt -Rconfig | ./prog - 2>/dev/null > output2 $ diff output output2 $ @@ -456,7 +456,7 @@ participants of the IOCCC do). Other things there don't mean anything but what does is the output: -``` +``` $ cat output DBFAF 2020 Ittejg ltblwriac uqdfqvr dhqh ghhf @@ -477,7 +477,7 @@ does is the output: This is like the above only randomised: -``` +``` $ ./recode -r -oconfig|./prog - 2>/dev/null IOCCC UGEVP @@ -489,14 +489,14 @@ the config file (for deciphering later) and then all of it was piped to the Enigma entry resulting in the line below IOCCC. But let's verify it worked out okay: -``` +``` $ cat config 2BM4GJ3HK1LNCBXWRMGKSYIAZUTPVJ ``` Without having to copy/paste intermediate results: -``` +``` $ echo IOCCC | ./recode -Rconfig | ./prog - 2>/dev/null | ./recode -Rconfig | ./prog - 2>/dev/null IOCCC ``` @@ -504,7 +504,7 @@ Without having to copy/paste intermediate results: You can also use a string for the `-R` option. I'll use command substitution and actual pasting to demonstrate: -``` +``` $ echo IOCCC | ./recode -R$(cat config) | ./prog - 2>/dev/null | ./recode -R2BM4GJ3HK1LNCBXWRMGKSYIAZUTPVJ | ./prog - 2>/dev/null IOCCC ``` @@ -612,7 +612,7 @@ the key you wish to select is you can do: -``` +``` ./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fencrypted.html | ./prog - 2>/dev/null > decrypted.html ``` diff --git a/2020/giles/README.md b/2020/giles/README.md index 8c3c444c9..92ec47c3c 100644 --- a/2020/giles/README.md +++ b/2020/giles/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,7 +18,7 @@ For more detailed information see [2020 giles bugs](../../bugs.html#2020_giles). ## To use: -``` +``` ./prog < dtmf.wav ./prog [digits] > digits.wav @@ -33,7 +33,7 @@ will be converted to the DTMF sound! ## Try: -``` +``` ./try.sh ./prog < pi.wav @@ -71,7 +71,7 @@ exactly 16 bits per sample, but it allows any sample rate and any number of audio channels. -``` +``` $ ./prog < pi.wav 31415926 ``` @@ -80,7 +80,7 @@ If the program is executed with a command-line argument, it will generate the tones corresponding to the specified characters, writing them to standard output as a WAV file. -``` +``` $ ./prog 867-5309 | aplay ``` diff --git a/2020/kurdyukov1/README.md b/2020/kurdyukov1/README.md index 1102c11b6..f04930f00 100644 --- a/2020/kurdyukov1/README.md +++ b/2020/kurdyukov1/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,7 +10,7 @@ code](#alternate-code) below for more details. ## To use: -``` +``` ./prog # input some text @@ -22,7 +22,7 @@ code](#alternate-code) below for more details. ## Try: -``` +``` ./try.sh ``` @@ -46,7 +46,7 @@ are the program in assembly for x86_64 linux and x86 linux respectively. To build [prog.alt.c](prog.alt.c): -``` +``` make alt ``` diff --git a/2020/kurdyukov2/README.md b/2020/kurdyukov2/README.md index dfbaebff7..f03104e1c 100644 --- a/2020/kurdyukov2/README.md +++ b/2020/kurdyukov2/README.md @@ -1,20 +1,20 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog ``` ## Try: -``` +``` # Take a selfie ./prog 1000 selfie.jpg output.jpg # Admire your portrait in cubist style @@ -41,7 +41,7 @@ This program divides the image into a specified number of rectangles. This process is content aware, so the algorithm tries to match most of the information. However, it doesn't find the best theoretically possible layout. -``` +``` ./prog 1000 input.jpg output.jpg ``` @@ -56,13 +56,13 @@ If you want to use `libjpeg` compiled from sources, then use the `LIBJPEG` defin specify the path to includes and the library. For example using [libjpeg source](https://mac-dev-env.patrickbougie.com/libjpeg/) version 9c: -``` +``` make prog LIBJPEG="-Ijpeg-9c jpeg-9c/libjpeg.a" ``` Use this command to build a PNG version (you need `libpng`): -``` +``` make prog_png LIBPNG="-lpng" ``` @@ -80,13 +80,13 @@ information! First, make sure you have the compiler tools installed e.g. by: -``` +``` sudo xcode-select --install ``` Make sure you install [MacPorts](https://www.macports.org/install.php). Then do: -``` +``` sudo port install jpeg libpng ImageMagick ``` @@ -95,7 +95,7 @@ GIFs from the results using `makegif.sh`. After that’s installed you need to run make with these options: -``` +``` make LDFLAGS="-I/opt/local/include -L/opt/local/lib" ``` @@ -103,7 +103,7 @@ After that’s installed you need to run make with these options: First, make sure you have the compiler tools installed e.g. by: -``` +``` sudo xcode-select --install ``` @@ -111,14 +111,14 @@ Make sure you install [Homebrew](https://brew.sh). Then: -``` +``` brew install libjpeg libpng eval "$(brew shellenv)" ``` You are now ready to compile this entry: -``` +``` make clobber all ``` @@ -139,7 +139,7 @@ vertically to get the minimum difference. You can use this command to make a GIF from output images (uses ImageMagick). For instance after running the command suggested by the judges: -``` +``` convert -delay 10 -dither none -loop 0 $(find . -maxdepth 1 -type f -name '*jpg' | sort -V) $(find . -maxdepth 1 -type f -name '*jpg' | sort -rV) +map out.gif ``` diff --git a/2020/kurdyukov3/README.md b/2020/kurdyukov3/README.md index 00eb7ec78..45497fee7 100644 --- a/2020/kurdyukov3/README.md +++ b/2020/kurdyukov3/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -10,14 +10,14 @@ code](#alternate-code) below. ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -29,7 +29,7 @@ The alternate version, [prog.alt.c](prog.alt.c), has the main code as a macro. ### Alternate build: -``` +``` make alt ``` @@ -61,7 +61,7 @@ exactly what it says nonetheless. Compile and try this: -``` +``` cat input.txt | ./prog ``` diff --git a/2020/kurdyukov4/README.md b/2020/kurdyukov4/README.md index 56314f481..405a69f3a 100644 --- a/2020/kurdyukov4/README.md +++ b/2020/kurdyukov4/README.md @@ -1,13 +1,13 @@ ## To build: -``` +``` make ``` ## To use: -``` +``` ./prog text_file output_length context_length random_seed ``` @@ -17,7 +17,7 @@ When running this, ask yourself why it gets progressively slower when the context length decreases: -``` +``` ./try.sh ``` @@ -70,7 +70,7 @@ Now can you appreciate the award title a bit better? ### Building: -``` +``` cc prog.c -o prog ``` @@ -79,7 +79,7 @@ Now can you appreciate the award title a bit better? This program generates random text from the provided dictionary using a Markov chain, outputting to `stdout`. -``` +``` ./prog input.txt 2000 10 12345 ``` @@ -110,7 +110,7 @@ You can try this with the inputs provided with [2019/mills](../../2019/mills/index.html) from the IOCCC entries. -``` +``` $ ./prog Shakespeare.txt 2001 10 12345 ``` diff --git a/2020/otterness/README.md b/2020/otterness/README.md index fce019a44..0f3317cdd 100644 --- a/2020/otterness/README.md +++ b/2020/otterness/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -18,14 +18,14 @@ For more detailed information see [2020 otterness bugs](../../bugs.html#2020_ott ## To use: -``` +``` ./prog ``` ## Try: -``` +``` ./try.sh ``` @@ -74,7 +74,7 @@ for most of my testing (see [cvikl.mid](cvikl.mid)). Compile the program using the following command (I tested this using both `clang` and `gcc`): -``` +``` cc -pedantic -Wall -Werror -Wextra -O3 -o prog prog.c ``` diff --git a/2020/tsoj/README.md b/2020/tsoj/README.md index f3300a74d..7a7a43f46 100644 --- a/2020/tsoj/README.md +++ b/2020/tsoj/README.md @@ -1,6 +1,6 @@ ## To build: -``` +``` make ``` @@ -11,14 +11,14 @@ to those familiar with vi. See [Alternate code](#alternate-code) below. ## To use: -``` +``` ./prog ``` ## Try: -``` +``` # Make your terminal as large as possible, possibly reduce your font size # then... ./prog @@ -33,14 +33,14 @@ where instead of `w`, `a`, `s` and `d`, you can use `k`, `h`, `j` and `l`. ### Alternate build: -``` +``` make alt ``` ### Alternate use: -``` +``` # Make your terminal as large as possible, possibly reduce your font size # then... ./prog.alt diff --git a/2020/yang/README.md b/2020/yang/README.md index 7e0bccf2a..935eb9a02 100644 --- a/2020/yang/README.md +++ b/2020/yang/README.md @@ -1,20 +1,20 @@ ## To build: -```--> +``` make ``` ## To use: -```--> +``` ./prog [PIN] < input.txt > output.c ``` ## Try: -```--> +``` ./try.sh ``` @@ -22,7 +22,7 @@ The author provided the file [cppp.cc](cppp.cc) which can preprocess the generated output to make them more acceptable to typical compilers. To build: -```--> +``` make cppp ``` @@ -44,7 +44,7 @@ spoiler](spoiler.html) that shows how this entry was written. ### Synopsis -```--> +``` echo "Hello world" | ./prog 12345 > encoded.c gcc -DPIN=12345 encoded.c -o ./decoded && ./decoded @@ -63,14 +63,14 @@ Mile is a C code generator. Run without arguments for the help message below: When run with an encoding PIN (first command line argument), Mile will read bytes from `stdin` and generate C code on `stdout`. Example: -```--> +``` echo "Hello, world!" | ./prog 56789 > encoded.c ``` This generated code will reproduce the same input bytes on `stdout` when executed, if it was compiled with the same encoding PIN. -```--> +``` gcc -DPIN=56789 encoded.c -o decoded ``` diff --git a/2020/yang/index.html b/2020/yang/index.html index 97e3497a5..02af211f4 100644 --- a/2020/yang/index.html +++ b/2020/yang/index.html @@ -141,14 +141,14 @@ Location: US - United States of America

To build:

-
    make
+
    make

To use:

-
    ./prog [PIN] < input.txt > output.c
+
    ./prog [PIN] < input.txt > output.c

Try:

-
    ./try.sh
+
    ./try.sh

The author provided the file cppp.cc which can preprocess the generated output to make them more acceptable to typical compilers. To build:

-
    make cppp
+
    make cppp

See the author’s remarks for more details.

Judges’ remarks:

You might think of this entry as code obfuscater with a code. @@ -159,7 +159,7 @@ What is compiling this entry about? spoiler that shows how this entry was written.

Author’s remarks:

Synopsis

-
    echo "Hello world" | ./prog 12345 > encoded.c
+
    echo "Hello world" | ./prog 12345 > encoded.c
 
     gcc -DPIN=12345 encoded.c -o ./decoded && ./decoded

Details

@@ -169,10 +169,10 @@ spoiler that shows how this entry was written.

where [PIN] is an integer in the range of 1..65535

When run with an encoding PIN (first command line argument), Mile will read bytes from stdin and generate C code on stdout. Example:

-
    echo "Hello, world!" | ./prog 56789 > encoded.c
+
    echo "Hello, world!" | ./prog 56789 > encoded.c

This generated code will reproduce the same input bytes on stdout when executed, if it was compiled with the same encoding PIN.

-
    gcc -DPIN=56789 encoded.c -o decoded
+
    gcc -DPIN=56789 encoded.c -o decoded

The generated code reconstructs all data at compile time by seeding a random number generator with the given PIN to reproduce the input bytes, and simply does one fwrite(3) call at run time to print those bytes. Not diff --git a/README.md b/README.md index bbf9e640b..b72c1fc27 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ If you have the energy to type in the text, or if you have access to a machine readable version of these programs, you should next consider some preprocessing such as: -``` +``` sed -e '/^#.*include/d' prog.c | cc -E ``` diff --git a/archive/historic/README.md b/archive/historic/README.md index a9238d640..bde47ce9c 100644 --- a/archive/historic/README.md +++ b/archive/historic/README.md @@ -79,7 +79,7 @@ Machine](https://web.archive.org) as of [2022 Dec *HINT*: To uncompress a given bzip2 compressed tarball file, use: -``` +``` tar -jxvf file.tar.bz2 ``` @@ -88,7 +88,7 @@ where "_file.tar.bz2_" is the name of a file found in this directory. To uncompress all of the 2022 Dec 28 archive using the year based bzip2 compressed tarball files: -``` +``` for year in 198{4,5,6,7,8,9} 199{0,1,2,3,4,5,6,8} 200{0,1,4,5,6} 201{1,2,3,4,5,8,9} 2020; do rm -rf "$year" tar -jxvf "archive-$year.tar.bz2" diff --git a/author/README.md b/author/README.md index c5659e645..61e99dbb3 100644 --- a/author/README.md +++ b/author/README.md @@ -15,7 +15,7 @@ where `author_handle` is defined below. Each author of a winning IOCCC entry has an assigned `author_handle`, an IOCCC unique string that matches this regex: -``` +``` ^[0-9a-z][0-9a-z_]*$ ``` @@ -48,7 +48,7 @@ anonymous author in a given year. Anonymous author_handle's match this regexp: -``` +``` Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$ ``` @@ -56,14 +56,14 @@ Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$ The `author_handle.json` must have the following JSON members: -``` +``` "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", "author_JSON_format_version" : "0.1 2023-05-22", ``` There must be the following JSON members: -``` +``` "full_name" : "Your Full Name", "sort_word" : "lowercaselast", "location_code" : "XX", @@ -80,13 +80,13 @@ an `author` and the entry they submitted are to be listed. A `sort_word` matches this regexp: -``` +``` ^[a-z][0-9a-z]* ``` And there must be the following JSON members: -``` +``` "email" : "user0@example.com", "url" : "https://a.host0.example.com/index.html", "alt_url" : "https://b.host0.example.com/index.html", @@ -109,7 +109,7 @@ And there must be the following JSON members: If an author does not have one of the previous set of values, or wishes to not disclose it / keep it anonymous, then the JSON value can be `null`. For example: -``` +``` "email" : null, "url" : null, "alt_url" : null, @@ -125,7 +125,7 @@ NOTE: The JSON value of `null` is NOT enclosed in double quotes. The `"winning_entry_set"` is an array of JSON members that indicate each of the IOCCC winning entries that the author is the author of. :-) -``` +``` { "entry_id" : "YYYY_dirname" } ``` @@ -136,7 +136,7 @@ of the winning entry under the given year directory. NOTE: Due to mis-features in the JSON spec, the final JSON member must NOT be followed by a comma. For example: -``` +``` "winning_entry_set" : [ { "entry_id" : "1987_somedir" }, { "entry_id" : "2020_entrydir" }, @@ -148,7 +148,7 @@ For example: Here is a fictitious author_handle.json example: -``` +``` { "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", "author_JSON_format_version" : "1.0 2023-06-10", @@ -176,7 +176,7 @@ Here is a fictitious author_handle.json example: Here is fictitious author_handle.json example where all entries that may be withheld are null: -``` +``` { "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", "author_JSON_format_version" : "1.0 2023-06-10", diff --git a/bin/README.md b/bin/README.md index 1129af50d..a4ac666ad 100644 --- a/bin/README.md +++ b/bin/README.md @@ -18,13 +18,13 @@ Run a command on all winning entries. For example: -``` +``` bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1 ``` Or for example: -``` +``` bin/all-run.sh -v 3 bin/readme2index.sh -v 1 ``` @@ -35,19 +35,19 @@ Run a command on all IOCCC years. For example: -``` +``` bin/all-years.sh -v 1 bin/gen-year-index.sh -v 1 ``` Or for example: -``` +``` bin/all-years.sh -v 1 bin/chk-entry.sh ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make verify_entry_files ``` @@ -59,7 +59,7 @@ Check that files required by an entry match the entry's manifest as found in For example: -``` +``` bin/chk-entry.sh 2020/ferguson1 ``` @@ -70,7 +70,7 @@ Generate the list of files in the entry's manifest, `.entry.json`. For example: -``` +``` awk -f bin/filelist.entry.json.awk 2020/ferguson1/.entry.json ``` @@ -81,7 +81,7 @@ Generate the top level `/authors.html` page. Usage: -``` +``` bin/gen-authors.sh -v 1 ``` @@ -92,7 +92,7 @@ Generate the top level `/location.html` page. Usage: -``` +``` bin/gen-location.sh -v 1 ``` @@ -104,7 +104,7 @@ files. Usage: -``` +``` bin/gen-other-html.sh -v 1 ``` @@ -115,13 +115,13 @@ Generate an XML sitemap for the IOCCC web site. Usage: -``` +``` bin/gen-sitemap.sh -v 1 ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make gen_sitemap ``` @@ -135,31 +135,31 @@ Without argument, the `contest_status` is unchanged. Usage: -``` +``` bin/gen-status.sh -v 1 ``` To force the `contest_status` to be closed: -``` +``` bin/gen-status.sh -v 1 closed ``` To force the `contest_status` to be open: -``` +``` bin/gen-status.sh -v 1 open ``` To see other valid statuses: -``` +``` bin/gen-status -h ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make gen_status ``` @@ -170,7 +170,7 @@ Generate a number of top level HTML pages for the IOCCC web sites. Usage: -``` +``` bin/gen-top-html.sh -v 1 ``` @@ -191,7 +191,7 @@ Examples of top level HTML pages built by this tool include: We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make gen_top_html ``` @@ -202,13 +202,13 @@ Generate an `index.html` page for an given IOCCC year. Usage: -``` +``` bin/gen-year-index.sh -v 1 2020 ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make gen_year_index ``` @@ -219,13 +219,13 @@ Generate the top level `/years.html` page. Usage: -``` +``` bin/gen-years.sh -v 1 ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make gen_years ``` @@ -279,7 +279,7 @@ If only a few `index.hmtl` files need updating, then this command will only briefly pause while the slightly longer [readme2index.sh](readme2index.sh) is run: -``` +``` bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1 ``` @@ -289,7 +289,7 @@ and `index.html` are correct. If in doubt, use: We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make quick_entry_index ``` @@ -298,19 +298,19 @@ make quick_entry_index Convert an entry README.md into entry directory index.html. -``` +``` bin/all-run.sh -v 3 bin/readme2index.sh -v 1 ``` To build `index.html` files for all entries: -``` +``` bin/all-run.sh -v 3 bin/readme2index.sh -v 1 ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make entry_index ``` @@ -341,19 +341,19 @@ Sort a .gitignore in a entry directory. Usage: -``` +``` bin/sort.gitignore.sh -v 1 YYYY/dir ``` Suggested usage: -``` +``` bin/all-run.sh bin/sort.gitignore.sh -v 1 ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make sort_gitignore ``` @@ -389,13 +389,13 @@ Form a compressed tarball for an entry. Usage: -``` +``` bin/tar-entry.sh -v 1 YYYY/dir ``` Suggested usage: -``` +``` bin/all-run.sh -v 3 bin/tar-entry.sh -v 1 -W ``` @@ -406,19 +406,19 @@ Form a compressed tarball for an IOCCC year. Usage: -``` +``` bin/tar-year.sh -v 1 YYYY ``` Suggested usage: -``` +``` bin/all-years.sh -v 3 bin/tar-year.sh -v 1 -W ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make form_year_tarball ``` @@ -429,19 +429,19 @@ Untar an entry's a compressed tarball. Usage: -``` +``` bin/untar-entry.sh -v 1 YYYY/dir ``` Suggested usage: -``` +``` bin/all-run.sh -v 3 bin/untar-entry.sh -v 1 ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make untar_entry_tarball ``` @@ -452,19 +452,19 @@ Untar an IOCCC year's compressed tarball. Usage: -``` +``` bin/untar-year.sh -v 1 YYYY ``` Suggested usage: -``` +``` bin/all-years.sh -v 3 bin/untar-year.sh -v 1 ``` We recommend that this tool be invoked via the top level `Makefile`: -``` +``` make untar_year_tarball ``` @@ -494,14 +494,14 @@ the file name form: By using command line options of the form: -``` +``` -H phase=name ``` where `phase` is the name of an HTML phase, a non-default file may be used. For example: -``` +``` -H topnav=up2index ``` @@ -512,7 +512,7 @@ used during the _topnav_ HTML phase. If `name` is dot (i.e., `.`), then the given HTML phase is skipped. For example: -``` +``` -H footer=. ``` @@ -861,7 +861,7 @@ a POSIX safe string with the addition of `+` (for technical reasons beyond this document). In particular, the `author_handle` must be an ASCII string that matches this regexp: -``` +``` ^[0-9A-Za-z][0-9A-Za-z._+-]*$" ``` @@ -900,7 +900,7 @@ in the case of [2005/anon](../2005/anon/anon.c). Anonymous `author_handle`'s match this regexp: -``` +``` Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$ ``` @@ -932,7 +932,7 @@ Non-numeric `year` strings are lower case. A `year` string matches this regexp: -``` +``` [0-9a-z][0-9a-z][0-9a-z][0-9a-z] ``` @@ -957,7 +957,7 @@ A `dir` is a POSIX safe string that holds an entry. A `dir` is a string that matches this regexp: -``` +``` ^[a-z][0-9a-z.-]*$ ``` diff --git a/bugs.md b/bugs.md index f804ccb9b..318c76729 100644 --- a/bugs.md +++ b/bugs.md @@ -421,7 +421,7 @@ own fix or suggest that they're fixed! The purpose of this program is to print out a string of rubbish. In particular you should see something like: -``` +``` $ ./decot '",x); /* \ @@ -527,7 +527,7 @@ With version 2 it sometimes segfaults even with the same input where other times it does not. We don't believe this is because of the fix that lets some versions be compiled with clang. An example invocation is: -``` +``` ./ver2 < westley.c ``` @@ -575,7 +575,7 @@ The comments are processed too. Furthermore it happens that the last line becomes the first and the first line becomes the last! Now if you look at the code you'll see on the first line: -``` +``` /**//*/};)/**/pain(*//**/tang ,gnat/**//*/,ABBA~,0-0(avnz;)0-0,tang,raeN ``` @@ -583,13 +583,13 @@ In `ver0` it'll be the same but the others are more interesting. In `ver1` you'll see on the last line: -``` +``` cnva((vag)NOON&2/*//*\\**/,gnat,tang ,NOON/**//*/(niam/**/);}/*//**/ ``` and on the first line: -``` +``` /**//*/};)/**/cnva(*//**/gnat ,tang/**//*/,NOON~,0-0(niam;)0-0,gnat,enrA ``` @@ -653,7 +653,7 @@ A point worth considering is that as the number passed into the program gets bigger the number of lines of output gets substantially larger and it takes much more time and resources to run as well. For instance: -``` +``` $ for n in $(seq 1 18); do echo "$n"; echo "$n" | time "./baruch" | wc -l | sed -E -e 's/[[:space:]]//g'; done 1 3 @@ -726,7 +726,7 @@ Endoh](../authors.html#Yusuke_Endoh) provided the `btoa` script but it appears there is a bug in this entry. The judges wrote that to test the entry one can do: -``` +``` echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw ``` @@ -735,7 +735,7 @@ sentence. But doing this shows instead: -``` +``` echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw a얖?)V...?????777??hC??h??-? )SSSSXXX????r?L=???*?-???ppp,,,?R ?j @@ -748,7 +748,7 @@ Notice how there's no newline at the end: that final `$` is the prompt. If one does, however: -``` +``` echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw | ./jaw ``` @@ -844,7 +844,7 @@ that that is the error message. Another thing is that the code: -``` +``` printf((W,Y)); ``` @@ -887,7 +887,7 @@ Leo Broukhis, before he was an IOCCC judge, sent the IOCCC judges an email: A quick debugging session from Cody suggests that the problem with this value is that: -``` +``` if ( ppp->qq!=48 ) return; ``` @@ -895,7 +895,7 @@ is never reached because the value is never 48 (it is in other cases but not for the example input). It varies in value at this point. Observe that the next lines of code are: -``` +``` while ( ppp->qq==48 ) { printf("%ld\n",qqq-45); @@ -911,7 +911,7 @@ for the `!= 48` is also required. Perhaps more useful to know is that at this point in the code the code: -``` +``` if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa ))))) ``` @@ -1066,7 +1066,7 @@ at 80 columns. However due to the nature of the program if the terminal is < 80 in column width it will not display right. To see the number of columns in your terminal try: -``` +``` echo $COLUMNS ``` @@ -1076,7 +1076,7 @@ terminal try: The author suggested that the alternate version, which Cody added (but fixed for modern systems), should print -``` +``` main(l,a,n,d)... [A M E R I C A]... ``` @@ -1165,7 +1165,7 @@ fixed except for an exercise to yourself, should you wish to try. This program uses `system(3)` so if you provide invalid characters in the question you might cause an error. For instance don't do this: -``` +``` $ ./schnitzi schnitzi.info This program answers questions about paragraphs of text posed to it in English. It is written @@ -1277,7 +1277,7 @@ below. You might wish to run the command: -``` +``` make diff_orig_prog ``` @@ -1285,7 +1285,7 @@ to see what had to change for the buffer size, when looking at the below. Furthermore you will want to look at: -``` +``` diff schnitzi.alt.c schnitzi.alt2.c ``` @@ -1337,7 +1337,7 @@ h If you join the lines you end up with: -``` +``` #include ``` @@ -1364,7 +1364,7 @@ To say just how sensitive this entry is: even a space, lack of space or a character, wrong character, lack of character or character in the wrong place can cause a compilation error! Make sure that the output of: -``` +``` ./schnitzi < schnitzi.c ``` @@ -1464,7 +1464,7 @@ it calls `getchar()` via the pointer `m`. So this is a feature not a bug. The judges suggested that the following commands should result in output: -``` +``` ./leo 1 | cat - /dev/tty | gs - ./leo 37 80 | cat - /dev/tty | gs - @@ -1472,7 +1472,7 @@ The judges suggested that the following commands should result in output: The first one can work if one does instead: -``` +``` echo "" | ./leo 1 > foo.ps gs foo.ps ``` @@ -1534,7 +1534,7 @@ almost be done except that some of the output of the This diff almost does it but not quite: -``` +``` diff --git i/1996/huffman/huffman.c w/1996/huffman/huffman.c index a5745bc7f4fa28b834c004f4cf19633e40ad9165..5e5e5334f33f9dbd95c70eddece3189d9bcff5e9 100644 --- i/1996/huffman/huffman.c @@ -1622,7 +1622,7 @@ See above entry [1998/dlowe](1998/dlowe/dlowe.c). A point worth considering is that as the number passed into the program gets bigger the number of lines of output gets substantially larger. For instance: -``` +``` $ ./schnitzi 9|wc -l 771999 ``` @@ -1653,7 +1653,7 @@ There was no IOCCC in 1999. The author gives an example command: -``` +``` echo "7 P 6 d P P 8 p" | ./dlowe | tr 876 tpo ``` @@ -1667,7 +1667,7 @@ see that it does indeed crash! The reason for this not working is really strange. -``` +``` $ echo "7 P 6 d P P 8 p" | ./dlowe 7668 $ echo "7 P 6 d P P 8 p" | ./dlowe | grep 7 @@ -1676,21 +1676,21 @@ The reason for this not working is really strange. Why? Is it writing to stdout? Let's try some other things: -``` +``` $ echo 7668 | tr 876 tpo poot ``` Okay so we know that it SHOULD work. But we also know something funny is going on with stdout and the entry. Another experiment: -``` +``` $ echo "7 P 6 d P P 8 p" | ./dlowe 1>&2 | grep 7 7668 ``` Okay so now it sees it, `grep`. But watch! -``` +``` $ echo "7 P 6 d P P 8 p" | ./dlowe 2>foo 1>&1 7668 $ cat foo @@ -1698,7 +1698,7 @@ Okay so now it sees it, `grep`. But watch! .. so at this hour it does appear to be writing to stdout but yet somehow it doesn't? But watch: -``` +``` $ echo "7 P 6 d P P 8 p" | ./dlowe 1>foo 1>&1 $ cat foo $ @@ -1714,7 +1714,7 @@ with things but we don't know. Other commands do work, however, and give the appropriate output, such as: -``` +``` $ echo 1 2 + p | ./dlowe 3 ``` @@ -1723,7 +1723,7 @@ so something is wrong with some commands/operators. Another feature that does work in linux is: -``` +``` $ echo poot | ./dlowe poot was here! ``` @@ -1737,7 +1737,7 @@ C program except that it has the `#!/usr/bin/env perl` and `use warnings;` as well. A note below might suggest that doing this creates incomplete perl. Anyway: -``` +``` #include int main(void) { @@ -1763,7 +1763,7 @@ Anyway: Compiling this you can generate: -``` +``` #!/usr/bin/env perl use warnings;_:$_= <> ; defined or exit; @ARGV=split; __:$_= shift;defined or goto _; chomp ;(m*^\x70oO\x74$*i)?(print "$_ w\x61s h\145r\x65!\n"):((m*^\s\*(-?\d+(\.\d+)?)\s\*$*)?(push@SS ,$1):(&{chr(((ord)%39)+3**4)x2 } )); goto __; sub ff { @SS= ()} sub __{print "stack empty\n"} sub ss{$#SS<0 and goto & __; print $SS[$#SS]."\n"} sub SS{ $#SS<0 and goto &__ ; print pop @SS}sub _ { print "divide by zero\n"}sub ii{map{ print"$_\n" } reverse @SS} sub AUTOLOAD { print"unimplemented\n"} sub gg{ $#SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ $#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS[$#SS-1]=$SS[$#SS]-$SS[$#SS-1]; $SS[$#SS]-=$SS[$#SS-1]} ``` @@ -1791,7 +1791,7 @@ itself it will print what's on the stack (for example). To not get 'unimplemented' you can remove from the perl: -``` +``` sub AUTOLOAD { print"unimplemented\n"} ``` @@ -1803,7 +1803,7 @@ others too.) Here is an example run of several operations in the perl script after removing that subroutine: -``` +``` $ echo 5 5 p | ./dlowe.pl 5 $ echo 5 5 + p | ./dlowe.pl @@ -1843,7 +1843,7 @@ invalid input. But as can be seen by the input I (Cody) gave the input is not actually incorrect. It is also curious to note that it ends up printing what's on the stack at that point: -``` +``` $ echo 5 5 + p | ./dlowe.pl unimplemented 5 @@ -1860,7 +1860,7 @@ they said is in `Perl_sv_upgrade`. As this is documented it is not considered a bug to be fixed. For the curious this will crash in macOS. Cody notes that the code that crashes is: -``` +``` perl_eval_sv (newSVpv("_:$_= <> ; defined or exit; @ARGV" "=split; __:$_= shift;defined or goto _; chomp " @@ -1883,7 +1883,7 @@ code that crashes is: and in particular it appears that it is the perl itself. In other words if one changes it to be: -``` +``` perl_eval_sv(newSVpv("",0),0); ``` @@ -1895,7 +1895,7 @@ crash this makes sense. The example command above _should_ print: -``` +``` $ echo "13 14 15 16 17 + - * / p" | ./dlowe -0.0515873015873016 ``` @@ -1918,7 +1918,7 @@ of 92 warnings! Nonetheless neither works okay and both crash. This program does not do what you might think it does! Running it like: -``` +``` ./primenum 13 ``` @@ -2175,13 +2175,13 @@ Since the game never ends properly the score is not printed either. It appears that the crash happens in more than one place. For instance it has happened at -``` +``` XCheckMaskEvent(d, 4,&e) ``` but it's also happened at -``` +``` else XDrawPoint(d ,w,g,(l.s+=l.a)>>9, h=(l.c+=l.b)>>9) ``` @@ -2194,7 +2194,7 @@ In both cases the pointer `d` was corrupted: It is believed that it also happened at -``` +``` XDrawString(d,w,g,W/3,H/2,m,B); ``` @@ -2202,7 +2202,7 @@ in `J()` and for the same reason. The loop seems to be stuck in the call to `usleep(3)` like: -``` +``` usleep(p*200); ``` @@ -2240,7 +2240,7 @@ There was no IOCCC in 2003. Segmentation fault will occur in some systems. For instance on macOS with the arm64 chip: -``` +``` ./gavin > kernel ``` @@ -2262,7 +2262,7 @@ you have a fix? We welcome your help! Although not related some recent changes were made to 2004/gavin to let it compile under clang. The following patch was applied: -``` +``` diff --git a/2004/gavin/gavin.c b/2004/gavin/gavin.c index c967b7e..2082b49 100644 --- a/2004/gavin/gavin.c @@ -2291,7 +2291,7 @@ compile under clang. The following patch was applied: The original Makefile from 2004 had the following to say about this entry: -``` +``` # Special flags for the gavin entry # # FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 @@ -2521,7 +2521,7 @@ obnoxious in macOS as it shows it at runtime (redirecting `stderr` to `/dev/null` will silence it). The following diff will almost work but it crashes with at least `computer.tofu` input file: -``` +``` 12a13 #define gets(c) fgets((c),PI,stdin)&&(((c)[strlen((c))-1]='\0'),c!=NULL) ``` @@ -2733,7 +2733,7 @@ With `address` in linux: but it actually works. This code is: -``` +``` } else p++; W(c)} /* LINE 101 */ @@ -2742,13 +2742,13 @@ but it actually works. This code is: Okay but what about argument 2? Well `W` is defined as: -``` +``` #define W(c) e=memmove(e,x[(u)c], y[(u)c])+y[(u)c]; ``` so it would appear that -``` +``` x[(u)c] ``` @@ -2844,7 +2844,7 @@ Now with `address` sanitiser both linux and macOS crash at: which corresponds to the code: -``` +``` o rd(u v) { o *a = 0, **b = &a, **c = b + 32; @@ -3226,7 +3226,7 @@ is not. Again see his index.html for details. However it is also possible to not rely on the entry as the below shows. One should be able to do: -``` +``` echo 'No. I want chocolate!' | ./prog > chocolate.raw ./prog e < chocolate.raw @@ -3369,7 +3369,7 @@ loop printing whitespace. When you run it on a JSON file you will see something like: -``` +``` $ ./prog < ioccc.json > ioccc.html Assertion failed: (rulez), function C, file prog.c, line 124. Abort trap: 6 @@ -3507,7 +3507,7 @@ that they can work but it might end up that the scripts don't show any output anyway as they use the full alphabet. To test that it works one can have a script like: -``` +``` LC_ALL=C aäbcdefghijklmnoöpqrsßtuüvwxyz | LC_ALL=C grep .. | LC_ALL=de_DE.UTF-8 ./prog aäbcdefghijklmnoöpqrsßtuüvwxyz ``` @@ -3559,7 +3559,7 @@ This program will also very likely leave sockets lying about in the current working directory. For instance [Cody Boone Ferguson](authors.html#Cody_Boone_Ferguson) showed us this: -``` +``` $ ls -al |grep '^s' srwxr-xr-x 1 cody staff 0 Apr 6 08:19 .BDHFHALG= srwxr-xr-x 1 cody staff 0 Apr 6 08:15 .CGGHAMGC= @@ -3575,13 +3575,13 @@ to ignore sockets (it did at least in macOS). He provides the following tips on this situation. A simpler way to find sockets in the directory: -``` +``` file .*|grep socket|cut -f1 -d: ``` To delete them you can do: -``` +``` find . -exec file '{}' \;|grep socket|cut -f 1 -d: | xargs rm -f ``` diff --git a/contact.html b/contact.html index d706afac2..3a19f7a8b 100644 --- a/contact.html +++ b/contact.html @@ -145,8 +145,16 @@ problem has already been reported. If it has been reported, feel free to add a comment to the issue. If you do not find an it has been reported, then fee free to open a new IOCCC issue.

+

If you are trying to:

+
    +
  • Comment or make a suggestion on IOCCC rules - (see FAQ 0.5)
  • +
  • Comment or make a suggestion on IOCCC guidelines - (see FAQ 0.5)
  • +
  • Comment or make a suggestion on IOCCC tools - (see FAQ 0.5)
  • +
+

Those FAQ entries will help guide you on how to make public comments +and suggestion in the relevant places.

See the above FAQ entries for more details.

-

Try mastodon

+

Try mastodon

You may wish to follow us IOCCC on Mastodon as we use that platform to announce things such as the opening of a new IOCCC as well as winning entries of the IOCCC.

diff --git a/faq.html b/faq.html index 52466a4b3..03887867e 100644 --- a/faq.html +++ b/faq.html @@ -130,6 +130,7 @@
  • 0.2 - What should I put in my entry’s Makefile?
  • 0.3 - May I use a different source or compiled filename than prog.c or prog?
  • 0.4 - What platform should I assume for my entry?
  • +
  • 0.5 - How may I comment or make a suggestion on IOCCC rules, guidelines and tools?
  • Section 1 - History of the IOCCC

      @@ -405,6 +406,26 @@ If it can compile and run on Windows and/or Mac (see 2000/thadgavin for one example, amongst others), even better. Being able to compile with other compilers like clang is also a good thing.

      +

      FAQ 0.5: How may I comment or make a suggestion on IOCCC rules, guidelines and tools?

      +

      The IOCCC judges to welcome feedback on the IOCCC +rules, IOCCC guidelines +and on the IOCCC mkiocccentry tools.

      +

      To comment on the IOCCC rules or the +IOCCC guidelines please view the +GitHub discussions for this repo. +If there is an on-going discussion that seems relevant to what you +have to say, consider adding comments to that particular discussion. +Otherwise consider opening a new IOCCC repo +discussion.

      +

      To comment on IOCCC mkiocccentry tools, +please view the mkiocccentry repo discussions. +If there is an on-going discussion that seems relevant to what you +have to say, consider adding comments to that particular discussion. +Otherwise consider opening a new mkiocccentry +discussion.

      +

      As a very last resort and/or if you feel the need to engage in a private +discussion with the IOCCC judges, then see +How to contact the IOCCC.

      Section 1: History of the IOCCC

      FAQ 1.0: How did the IOCCC get started?

      One day (1984 March 23 to be exact), Larry Bassel and I (Landon Curt diff --git a/faq.md b/faq.md index 6259ffa5e..4e6c907e7 100644 --- a/faq.md +++ b/faq.md @@ -317,7 +317,7 @@ command that is compatible with GNU Make version 3.81. While your entry's source filename, as submitted, must be `prog.c`, your entry's `Makefile` may copy `prog.c` to a different filename as part of the compiling/building process. For example: -``` +``` all: desired_name desired_name: desired_name.c @@ -337,7 +337,7 @@ creates as part of the compiling/building process. You may also copy the compiled `prog` into a different file as part of compiling process. For example: -``` +``` different_name: prog rm -f $@ cp -f prog $@ @@ -867,7 +867,7 @@ winning entries page](../years.html). In general the best way to compile everything in an entry directory is to run: -``` +``` make clobber all ``` @@ -885,14 +885,14 @@ you can do from the top level directory: If you wish to only build alternate code you can do: -``` +``` make clobber alt ``` If you wish to not remove the entry binaries and only compile the additional alt versions: -``` +``` make alt ``` @@ -1105,7 +1105,7 @@ First, see the above note on [installing and starting Xorg](#X11_general). Install Xorg and related packages: -``` +``` sudo dnf install --skip-broken --best --exclude xorgxrdp --exclude xorgxrdp-glamor '*xorg*' 'libx*' 'libX*' 'fontconfig*' ``` @@ -1134,7 +1134,7 @@ macOS, preferably the most recent version](https://support.apple.com/macos). After it is installed, open the "XQuartz" application (usually located in `/Applications/Utilities/XQuartz.app`) by typing at the command line: -``` +``` open /Applications/Utilities/XQuartz.app ``` @@ -1168,7 +1168,7 @@ First, see the above note on [installing and starting Xorg](#X11_general). According to the [Debian Xorg wiki](https://wiki.debian.org/Xorg), installing X11 requires: -``` +``` sudo apt install xorg ``` @@ -1194,13 +1194,13 @@ See also: For systems that have the `dnf(1)` command: -``` +``` sudo dnf install --skip-broken --best --exclude xorgxrdp --exclude xorgxrdp-glamor '*xorg*' 'libx*' 'libX*' 'fontconfig*' ``` For systems that have the `yum(1)` command: -``` +``` sudo yum install --skip-broken --best --exclude xorgxrdp --exclude xorgxrdp-glamor '*xorg*' 'libx*' 'libX*' 'fontconfig*' ``` @@ -1228,7 +1228,7 @@ macOS with alternative methods for macOS and different package managers with Lin Execute the following as root or via sudo: -``` +``` dnf install SDL2 SDL2-devel sdl12-compat sdl12-compat-devel ``` @@ -1237,13 +1237,13 @@ in the above command. In the past it was said that one might need to run `make` like: -``` +``` make ... SDL2_INCLUDE_ROOT=/usr ``` or set the following environment variable: -``` +``` export SDL2_INCLUDE_ROOT=/usr ``` @@ -1266,7 +1266,7 @@ If you have not already done so, install [Homebrew](https://brew.sh). Then to install SDL and SDL2, execute the following command: -``` +``` brew install sdl2 sdl12-compat eval "$(opt/homebrew/bin/brew shellenv)" ``` @@ -1278,7 +1278,7 @@ If you haven't already, install [MacPorts](https://www.macports.org/install.php). Then run: -``` +``` sudo port install libsdl libsdl2 ``` @@ -1287,7 +1287,7 @@ If you haven't already, install Execute the following as root or via sudo: -``` +``` apt install libsdl1.2debian libsdl1.2-dev libsdl2-dev ``` @@ -1295,13 +1295,13 @@ and then try `make all` again. In the past it was said that one might need to run `make` like: -``` +``` make ... SDL2_INCLUDE_ROOT=/usr ``` or set the following environment variable: -``` +``` export SDL2_INCLUDE_ROOT=/usr ``` @@ -1346,7 +1346,7 @@ macOS with alternative methods for macOS and different package managers with Lin Execute the following as root or via sudo: -``` +``` dnf install ncurses ncurses-devel ``` @@ -1355,7 +1355,7 @@ Execute the following as root or via sudo: With macOS it should already be installed. If it is not you might have to do: -``` +``` xcode-select --install ``` @@ -1376,7 +1376,7 @@ Not applicable, see above. Execute the following as root or via sudo: -``` +``` apt install libncurses6 ``` @@ -1409,7 +1409,7 @@ install depends on your OS. As root or via sudo: -``` +``` dnf install -y sox sox-devel ``` @@ -1423,7 +1423,7 @@ If you have not already done so, install [Homebrew](https://brew.sh). Then to install SoX, execute the following command: -``` +``` brew install sox eval "$(opt/homebrew/bin/brew shellenv)" ``` @@ -1435,7 +1435,7 @@ If you haven't already, install [MacPorts](https://www.macports.org/install.php). Then run: -``` +``` sudo port install sox ``` @@ -1474,20 +1474,20 @@ are frankly frivolous and often downright dubious. To enable this feature: -``` +``` make clobber all CC=clang ``` or: -``` +``` make clobber all 'CWARN+= -Weverything' ``` though it should be noted that if one tries `-Weverything` with compilers that are not `clang` they _might_ see something like: -``` +``` echo 'int main(void) {}' > foo.c ; cc -Weverything foo.c -o foo cc: error: unrecognized command-line option '-Weverything' ``` @@ -1540,19 +1540,19 @@ get much of it to work and looking at that entry might be of value to your submissions, at least if you can figure the code out :-). To see the differences, try from `1989/westley`: -``` +``` make diff_orig_prog ``` If you have `colordiff` try: -``` +``` make DIFF=colordiff diff_orig_prog ``` Alternatively you can try: -``` +``` git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..eb9e69fde657acc8c85a618a8a99af4c2f93b21d westley.c ``` @@ -1573,7 +1573,7 @@ special characters. There are typical defaults like (where `^` = ctrl): and various others. But if you don't know this you can find out through the `stty(1)` command with the `-a` option. For instance with macOS you might see: -``` +``` $ stty -a speed 9600 baud; rows 40; columns 155; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; [..snip..] @@ -1583,7 +1583,7 @@ If you know the name you can use `grep` to find the correct line and if your implementation of `grep(1)` has the `-o` option you can filter it. For instance to find what the `intr` is set to: -``` +``` $ stty -a |grep -o 'intr = ^[[:alpha:]]' intr = ^C ``` @@ -1637,7 +1637,7 @@ If your OS package manager does not have the package `tcpserver` you can download, making sure you're in a temporary directory, and compile the source like: -``` +``` wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz tar ucspi-tcp-0.88.tar.gz cd ucspi-tcp-0.88 @@ -1646,7 +1646,7 @@ like: Then as root or via `sudo(1)` enter: -``` +``` make setup check ``` @@ -1663,7 +1663,7 @@ This depends on your operating system for which we describe a couple below. Execute the following as root or via sudo: -``` +``` dnf install netpbm-progs netpbm ``` @@ -1687,7 +1687,7 @@ If you have not already done so, install [Homebrew](https://brew.sh). Then to install netpbm, execute the following command: -``` +``` brew install netpbm ``` @@ -1698,7 +1698,7 @@ If you haven't already, install [MacPorts](https://www.macports.org/install.php). Then run: -``` +``` sudo port install libnetpbm netpbm ``` @@ -1707,7 +1707,7 @@ If you haven't already, install Execute the following as root or via sudo: -``` +``` apt install netpbm ``` @@ -1740,7 +1740,7 @@ This depends on your operating system for which we describe a couple below. Execute the following as root or via sudo: -``` +``` dnf install libjpeg-turbo-utils libjpeg-turbo-devel libjpeg-turbo ``` @@ -1764,7 +1764,7 @@ If you have not already done so, install [Homebrew](https://brew.sh). Then to install libjpeg-turbo, execute the following command: -``` +``` brew install libjpeg-turbo ``` @@ -1775,7 +1775,7 @@ If you haven't already, install [MacPorts](https://www.macports.org/install.php). Then run: -``` +``` sudo port install libjpeg-turbo libjpeg-turbo-devel ``` @@ -1785,7 +1785,7 @@ If you haven't already, install Execute the following as root or via sudo: -``` +``` apt install libturbojpeg0 libturbojpeg0-dev ``` @@ -1817,7 +1817,7 @@ This depends on your operating system for which we describe a couple below. Execute the following as root or via sudo: -``` +``` dnf install ImageMagick ``` @@ -1840,7 +1840,7 @@ If you have not already done so, install [Homebrew](https://brew.sh). Then to install ImageMagick, execute the following command: -``` +``` brew install ImageMagick ``` @@ -1851,7 +1851,7 @@ If you haven't already, install [MacPorts](https://www.macports.org/install.php). Then run: -``` +``` sudo port install ImageMagick ``` @@ -1860,7 +1860,7 @@ If you haven't already, install Execute the following as root or via sudo: -``` +``` apt install imagemagick ``` @@ -1894,7 +1894,7 @@ general information about X11. Once X11 is install and the X Window Server is running, one needs to compile and link with the two libraries, _GL_ and _GLU_: -``` +``` cc ... -lGL -lGLU -L _location-where-X11-libs-are-installed_ -lX11 ``` @@ -1906,7 +1906,7 @@ We suggest you check out their resource for further information on OpenGL. Execute the following as root or via sudo: -``` +``` sudo dnf install glew-devel SDL2-devel SDL2_image-devel glm-devel freetype-devel ``` @@ -1930,7 +1930,7 @@ you might look to install OpenGL via Homebrew or MacPorts. Execute the following as root or via sudo: -``` +``` sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev ``` @@ -1981,7 +1981,7 @@ interspersed with the output of the program. For instance in macOS the entry [1990/tbr](1990/tbr/index.html) would output the warning in such a way that caused confusing output for the entry, looking like: -``` +``` $ ./tbr $ warning: this program uses gets(), which is unsafe. # nothing here, what to do? @@ -2071,7 +2071,7 @@ will make it harder to see what is different, [2001/anonymous](2001/anonymous/index.html). What you would do is `cd 2001/anonymous` and then do: -``` +``` make diff_orig_prog ``` @@ -2096,7 +2096,7 @@ where it's quite easy to see the differences). [1991/dds](1991/dds/index.html) is also a good example to see the alt difference very easily. To do that `cd 1991/dds` and then do: -``` +``` make diff_alt_prog ``` @@ -2108,7 +2108,7 @@ and you'll see a single line changed and very simply. To use these rules but provide a different `diff`, for instance `colordiff`, just do: -``` +``` make DIFF=colordiff diff_orig_prog # for orig to prog diff make DIFF=colordiff diff_alt_prog # for alt to prog diff ``` @@ -2502,7 +2502,7 @@ POSIX safe string plus the use of `+` (for technical reasons beyond this answer). In particular, the `author_handle` must be an ASCII string that matches this regexp: -``` +``` ^[0-9A-Za-z][0-9A-Za-z._+-]*$" ``` @@ -2541,7 +2541,7 @@ in the case of [2005/anon](2005/anon/anon.c). Anonymous `author_handle`'s match this regexp: -``` +``` Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$ ``` @@ -2591,7 +2591,7 @@ is to look at an example, the `author_handle.json` file for Yusuke Endoh: As of _Thu Nov 30 23:51:12 UTC 2023_, the contents was as follows: -``` +``` { "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", "author_JSON_format_version" : "1.0 2023-06-10", @@ -2635,7 +2635,7 @@ We now will walk thru the above JSON document looking at various JSON members: ##### no_comment -``` +``` "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", ``` @@ -2649,7 +2649,7 @@ be the exact _JSON string_ as shown above. ##### author_JSON_format_version -``` +``` "author_JSON_format_version" : "1.0 2023-06-10", ``` @@ -2670,7 +2670,7 @@ in conjunction with changes to [bin directory tools](bin/index.html). ##### author_handle -``` +``` "author_handle" : "Yusuke_Endoh", ``` @@ -2693,7 +2693,7 @@ a change of _author_handle_ _JSON value_ would also require the ##### full_name -``` +``` "full_name" : "Yusuke Endoh", ``` @@ -2708,7 +2708,7 @@ full name is properly encoded as a _JSON string_. ##### sort_word -``` +``` "sort_word" : "endoh", ``` @@ -2731,7 +2731,7 @@ or their username, then they may change this accordingly. ##### location_code -``` +``` "location_code" : "JP", ``` @@ -2758,7 +2758,7 @@ If the author wishes to not specify a location, they should select **XX**. ##### email -``` +``` "email" : "mame@ruby-lang.org", ``` @@ -2771,7 +2771,7 @@ If the author wishes to not specify an email address, or if the email address is unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "email" : null, ``` @@ -2780,7 +2780,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes! ##### url -``` +``` "url" : "https://mametter.hatenablog.com", ``` @@ -2793,7 +2793,7 @@ If the author wishes to not specify an email address, or if the URL is unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "url" : null, ``` @@ -2802,7 +2802,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes! ##### alt_url -``` +``` "alt_url" : null, ``` @@ -2815,7 +2815,7 @@ In some cases the author may wish to record a special URL for their IOCCC entry, or a 2nd URL such as a work or school or personal home page. For example, Cody as of _Thu Nov 30 23:51:12 UTC 2023_ used: -``` +``` "alt_url" : "https://ioccc.xexyl.net", ``` @@ -2823,7 +2823,7 @@ If the author wishes to not specify an email address, or if the alternate URL is unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "url" : null, ``` @@ -2842,7 +2842,7 @@ and so the `deprecated_twitter_handle` is **no longer used**. A _JSON value_ th not a _JSON null_ is kept for only historic reasons. For example, Anthony C. Howe once used: -``` +``` "deprecated_twitter_handle" : "@SirWumpus", ``` @@ -2850,7 +2850,7 @@ If the author wishes to not specify an twitter handle, or if the twitter handle unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "deprecated_twitter_handle" : null, ``` @@ -2859,7 +2859,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes! ##### mastodon -``` +``` "mastodon" : "@mame@ruby.social", ``` @@ -2878,7 +2878,7 @@ See the "Mastodon Address" section of that page in particular. The IOCCC Mastodon handle is: -``` +``` @ioccc@fosstodon.org ``` @@ -2891,7 +2891,7 @@ If the author wishes to not specify an Mastodon handle, or if the Mastodon handl unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "mastodon" : null, ``` @@ -2900,7 +2900,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes! ##### mastodon_url -``` +``` "mastodon_url" : "https://ruby.social/@mame", ``` @@ -2928,7 +2928,7 @@ If the author wishes to not specify an Mastodon URL, or if the Mastodon URL is unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "mastodon_url" : null, ``` @@ -2937,7 +2937,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes! ##### github -``` +``` "github" : "@mame", ``` @@ -2960,7 +2960,7 @@ If the author wishes to not specify an GitHub handle, or if the GitHub handle is unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "github" : null, ``` @@ -2969,7 +2969,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes! ##### affiliation -``` +``` "affiliation" : null, ``` @@ -2990,7 +2990,7 @@ If the author wishes to not specify an affiliation, or if the affiliation is unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_. For example: -``` +``` "affiliation" : null, ``` @@ -3000,7 +3000,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes! ##### winning_entry_set ##### entry_id -``` +``` "winning_entry_set" : [ { "entry_id" : "2012_endoh1" }, { "entry_id" : "2012_endoh2" }, @@ -3062,7 +3062,7 @@ For example see [1984/anonymous/.path](1984/anonymous/.path). The .top, .year and .path files are generated from the top level Makefile, by: -``` +``` make genpath ``` @@ -3155,7 +3155,7 @@ Assuming you do not have an ssh key you should go to the command prompt and type (if you already have one and are okay using it for GitHub you can use that one): -``` +``` ssh-keygen -t rsa -b 4096 -C "luser@example.com" ``` @@ -3192,7 +3192,7 @@ instructions in forking the repo. Once you have forked the repo you are ready to clone it to your system. For instance Cody Boone Ferguson has the GitHub handle _xexyl_ so he would type in: -``` +``` git clone https://github.com/xexyl/temp-test-ioccc [target_dir] ``` @@ -3200,7 +3200,7 @@ Once that is completed you will need to change to that directory. The default directory would be the name of the repo but if you specified a target directory it will be that. For instance using the above example you might do: -``` +``` cd temp-test-ioccc ``` @@ -3226,7 +3226,7 @@ is now (at the time of writing this), `15 April 2023`. But what if he wanted to add a file? He'd create the file and then type: -``` +``` git add foo ``` @@ -3241,7 +3241,7 @@ First, as an aside, if this is your first pull request (which we assume is if yo reading this :-) ) you need to make sure that you can push changes to GitHub with your ssh key. To do this you need to do: -``` +``` ssh -T git@github.com ``` @@ -3253,7 +3253,7 @@ Now, assuming that the forked repo is , you'd type: -``` +``` git remote set-url origin git@github.com:xexyl/temp-test-ioccc.git ``` @@ -3264,21 +3264,21 @@ Continuing the example above for [2020/ferguson1/play.sh](2020/ferguson1/play.sh), it might be that: -``` +``` git checkout -B human-snakes ``` This would change the branch to the newly created branch `human-snakes` branch. Now Cody could commit the changes: -``` +``` git commit play.sh # if specifying specific files git commit -a # if committing everything ``` He could also have done: -``` +``` git add play.sh git commit ``` @@ -3303,7 +3303,7 @@ Now a pull request has to be opened. To do this depends on the branch name. Assuming the branch from above, `human-snakes`, you would type: -``` +``` git push --set-upstream origin human-snakes ``` @@ -3366,7 +3366,7 @@ When the judges have merged the pull request you now need to make sure your fork has the merge. To do this from the command line, assuming the fork in the above example, you would type: -``` +``` git checkout master && git pull https://github.com/ioccc-src/temp-test-ioccc.git master && git push origin master ``` diff --git a/news.md b/news.md index 536c448bd..4e5238e7c 100644 --- a/news.md +++ b/news.md @@ -107,7 +107,7 @@ We also added to the a _"latest_news"_ JSON member whose value is the date of the most recent news item. -``` +``` "status_date" : "Mon Jan 30 02:28:44 PST 2023", "latest_news" : "Mon Jan 30 02:28:44 PST 2023" ``` diff --git a/status.html b/status.html index 7e0b0b75c..22a2a3f7c 100644 --- a/status.html +++ b/status.html @@ -132,7 +132,7 @@ "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", "IOCCC_status_version" : "1.0 2024-03-09", "contest_status" : "closed", - "news_update" : "2024-04-04T21:27:31+00:00", + "news_update" : "2024-04-12T18:22:04+00:00", "status_update" : "2024-03-31T05:02:06+00:00" } diff --git a/status.json b/status.json index 6367b1d25..8b589cae8 100644 --- a/status.json +++ b/status.json @@ -2,6 +2,6 @@ "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", "IOCCC_status_version" : "1.0 2024-03-09", "contest_status" : "closed", - "news_update" : "2024-04-04T21:27:31+00:00", + "news_update" : "2024-04-12T18:22:04+00:00", "status_update" : "2024-03-31T05:02:06+00:00" } diff --git a/status.md b/status.md index 7e371daf4..a222fee74 100644 --- a/status.md +++ b/status.md @@ -10,7 +10,7 @@ than this comment. :-) The JSON member value must be the following JSON quoted string: -``` +``` "mandatory comment: because comments were removed from the original JSON spec" ``` @@ -100,7 +100,7 @@ This shows the latest modification date for the [IOCCC news](news.html) page. The JSON member value is a JSON quoted string obtained from the date field of the following `ls(1)` command: -``` +``` TZ=UTC ls -D '%FT%T+00:00' -ld news.html ``` @@ -118,7 +118,7 @@ This shows the latest modification date [status.json](status.json) file. The JSON member value is a JSON quoted string obtained from the date field of the following `ls(1)` command: -``` +``` TZ=UTC ls -D '%FT%T+00:00' -ld status.json ``` diff --git a/thanks-for-help.md b/thanks-for-help.md index 32c2eaff9..497bb8265 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -82,7 +82,7 @@ that it is i.e. `extern double floor(double);` instead of `extern int floor;`) and also bringing back `double (x1, y1) b;` and even this funny code that could be kept in: -``` +``` #define char k['a'] char x {sizeof( double(%s,%D)(*)()) @@ -114,7 +114,7 @@ but not clang - or at least some versions. To see the difference from start to fixed: -``` +``` cd 1984/decot ; make diff_orig_prog ``` @@ -237,7 +237,7 @@ To get this to all work the following changes were made. If you really want to understand this Cody provides the following. First run the following command from the directory: -``` +``` make diff_orig_prog ``` @@ -248,7 +248,7 @@ editor with syntax highlighting): were actually not what they appear: the only arg that existed in `main()` was `Manual`. Thus it now looks like: -``` +``` main( /* C program. (If you don't * understand it look it @@ -273,7 +273,7 @@ case as `c`. - The code: -``` +``` C="Lint says "argument Manual isn't used." What's that mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+ '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1)); @@ -281,7 +281,7 @@ case as `c`. had to be changed to: -``` +``` C="Lint says \"argument Manual isn't used.\" What's that\ mean?"; while (write((read(('"'-'/*"'))?__:__-_+ '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1)); @@ -305,14 +305,14 @@ case as `c`. - The code in `main()` is where there are significant changes, changing from: -``` +``` while (read(0,&__,1) & write((_=(_=C_C_(__),C)), _C_,1)) _=C-V+subr(&V); ``` to: -``` +``` while (read(0,&__,1) & write((_=(_=C_C_(__), V))?__:__-_+'\b'b'\b'|((_-52)%('\b'b'\b'+~ ' '&'\t'b'\n')+1),1),&_,1))_=c-v+subr(&v)); @@ -397,7 +397,7 @@ Cody changed the alt code (which was not the same as the original - see above for details or try `make diff_orig_alt` in the directory) slightly so that it was possible to silence it. In particular: -``` +``` P ( a ) char a ; { a ; while( a > " B " ``` @@ -412,7 +412,7 @@ which gave: was changed to: -``` +``` P ( a ) char a ; { a ; while((char *)a > " B " ``` @@ -461,7 +461,7 @@ work with gcc but it still required `-traditional-cpp`. If you'd like to see the difference between the version that requires `-traditional-cpp` and the fixed version, try: -``` +``` cd 1986/wall ; make diff_orig_prog ``` @@ -469,7 +469,7 @@ Some of the changes required: - Instead of using the `c_`, defined as `c_(cc)c cc=`, like: -``` +``` c_(+)o /* ... */ @@ -480,7 +480,7 @@ Some of the changes required: use: -``` +``` :c +=o[c&__LINE__-007]; /* ... */ @@ -491,13 +491,13 @@ Some of the changes required: Observe however that this macro is still used in the code like: -``` +``` main(;c_(=(*cc);*cc++)c,for); ``` - Instead of code like: -``` +``` main(0xb+(c>>5),C_(s)) _'\v' :__ _'\f': @@ -506,7 +506,7 @@ Some of the changes required: use instead: -``` +``` main(;c_(=(*cc);*cc++)c,for); #define _O(s)s switch(0xb+(c>>5)){ @@ -517,37 +517,37 @@ Some of the changes required: - The macro: -``` +``` #define C_(sand)_O(sand)witch ``` could not be used like: -``` +``` C_(s));_ ``` to create: -``` +``` switch);_ ``` and neither could the macro: -``` +``` #define O_(O)_O(O)stem(ccc( ``` be used like: -``` +``` :O_(sy)";kkt -oa, dijszdijs QQ"))_C ``` to create: -``` +``` :system(ccc(";kkt -oa, dijszdijs QQ"));return ``` @@ -668,7 +668,7 @@ First of all, as noted above, the entry required `-traditional-cpp` (which not all compilers support `clang` does not support). It needed that option in modern systems because of two things it did: -``` +``` #define a(x)get/***/x/***/id()) /* ... */ @@ -685,7 +685,7 @@ this no longer works. The code still uses the macro `a` to form the names but it's done differently, using the C token paste operator `##`. It's done like thus: -``` +``` --- i/1988/dale/dale.c +++ w/1988/dale/dale.c @@ -9,18 +9,18 @@ @@ -700,7 +700,7 @@ thus: The second is that -``` +``` for/*/(;;);/*/k()){O/*/*/c); ``` @@ -710,7 +710,7 @@ macro it was simply changed to be `fork()`, rather than adding a new macro. The other problem that could not be resolved by the `-traditional-cpp` was that modern compilers do not allow directives like: -``` +``` #define _ define #_ P char #_ p int @@ -720,7 +720,7 @@ modern compilers do not allow directives like: so Cody changed the lines to be in the form of: -``` +``` #define P char #define p int #define O close( @@ -819,7 +819,7 @@ not strictly necessary but nonetheless more correct, even if not warned against. A strange problem occurred where if one made modifications to the C file it might end up failing to work even after changing it back. This was resolved by: -``` +``` --- i/1989/fubar/fubar.sh +++ w/1989/fubar/fubar.sh @@ -7,13 +7,12 @@ if [[ $# -ne 1 ]]; then @@ -865,7 +865,7 @@ entry and the alt code) anyway, it works out well. [Cody](#cody) fixed this to work with modern compilers. Modern compilers do not allow code like: -``` +``` #define D define #define a include @@ -936,7 +936,7 @@ index.html for details. made, try: -``` +``` cd 1989/robison ; make diff_orig_prog ``` @@ -1103,7 +1103,7 @@ Cody also made this use `fgets(3)`. One can no longer do: -``` +``` #define d define #d b12(x) 12 x @@ -1188,7 +1188,7 @@ but as he was testing the `fibonacci.c` bug he ended up changing it anyway). BTW: why can't the fix: -``` +``` if (a[1]==NULL||a[2]==NULL||a[3]==NULL||a[4]==NULL||a[5]==NULL) return 1; ``` @@ -1325,14 +1325,14 @@ changed from `char*s` to `char s[]`): ``` and then the call to `system()` had to be changed to: -``` +``` system(q-69); ``` An important point is that the placement of this string in the `s` array does matter. This is because of the code: -``` +``` *o=fopen(q-3,"w"); ``` @@ -1347,7 +1347,7 @@ But then there is the matter of getting the C to use `fgets(3)`. As can be seen above it's not as simple as changing `gets(3)` to `fgets(3)`. This was more magic characters that had to be updated and some added. The C code: -``` +``` atoi(gets(b)) ``` @@ -1359,7 +1359,7 @@ is in the string: which was changed to be (in C): -``` +``` atoi(fgets(b,99,stdin)) ``` @@ -1395,7 +1395,7 @@ But then to prevent the need for disabling a warning and to be more correct code, the generated code was changed to `return 1;` rather than just `return;`. Thus in full the string became: -``` +``` char s[]="Qjou!s\\311^-g\\311^-n\\311^-c\\::^-q-ma%mO1JBHm%BQ-aP1J[O1HB%[QaP2QaP4\ @@ -1506,13 +1506,13 @@ problem is that `adgrep.c` was an incorrect reference that never existed and it was never fixed in any of the files, not the code or the documentation, and thus was entirely incorrect code. A fun fact is that one can do: -``` +``` W= fopen(wc>= 2 ? V[1] : __FILE__,"rt");if(!W)exit(1); ``` but one _CANNOT_ do: -``` +``` W= fopen(wc>= 2 ? V[1] : __FILE__,"rt");if(!W)exit(1); if (W==NULL)exit(1); ``` @@ -1523,7 +1523,7 @@ true of another change as further below. Cody also restored a slightly more obscure line of code that had been changed: -``` +``` - putc("}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR"[i]+i-9,stderr); + putc(i["}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR"]+i-9,stderr); ``` @@ -1552,7 +1552,7 @@ might be expected from the above, caused compilation errors with another generated file (`adwc.c`)! Thus after the `gets(3)` call in the line that looks like: -``` +``` while( gets(Y) ){ Y[strlen(Y)-1]='\0'; if(A(Y)) puts(Y); } ``` @@ -1809,7 +1809,7 @@ Both [Cody](#cody) and [Yusuke](#yusuke) fixed this so that it will work with mo provided some fixes of the X code and Cody fixed the C pre-processor directives so that it would compile. It used to be that you could get away with code like: -``` +``` G int i,j K case ``` @@ -2421,7 +2421,7 @@ doesn't crash. At this point since the author stated it has no `while`, `do...while`, `for`, `if/else`, `switch`, `?:` Cody removed the if statement by doing: -``` +``` ((V[1]&&((atoi(V[1])>0&&atoi(V[1])<27))||(exit(1),1))); ``` @@ -2456,7 +2456,7 @@ not exist, it would dereference a NULL pointer and very likely crash or halt and catch fire :-), preventing the entry from working. Notice how `H` is a funny macro defined as: -``` +``` %:define H(x) ``` @@ -2757,13 +2757,13 @@ matter_! To get this to compile with clang, `main()` had to change from: -``` +``` main (char *ck, char **k) ``` to: -``` +``` main (int cka, char **k) { char *ck = (char *)cka; /* ... */ } ``` @@ -2778,7 +2778,7 @@ macOS and Linux). NOTE: there might be educational value to see the progress of this fix; if you wish to see, try the following commands from the `2001/anonymous` directory: -``` +``` git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..93aa8d79f208dcccc3c5a2370a727b5cf64e9c53 anonymous.c git diff 93aa8d79f208dcccc3c5a2370a727b5cf64e9c53..c48629017117379a52b1a512ef8f2593ca9569c8 anonymous.c git diff c48629017117379a52b1a512ef8f2593ca9569c8..efdee208a2bc650256637b9357ddfd0de82d2f41 anonymous.c @@ -2789,13 +2789,13 @@ wish to see, try the following commands from the `2001/anonymous` directory: Finally to see from start to finish: -``` +``` git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c ``` or to not use `git`: -``` +``` make diff_orig_prog ``` @@ -2874,7 +2874,7 @@ He also fixed it to check the number of args. Cody fixed this to compile with clang in Linux. The problem was C99 does not support implicit int: -``` +``` coupard.c:31:10: error: parameter 'h' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] void e(n,h){ ^ @@ -3113,7 +3113,7 @@ cpp being unable to parse the generated code (see the index.html for details) an this ended up with a number of errors like: -``` +``` jdalbec.c:64:5: error: stray '##' in program 64 | B N##B (I) ; \ | ^~ @@ -3196,7 +3196,7 @@ to the repo for the script instead. [Cody](#cody) fixed this to compile in Linux. Although it compiled cleanly in macOS (and BSD?) the code failed to compile at all in Linux due to: -``` +``` cc -E vik2_1.c > vik2_2.c In file included from vik2.c:945, from vik2.c:959, @@ -3310,7 +3310,7 @@ Linux (32-bit, 64-bit) and macOS (arm64). To get the self-test feature to work it was required to remove from the code: -``` +``` O-b-f-u -s-c-a-t-e; ``` @@ -3326,7 +3326,7 @@ portable and caused other problems. This was a complicated fix as it's in the comments but in a funny way; the final result to get the test feature to work is: -``` +``` ;; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/ /*-e/'s,intZ,int/ Z,g'>c.c;make/c;/ rm/-f/c*/ ;; @@ -3334,7 +3334,7 @@ is: changed from: -``` +``` ;; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/ /*c.c;cc/c.c /-c*/;; ``` @@ -3342,7 +3342,7 @@ changed from: or as a diff: -``` +``` -(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/ -/*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l -[9999],T=42, M,V=32;long*E,k[9999],B[1 <<+21],*N=B+ @@ -3380,7 +3380,7 @@ not do it implicitly (like macOS does). [Cody](#cody) fixed this to work in Linux. The problem was an unknown escape sequence, `\N`, which caused a funny compiler error: -``` +``` };n b[2048];int i mikeash.c: In function 'R': mikeash.c:7:1: error: '\N' not followed by '{' @@ -3433,7 +3433,7 @@ Cody also added the [try.sh](2005/persano/try.sh) script. [Cody](#cody) added the saved (with the `SAVE` command) BASIC program `PET` which was: -``` +``` 10 PRINT "2005'S IOCCC BEST EMULATOR" 20 PRINT "BY STEPHEN SYKES!" ``` @@ -4107,7 +4107,7 @@ real source of the program. So the source of the entry has to be compiled and then run, and the output has to be compiled to be `hou`. This allows the real program to be used. Thus the Makefile rule looks like: -``` +``` ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} ./${PROG} | ${CC} ${CFLAGS} -xc - -o $@ ${LDFLAGS} @@ -4117,7 +4117,7 @@ program to be used. Thus the Makefile rule looks like: which then compiles like: -``` +``` cc -std=gnu11 -Wall -Wextra -pedantic -Wno-sign-compare -Wno-strict-prototypes -O3 hou.c -o hou -lm ./hou | cc -std=gnu11 -Wall -Wextra -pedantic -Wno-sign-compare -Wno-strict-prototypes -O3 -xc - -o hou -lm ``` @@ -4311,7 +4311,7 @@ output. first character of the filename starts with `e`. The only way it would work before that is if one did something like: -``` +``` ln -sf prog eprog PATH=$PATH:. ; eprog '...' ``` @@ -4320,7 +4320,7 @@ since otherwise the first character would not be `e` but rather a dot (`./eprog`). This was done by adding to the Makefile `-include libgen.h` and adding to `main()` after the variable declaration (`V*A;`) the code: -``` +``` *K=basename(*K); ``` @@ -4820,7 +4820,7 @@ He also added the [try.sh](2020/endoh2/try.sh) script. [Cody](#cody) fixed the script [run_clock.sh](2020/endoh3/run_clock.sh) which gave a funny error when running it: -``` +``` $ ./run_clock.sh -bash: ./run_clock.sh: cannot execute: required file not found ``` diff --git a/tmp/OLD_manifest/README.md b/tmp/OLD_manifest/README.md index 62d79299c..2b42971ee 100644 --- a/tmp/OLD_manifest/README.md +++ b/tmp/OLD_manifest/README.md @@ -37,7 +37,7 @@ Because the `author_handle` is used to form a JSON filename, the string must be lower case POSIX safe string. Furthermore, the `author_handle` must be an ASCII string that matches this regexp: -``` +``` ^[0-9a-z][0-9a-z_]*$ ``` @@ -76,7 +76,7 @@ in the case of [2005/anon](/2005/anon/anon.c). Anonymous `author_handle`'s match this regexp: -``` +``` Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$ ``` @@ -105,7 +105,7 @@ Non-numeric `year` strings are lower case. A `year` string matches this regexp: -``` +``` [0-9a-z][0-9a-z][0-9a-z][0-9a-z] ``` @@ -130,7 +130,7 @@ A `dir` is a POSIX safe string that holds an winner. A `dir` is a string that matches this regexp: -``` +``` ^[a-z][0-9a-z.-]*$ ``` @@ -164,7 +164,7 @@ an `author` and the `winners` they submitted are to be listed. A `sort_word` match this regexp: -``` +``` ^[a-z][0-9a-z]* ``` @@ -281,7 +281,7 @@ Run the script from the top level directory. The output should end in ":1". For example, this command should not produce any output. -``` +``` tmp/awards_check.sh | grep -v ':1$' ``` @@ -419,7 +419,7 @@ Temporary tool used to generate the `author/author_handle.json` files. The following command, executed in this directory, created the `author/` directory: -``` +``` rm -rf ../author ; ./gen_author_json.sh author_handle.txt author.csv author_wins.csv ../author ``` diff --git a/tmp/README.md b/tmp/README.md index ac8a37fcc..7312d279e 100644 --- a/tmp/README.md +++ b/tmp/README.md @@ -156,7 +156,7 @@ returns and appending a newline if it was missing. Fixing involves these actions: -``` +``` tr -d '\015' < input.csv > tmp.csv echo >> tmp.csv mv -f tmp.csv input.csv @@ -342,7 +342,7 @@ A tool to run another tool over all _YYYY/dir_ entry directories. Examples: -``` +``` ./run_all.sh -v 3 ./fake.gen_index.sh ./run_all.sh -v 1 ./gen_entry_json.sh ```