diff --git a/1984/mullender/README.md b/1984/mullender/README.md index d2183e804..ebdc5c5f4 100644 --- a/1984/mullender/README.md +++ b/1984/mullender/README.md @@ -1,7 +1,7 @@ # Grand Prize Sjoerd Mullender\ -\ + Robbert van Renesse diff --git a/1987/heckbert/README.md b/1987/heckbert/README.md index f96fa2a9c..1a8050322 100644 --- a/1987/heckbert/README.md +++ b/1987/heckbert/README.md @@ -1,6 +1,6 @@ # Best Obfuscator of Programs -Paul Heckbert\ +Paul Heckbert ## To build: diff --git a/1987/korn/README.md b/1987/korn/README.md index 76c797ee8..e778137c0 100644 --- a/1987/korn/README.md +++ b/1987/korn/README.md @@ -35,27 +35,30 @@ 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: +```c +char *x; +``` - char *x; +defines a pointer to a `char` (i.e. an address), and that the `=` assigns +things of compatible types. Since: +```c +x = "have"; +``` - defines a pointer to a `char` (i.e. an address), and that the `=` assigns - things of compatible types. Since: - - x = "have"; - - is legal C, what type of value is `"have"`? +is legal C, what type of value is `"have"`? 3. Note that the following expressions yield the same value: +```c +x[3] *(x+3) *(3+x) +``` - x[3] *(x+3) *(3+x) +since addition is commutative. What can be said about this value? - since addition is commutative. What can be said about the value: - - 3[x] - - ? +```c +3[x] +``` [David Korn](https://news.slashdot.org/story/01/02/06/2030205/david-korn-tells-all)'s diff --git a/1988/isaak/README.md b/1988/isaak/README.md index 827b4bf36..ea366b425 100644 --- a/1988/isaak/README.md +++ b/1988/isaak/README.md @@ -28,7 +28,7 @@ The original version of this code is in [isaak.alt.c](isaak.alt.c). The original entry starts with the line: ```c - main(){}; +main(){}; ``` This works on some systems. Why? Note that `#include ` is given on diff --git a/1988/reddy/README.md b/1988/reddy/README.md index e0dd2c385..7cb03f814 100644 --- a/1988/reddy/README.md +++ b/1988/reddy/README.md @@ -19,14 +19,12 @@ char *(*(fun[16])(); char *(*(*(*(*(*fun[32])))))(); ``` -What happens if you input: +What happens if you input, and what you do about it? -``` +```c char *(*(*(*(*(*fun[32])))))()); ``` -? What can you do about it? - ## Judges' remarks: diff --git a/1988/spinellis/README.md b/1988/spinellis/README.md index 7d215332f..1318a8e12 100644 --- a/1988/spinellis/README.md +++ b/1988/spinellis/README.md @@ -21,7 +21,7 @@ rm -f spinellis ; cc spinellis.c -o spinellis < input.txt && ./spinellis and try: -``` +```sh rm -f spinellis ; cc spinellis.c -o spinellis < input2.txt && ./spinellis ``` @@ -36,7 +36,7 @@ cc spinellis.alt.c -o spinellis.alt < input.txt && ./spinellis.alt and try: -``` +```sh cc spinellis.alt.c -o spinellis.alt < input2.txt && ./spinellis.alt ``` diff --git a/1988/westley/README.md b/1988/westley/README.md index bc375e948..ca034ee2b 100644 --- a/1988/westley/README.md +++ b/1988/westley/README.md @@ -1,7 +1,7 @@ # Best layout Merlyn LeRoy (Brian Westley)\ -US +US\ diff --git a/1989/jar.2/README.md b/1989/jar.2/README.md index 7deff80e7..2124227ea 100644 --- a/1989/jar.2/README.md +++ b/1989/jar.2/README.md @@ -22,10 +22,8 @@ make all [enter some lisp] ./jar.2 < some_lisp_file - ``` - NOTE: this entry will likely segfault on invalid input. @@ -39,7 +37,6 @@ cat chocolate_cake.lisp ; ./jar.2 < chocolate_cake.lisp ./try.sh chocolate_cake.lisp ./try.sh try.txt - ``` diff --git a/1990/dds/README.md b/1990/dds/README.md index 86e33b82a..a57f6bcd9 100644 --- a/1990/dds/README.md +++ b/1990/dds/README.md @@ -24,7 +24,7 @@ make all Give the following lines as input: -``` +```basic OLD LANDER.BAS RUN ``` diff --git a/1990/dg/README.md b/1990/dg/README.md index 3431cc318..2d1da7922 100644 --- a/1990/dg/README.md +++ b/1990/dg/README.md @@ -65,7 +65,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: -``` +```c "nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM" ``` diff --git a/1990/tbr/README.md b/1990/tbr/README.md index 3784fd566..c431a92c4 100644 --- a/1990/tbr/README.md +++ b/1990/tbr/README.md @@ -23,7 +23,7 @@ output due to a warning at runtime that was interspersed with the output of the program. For instance it would show: ```sh -$ ./tbr +./tbr $ warning: this program uses gets(), which is unsafe. ``` @@ -39,7 +39,7 @@ below, in the [alternate version](#alternate-code) section. ```sh ./tbr -# enter some shell commands +$ enter some shell commands ``` NOTE: globs do not work with this entry. Why? @@ -53,11 +53,14 @@ just `exit` or `logout`? Hint: see the authors' remarks. ```sh ./tbr -ls -l tbr tbr.c +$ ls -l tbr tbr.c + # notice how the following does not work: ls tbr* + # try figuring out how this entry works in an editor: vi tbr.c + # then figure out how to exit vi :-) ``` diff --git a/1991/buzzard/README.md b/1991/buzzard/README.md index 7026a4546..976a73958 100644 --- a/1991/buzzard/README.md +++ b/1991/buzzard/README.md @@ -43,60 +43,56 @@ it) or when you type `^D` (EOF). ### Hints on how to cheat -Rot13 to read: +You can, of course, cheat by looking at the maze map. The question +you need to ask yourself, though, is what sequence of characters +marks the place where you can escape the maze? - Lbh pna, bs pbhefr, purng ol ybbxvat ng gur znmr znc. Gur dhrfgvba - lbh arrq gb nfx lbhefrys, gubhtu, vf jung frdhrapr bs punenpgref - znexf gur cynpr jurer lbh pna rfpncr gur znmr? - - Gur nytbevguz vf dhvgr ovmneer--gur cevznel arfgrq ybbc gung - trarengrf vg tbrf gbc gb obggbz ba gur qvfcynl, ybbcvat sbejneq - gura onpxjneq sebz gur pheerag cbfvgvba gb qenj gur yrsg fvqr naq - gura gur evtug fvqr. +The algorithm is quite bizarre--the primary nested loop that +generates it goes top to bottom on the display, looping forward +then backward from the current position to draw the left side and +then the right side. ### Advanced usage notes -Rot13 to read: +The program can also be run from other files containing mazes. The +maze should be laid out graphically in the obvious format; newlines +separate physical rows in the maze; a space indicates a corridor, +and any other character is a wall. Tabs are also considered walls, +so make sure to convert tabs to spaces before using it. - Gur cebtenz pna nyfb or eha sebz bgure svyrf pbagnvavat znmrf. Gur - znmr fubhyq or ynvq bhg tencuvpnyyl va gur boivbhf sbezng; arjyvarf - frcnengr culfvpny ebjf va gur znmr; n fcnpr vaqvpngrf n pbeevqbe, - naq nal bgure punenpgre vf n jnyy. Gnof ner nyfb pbafvqrerq jnyyf, - fb znxr fher gb pbaireg gnof gb fcnprf orsber hfvat vg. +Usage: buzzard [filename [escape-char [start-x start-yNNN - Hfntr: ohmmneq [svyranzr [rfpncr-pune [fgneg-k fgneg-l]]] +Filename is the name of the file containing the maze. This +defaults to 'buzzard.c'. - Svyranzr vf gur anzr bs gur svyr pbagnvavat gur znmr. Guvf - qrsnhygf gb 'ohmmneq.p'. +Escape-char is the character in the maze that represents the exit. +You can put more than one exit in the maze (for example, you could +make all '!'s in the maze be exits). - Rfpncr-pune vf gur punenpgre va gur znmr gung ercerfragf gur rkvg. - Lbh pna chg zber guna bar rkvg va gur znmr (sbe rknzcyr, lbh pbhyq - znxr nyy '!'f va gur znmr or rkvgf). +Start-x and start-y mark the coordinates where you begin playing. +Y coordinate is down the rows in the files, X is to the right +through the characters of each line. Both X and Y begin counting +from 0. The default is start-x = 4, start-y = 5, which is needed +for the buzzard.c, but would probably be inappropriate for other +mazes. - Fgneg-k naq fgneg-l znex gur pbbeqvangrf jurer lbh ortva cynlvat. - L pbbeqvangr vf qbja gur ebjf va gur svyrf, K vf gb gur evtug - guebhtu gur punenpgref bs rnpu yvar. Obgu K naq L ortva pbhagvat - sebz 0. Gur qrsnhyg vf fgneg-k = 4, fgneg-l = 5, juvpu vf arrqrq - sbe gur ohmmneq.p, ohg jbhyq cebonoyl or vanccebcevngr sbe bgure - znmrf. +BUGS: - OHTF: +You can't change that at start you're facing down ("south"). - Lbh pna'g punatr gung ng fgneg lbh'er snpvat qbja ("fbhgu"). -\ - Gur qenjvat nytbevguz pnaabg unaqyr bcra fcnprf (gjb fhpprfvir - fvqr-pbeevqbef jvgu ab jnyy orgjrra gurz). Va snpg, vg pnaabg unaqyr - fznyy qbt-yrtf cebcreyl, nygubhtu gur reebe vf fhogyr. +The drawing algorithm cannot handle open spaces (two successive +side-corridors with no wall between them). In fact, it cannot handle +small dog-legs properly, although the error is subtle. - Gur rkvg vf qenja yvxr n abezny pbeevqbe sebz gur fvqr ivrj; - vg'f bayl qvfcynlrq nf gur rkvg jura lbh ner snpvat vg. +The exit is drawn like a normal corridor from the side view; +it's only displayed as the exit when you are facing it. - Vzcebcre pbzznaqyvar nethzragf ner abg unaqyrq avpryl. +Improper command line arguments are not handled nicely. - Znmrf jvgu bcravatf ng gur rqtrf jvyy pnhfr gur qenjvat cebtenz - gb ernpu vagb neovgenel cnepryf bs zrzbel. +Mazes with openings at the edges will cause the drawing program +to reach into arbitrary parcels of memory. - Gur cebtenz nffhzrf gung gnof ner frg gb 8 punenpgref. +The program assumes that tabs are set to 8 characters. ## Copyright and CC BY-SA 4.0 License: diff --git a/1991/cdupont/README.md b/1991/cdupont/README.md index 98a638bc2..eb9e35099 100644 --- a/1991/cdupont/README.md +++ b/1991/cdupont/README.md @@ -40,19 +40,19 @@ this entry. ## Author's remarks: -Spoiler, rot13 to read: +Spoiler: - Gur fbhepr pbqr ubyqf gur yrggref bs gur zrffntr. Rnpu yrggre, pbzovarq - jvgu nabgure xrl yrggre, vf hfrq gb pbzchgr gur pbbeqvangrf bs gur arkg - yrggre naq xrl. Guhf, gur zrffntr vf pbqr. Gung vf jul V hfr fvyyl\ - pbzzragf, zbfg bsgra onqyl fcnprq. +The source code holds the letters of the message. Each letter, combined +with another key letter, is used to compute the coordinates of the next +letter and key. Thus, the message is code. That is why I use silly\ +comments, most often badly spaced. - Gur fcnpr punenpgre frdhrapr orgjrra gur jbeqf vf tvira ol n fvzcyr - pbzchgngvba ba na bpgny pbafgnag (tvira urer nf na urk inyhr, bs - pbhefr). +The space character sequence between the words is given by a simple +computation on an octal constant (given here as an hex value, of +course). - Guvf jnl, nal zrffntr pna or zvkrq vagb n pbqr, fvapr gur xrlf nyybj - lbh gb cynpr gur zrnavatshy yrggref jurerire lbh jnag. +This way, any message can be mixed into a code, since the keys allow +you to place the meaningful letters wherever you want. ## Copyright and CC BY-SA 4.0 License: diff --git a/1991/fine/README.md b/1991/fine/README.md index 5c1135464..980e176e6 100644 --- a/1991/fine/README.md +++ b/1991/fine/README.md @@ -55,12 +55,12 @@ the high bit off some input? The author wishes to thank J Greely for the last 6 bytes. -Here's about how it does it: [rot13 to read] +Here's about how it does it: NOTE: Bits are referred to as 76543210, high to low. 1. Get the character in variable `a`. Note the fun way we check for `EOF`. -(thanks J). + (thanks J). 2. Reverse bit 6, and strip bit 5. Bit 6 determines (mostly) whether or not this character is a letter. Bit 5 would determine case if diff --git a/1991/rince/README.md b/1991/rince/README.md index bba8e3a0c..16ebd9864 100644 --- a/1991/rince/README.md +++ b/1991/rince/README.md @@ -33,45 +33,45 @@ This entry has been updated to allow most ANSI C compilers. This program is a simple puzzle type game. (I'll leave you to play it to see the rest of it .. :-) .) The general idea was to try and write the smallest playable game, but keep the playability and -enjoyment high.\ -\ -### Instructions (rot13 to read): +enjoyment high. +### Instructions: - Xrl gb znc:- +Key to map: - | - ###### | | | /\ /--\ ==| /\ | | Qverpgbany xrlf\ - ###### Fbyvq Jnyy | ----|| \/ /\ ||---- (haybpx qbbef bs - ###### | \/ ==| \--/ \/ gur fnzr qverpgvba) - |\ - | << >> Qbbef. Haybpxrq ol - Oynax fcnpr | << iiiiii ^^^^^^ >> gur nobir xrlf. - | << >> - |\ - ___ | b__B\ B__B ^__^ /B__b\ - / \ 'Pehfunoyr' | \___/ /----\ /----\ \___/ Gur sbhe fcevgrf sbe - \___/ obhyqre | _/_\ _/ \_ _/ \_ /_\_ lbhe punenpgre :-) - |\ - ___ hapehfunoyr | /\ Qvnzbaqf. Gurl pna rvgure or sbhaq ylvat - /@@@\ obhyqre | < > nebhaq (vs bayl!) be znahsnpgher ol chfuvat - \@@@/ | \/ gjb 'pehfunoyr' ebpxf gbtrgure. - | +``` + | + ###### | | | /\ /--\ ==| /\ | | Directonal keys\ + ###### Solid Wall | ----|| \/ /\ ||---- (unlock doors of + ###### | \/ ==| \--/ \/ the same direction) + |\ + | << >> Doors. Unlocked by + Blank space | << vvvvvv ^^^^^^ >> the above keys. + | << >> + |\ + ___ | o__O\ O__O ^__^ /O__o\ + / \ 'Crushable' | \___/ /----\ /----\ \___/ The four sprites for + \___/ boulder | _/_\ _/ \_ _/ \_ /_\_ your character :-) + |\ + ___ uncrushable | /\ Diamonds. They can either be found lying + /@@@\ boulder | < > around (if only!) or manufacture by pushing + \@@@/ | \/ two 'crushable' rocks together. + | - Gur trareny vqrn bs gur tnzr vf gb pbyyrpg nyy gur qvnzbaqf. Guvf zhfg - or qbar va gur zvavzhz nzbhag bs zbirf. V'ir nyybjrq n znetva bs 5 - zbirf juvpu oevatf gur zbirf nyybjrq gb 484. (nygre gur inyhr bs 'h' va - gur cebtenz gb frg gur znk zbirf nyybjrq) +The general idea of the game is to collect all the diamonds. This must +be done in the minimum amount of moves. I've allowed a margin of 5 +moves which brings the moves allowed to 484. (alter the value of 'u' in +the program to set the max moves allowed) - Gurer ner gjb glcrf bs obhyqref. Obgu pna or chfurq nebhaq, ohg bayl - gur ubyybj (pehfunoyr) barf pna or ghearq vagb qvnzbaqf (ol chfuvat vg - bagb nabgure ubyybj bar). - - Bs gur sbhe glcrf bs qbbef (naq xrlf) bayl 3 unir orra qrsvarq. Guvf - jnf qbar gb xrrc gur fbhepr nf ybj nf cbffvoyr (nf V bayl hfrq 3 va gur - znc). Gb haybpx n qbbe fvzcyl chfu n xrl vagb gur pbeerfcbaqvat qbbe. - Gnxr pner gung vg'f snpvat va gur pbeerpg qverpgvba. +There are two types of boulders. Both can be pushed around, but only +the hollow (crushable) ones can be turned into diamonds (by pushing it +onto another hollow one). +Of the four types of doors (and keys) only 3 have been defined. This +was done to keep the source as low as possible (as I only used 3 in the +map). To unlock a door simply push a key into the corresponding door. +Take care that it's facing in the correct direction. +``` ## Copyright and CC BY-SA 4.0 License: diff --git a/1991/westley/README.md b/1991/westley/README.md index 21f4e60bd..4d698c1e6 100644 --- a/1991/westley/README.md +++ b/1991/westley/README.md @@ -38,9 +38,11 @@ Make and run as follows: where the `move_location` is a digit from 1 to 9 that represents a move on a tic-tac-toe board: - 1 2 3 - 4 5 6 - 7 8 9 +``` +1 2 3 +4 5 6 +7 8 9 +``` If you omit `move_location`, then the computer moves first. For your\ next move, recompile `nextmove.c` and play it again: @@ -61,7 +63,7 @@ make ttt ./ttt next_move ``` -\ + 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: @@ -172,113 +174,118 @@ longer loses games. If you want a program that never loses, simply replace the string `"9999999999 :-| "` with `"9883857753 :-| "`. -### How it works (rot13 to read): +### How it works +The vertical "bars" of the grid are identical functions, with the +name of the function as a(), b(), or c(). After each function is +called, the global variables X and O contain bitmasks of where all +the Xs and Os are placed. The statement: - Gur iregvpny "onef" bs gur tevq ner vqragvpny shapgvbaf, jvgu gur - anzr bs gur shapgvba nf n(), o(), be p(). Nsgre rnpu shapgvba vf - pnyyrq, gur tybony inevnoyrf K naq B pbagnva ovgznfxf bs jurer nyy - gur Kf naq Bf ner cynprq. Gur fgngrzrag: +```c +X=- -1; +`` - K=- -1; +evaluates to 1, -1, or -2 when X is 1 and is one of "X", +"0", or " ". The function S(&X) sets the appropriate bits in +(global var) X and O and resets the value of &X to 1. This is how +the current position is computed. - rinyhngrf gb 1, -1, be -2 jura K vf 1 naq vf bar bs "K", - "0", be " ". Gur shapgvba F(&K) frgf gur nccebcevngr ovgf va - (tybony ine) K naq B naq erfrgf gur inyhr bs &K gb 1. Guvf vf ubj - gur pheerag cbfvgvba vf pbzchgrq. +The player's move is OR'd into the X mask, and (if it is the +opening move) the strategy string's first character is set to the +player's first move (or "5" if the computer moves first). - Gur cynlre'f zbir vf BE'q vagb gur K znfx, naq (vs vg vf gur - bcravat zbir) gur fgengrtl fgevat'f svefg punenpgre vf frg gb gur - cynlre'f svefg zbir (be "5" vs gur pbzchgre zbirf svefg). +The evalution function y(M) checks if the mask has a winning +pattern (any of the first eight bitmasks of the w[N array), and +sets the variable q to 0 if it does. - Gur rinyhgvba shapgvba l(Z) purpxf vs gur znfx unf n jvaavat - cnggrea (nal bs gur svefg rvtug ovgznfxf bs gur j[] neenl), naq - frgf gur inevnoyr d gb 0 vs vg qbrf. +The player's move is evaluated to see if the human has won. The +smiley is set to :-) or :-( depending on this. Also, if the human +has won, the digit in the strategy string is decremented to change +the computer's play for next game. - Gur cynlre'f zbir vf rinyhngrq gb frr vs gur uhzna unf jba. Gur - fzvyrl vf frg gb :-) be :-( qrcraqvat ba guvf. Nyfb, vs gur uhzna - unf jba, gur qvtvg va gur fgengrtl fgevat vf qrperzragrq gb punatr - gur pbzchgre'f cynl sbe arkg tnzr. +If the human has NOT won, the e(N,M) function evaluates if ANY move +not in mask N can produce a win in mask M. The first evaluation +e(X,O) checks if O can make a legal winning move. If so, the +computer has a winning move and makes it. If not, the smiley is +set to :-|, and a non-winning move is generated. - Vs gur uhzna unf ABG jba, gur r(A,Z) shapgvba rinyhngrf vs NAL zbir - abg va znfx A pna cebqhpr n jva va znfx Z. Gur svefg rinyhngvba - r(K,B) purpxf vs B pna znxr n yrtny jvaavat zbir. Vs fb, gur - pbzchgre unf n jvaavat zbir naq znxrf vg. Vs abg, gur fzvyrl vf - frg gb :-|, naq n aba-jvaavat zbir vf trarengrq. +A non-winning move first checks if X can win in one move; if so, +this move is selected, blocking the win. Otherwise, a move is +generated by looking down the list of "move templates". The first +move template that generates a move that is NOT already occupied by +an X or O is returned. - N aba-jvaavat zbir svefg purpxf vs K pna jva va bar zbir; vs fb, - guvf zbir vf fryrpgrq, oybpxvat gur jva. Bgurejvfr, n zbir vf - trarengrq ol ybbxvat qbja gur yvfg bs "zbir grzcyngrf". Gur svefg - zbir grzcyngr gung trarengrf n zbir gung vf ABG nyernql bpphcvrq ol - na K be B vf erghearq. +The "move templates" are static tic-tac-toe positions that generate +possible moves by making the e() function return "winning" moves, +e.g. the template: - Gur "zbir grzcyngrf" ner fgngvp gvp-gnp-gbr cbfvgvbaf gung trarengr - cbffvoyr zbirf ol znxvat gur r() shapgvba erghea "jvaavat" zbirf, - r.t. gur grzcyngr: +``` +. . . +O , O (this is the value 40; 2^3+2^5) +. . . ("O"s are 1 bits, "." and "," are 0 bits) +``` - . . . - B , B (guvf vf gur inyhr 40; 2^3+2^5) - . . . ("B"f ner 1 ovgf, "." naq "," ner 0 ovgf) +...will make the e() function return a center move, as +this is the only move that produces three in a row. Notice that +the computer does not consider which cells contain Xs and Os when +making a template move, only which cells are empty and not-empty. +This makes for unusual play. - ...jvyy znxr gur r() shapgvba erghea n pragre zbir, nf - guvf vf gur bayl zbir gung cebqhprf guerr va n ebj. Abgvpr gung - gur pbzchgre qbrf abg pbafvqre juvpu pryyf pbagnva Kf naq Bf jura - znxvat n grzcyngr zbir, bayl juvpu pryyf ner rzcgl naq abg-rzcgl. - Guvf znxrf sbe hahfhny cynl. +The templates are carefully chosen to eventually block all traps +that X can try, by just blundering in the way. - Gur grzcyngrf ner pnershyyl pubfra gb riraghnyyl oybpx nyy gencf - gung K pna gel, ol whfg oyhaqrevat va gur jnl. +Also note that the winning & strategy templates are part of the +compile line, making it possible to change the rules of the game by +changing the compile line. - Nyfb abgr gung gur jvaavat & fgengrtl grzcyngrf ner cneg bs gur - pbzcvyr yvar, znxvat vg cbffvoyr gb punatr gur ehyrf bs gur tnzr ol - punatvat gur pbzcvyr yvar. +The templates are: - Gur grzcyngrf ner: +``` +O , O +, , , +O , O - B , B - , , , - B , B +, . . +. O . +. . O - , . . - . B . - . . B +. . . +O , O +. . . - . . . - B , B - . . . +. . . +O O , +. . . - . . . - B B , - . . . +. . . +O , O +. . . - . . . - B , B - . . . +. , , +. O . +O O , - . , , - . B . - B B , +O , O +, , . +O . . - B , B - , , . - B . . +, . O +O , O +O . , - , . B - B , B - B . , +O . , +O , O +, . O - B . , - B , B - , . B +O , O +, , , +O , O +``` - B , B - , , , - B , B - - N qvtvg bs "9" zrnaf fgneg jvgu gur svefg grzcyngr, "8" fgnegf ng - gur frpbaq, rgp. Gur grzcyngrf ner fpnaarq hagvy n yrtny zbir vf - sbhaq. N grzcyngr vf fpnaarq sebz obggbz gb gbc, evtug gb yrsg - (v.r. zbir 9 vf grfgrq svefg, gura 8, qbja gb zbir 1). +A digit of "9" means start with the first template, "8" starts at +the second, etc. The templates are scanned until a legal move is +found. A template is scanned from bottom to top, right to left +(i.e. move 9 is tested first, then 8, down to move 1). ## Copyright and CC BY-SA 4.0 License: diff --git a/1992/adrian/README.md b/1992/adrian/README.md index 1e123672a..ea89cb029 100644 --- a/1992/adrian/README.md +++ b/1992/adrian/README.md @@ -28,7 +28,6 @@ NOTE: if you do not specify an arg to the program it will segfault. ## Judges' remarks: -\ Once you get past the obfuscation, you have an opportunity to learn about regular expressions and state machines. @@ -79,43 +78,49 @@ character list. ### Example 2: `^abc` - a - b - c [q3] - [q3] . [q3] - +``` + a + b + c [q3] +[q3] . [q3] +``` ### Example 3: `abc$` - a . - b a . - c [q3] a . - [q3] . - +``` + a . + b a . + c [q3] a . +[q3] . +``` ### Example 4: `^(abc)*$` - [q0] a - b - c [q0] - +``` +[q0] a + b + c [q0] +``` ### Example 5: `^[ab][cd][ef]$` - ab - cd - ef [q3] - [q3] - +``` + ab + cd + ef [q3] +[q3] +``` ### Example 6: `^(abc|efg)$` - a e - b - c [q5] - f - g [q5] - [q5] +``` + a e + b + c [q5] + f + g [q5] +[q5] +``` With the automaton specification in 'filename', invoke the program by @@ -149,8 +154,9 @@ as the specification for the automaton. (This file has been renamed\ to `adrian.c` by the judges.) In this case, the program will search for\ matches to the regular expression: - - ^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$ +``` +^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$ +``` I suggest using `adgrep.c` as input, and storing the output in `adwc.c`: @@ -166,7 +172,9 @@ displays the number of lines, words, and bytes in the input file. Another possibly interesting automaton can be created by slightly adjusting the `adgrep.c` file. Change the first line to read - /* . echo| . */ +```c +/* . echo| . */ +``` and repeat the process above @@ -176,7 +184,9 @@ and repeat the process above The new file now contains all lines which match - ^.[^5|m^]*[m^]([e=p,;]|[^e=+p,;].*)$ +``` +^.[^5|m^]*[m^]([e=p,;]|[^e=+p,;].*)$ +``` Compile and run. This is an echo clone. Note the efficient algorithm employed. @@ -185,11 +195,15 @@ employed. Two other adjustments to the first line also yield useful results. By changing it to - /* . head; . */ +```c +/* . head; . */ +``` you can search for matches to - ^.[^W]*W..*$ +``` +^.[^W]*W..*$ +``` By some freak happenstance, lines of adgrep.c which match this regular expression form a unix head command. It prints the first ten lines of @@ -198,12 +212,16 @@ specified). By setting the first line to - /* . basename . */ +```c +/* . basename . */ +``` a clone of the unix basename command can be unearthed. The automaton will search for - ^.[^j]*jr.*$ +``` +^.[^j]*jr.*$ +``` on standard input. And the program which results by running adgrep.c through this filter requires two parameters. The first is meant to be a @@ -213,11 +231,15 @@ The resulting base name is printed to stdout. Lastly, by setting the first line to - /* . sleep . */ +```c +/* . sleep . */ +``` you can search for - ^.[^(~][^s]*sl.*$ +``` +^.[^(~][^s]*sl.*$ +``` Filtering adgrep.c through this search yields a clone of the sleep command. Invoke with a single integer parameter, and it will pause diff --git a/1992/albert/README.md b/1992/albert/README.md index 336168d26..8e9845717 100644 --- a/1992/albert/README.md +++ b/1992/albert/README.md @@ -3,7 +3,7 @@ Albert van der Horst\ S P&A R&C\ Oranjestraat 8\ -3511 RA UTRECHT\ +3511 RA UTRECHT\ The Netherlands @@ -65,7 +65,6 @@ Use `albert.alt` as you would `albert` above. ## Judges' remarks: -\ We were impressed with the speed at which it was able to factor arbitrarily large numbers consisting of factors that fit into a long. diff --git a/1992/buzzard.1/README.md b/1992/buzzard.1/README.md index 009d8bb29..eaeb0ed3e 100644 --- a/1992/buzzard.1/README.md +++ b/1992/buzzard.1/README.md @@ -182,21 +182,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": -``` +```c if (x) y = z; ``` To implement this, we constrain x to be either 0 or 1, and simply compute: -``` +```c y = (z * x) + (y * (1-x)); ``` This is more obscured by factoring out common terms and restricting ourselves to two operand operations: -``` +```c temp = z; (temp == z) temp -= y; (temp == z-y) temp *= x; (temp == (z-y)*x) @@ -210,7 +210,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: -``` +```c if (pc == some_constant) y = z; ``` diff --git a/1992/gson/README.md b/1992/gson/README.md index ee2382b7a..2e1db78b5 100644 --- a/1992/gson/README.md +++ b/1992/gson/README.md @@ -236,12 +236,10 @@ 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: - ```c main(){int i=0,s=0xAAAA;do{printf("%04x\t",i);}while(i=((i|~s)+1)&s);} ``` - AG uses a similar method but works in the opposite direction, finding the next lower value with zeroes in given bit positions by propagating borrows across those bits. Some additional adjustments are made diff --git a/1992/imc/README.md b/1992/imc/README.md index 00f8ed764..26cc02bae 100644 --- a/1992/imc/README.md +++ b/1992/imc/README.md @@ -22,7 +22,7 @@ make all # text mode ./imc -text -./imc\ +./imc ``` diff --git a/1992/nathan/README.md b/1992/nathan/README.md index 3c0ca2ea1..3c5408e43 100644 --- a/1992/nathan/README.md +++ b/1992/nathan/README.md @@ -66,12 +66,12 @@ distribute winners 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: +```sh +make nathan +./nathan +``` - make nathan - ./nathan - - - to learn how to get a copy of the code. +to learn how to get a copy of the code. See the 1992/nathan.c file in the [../../archive/archive-1992.tar.bz2](archive/archive-1992.tar.bz2) tarball if diff --git a/1992/vern/README.md b/1992/vern/README.md index 60b7da92a..f4e191c32 100644 --- a/1992/vern/README.md +++ b/1992/vern/README.md @@ -19,7 +19,7 @@ make all ## To use: ```sh -./vern 3 # <-- default is 2 +./vern 3 # <-- default is 2 ``` @@ -31,7 +31,7 @@ You might start off by giving the following input: 63 43 76 55 71 52 -67 57 # (this may take a while) +67 57 # <-- this may take a while ``` @@ -47,7 +47,6 @@ For a real quick game try: 65 55 66 46 - ``` NOTE: Move values must be restricted to the range 00 to 77. diff --git a/1992/westley/README.md b/1992/westley/README.md index 58b0b9fa6..2a4354ba4 100644 --- a/1992/westley/README.md +++ b/1992/westley/README.md @@ -35,7 +35,7 @@ show correctly! ### Try: ```sh -./whereami 47 -122 (- means west of meridian) +./whereami 47 -122 # NOTE: - means west of meridian ./whereami 47 122 ``` @@ -66,7 +66,7 @@ NOTE: this alternative version also needs a terminal that wraps at 80 columns. To find the approximate place where this entry was judged, type: ```sh -./whereami 37 -122 (- means west of meridian) +./whereami 37 -122 # NOTE: - means west of meridian ``` @@ -155,8 +155,10 @@ n="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd" 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]... +```c +main(l,a,n,d)... +[A M E R I C A]... +``` ...going down the left edge if your terminal auto-wraps at 80 characters. diff --git a/1993/cmills/README.md b/1993/cmills/README.md index 08b6dd9a7..642043010 100644 --- a/1993/cmills/README.md +++ b/1993/cmills/README.md @@ -38,14 +38,16 @@ From the San Jose Mercury News (May 15, 1993 page 20A "West Hackers\ trounce East in computer quiz game"): -> "Since 1984, a contest has been held on Usenet for the most -> unreadable, creative, bizarre but working C program", Gates -> said. "What is the name of this contest?" -> -> "Windows," shot back Gassee, naming Microsoft's premier product -> - a product over which Apple sued Microsoft five years ago. Not -> the right answer - it's "The Obfuscated C Contest [sic]" - but -> it brought down the house of Apple partisans... +``` +"Since 1984, a contest has been held on Usenet for the most +unreadable, creative, bizarre but working C program", Gates +said. "What is the name of this contest" + +"Windows," shot back Gassee, naming Microsoft's premier product +- a product over which Apple sued Microsoft five years ago. Not +the right answer - it's "The Obfuscated C Contest [sic]" - but +it brought down the house of Apple partisans... +``` [The expression on Bill Gates' face was a sight to behold, as reported to us by several who were there]. diff --git a/1993/dgibson/README.md b/1993/dgibson/README.md index 6c9c9432a..62b13c7ad 100644 --- a/1993/dgibson/README.md +++ b/1993/dgibson/README.md @@ -22,7 +22,7 @@ make all ``` where: -\ + `datafile` is the initial pattern (default: [dgibson.data1](dgibson.data1)) diff --git a/1993/ejb/README.md b/1993/ejb/README.md index 3703a0913..d5030291e 100644 --- a/1993/ejb/README.md +++ b/1993/ejb/README.md @@ -48,7 +48,7 @@ We note that this also works under macOS just fine. #### Output solution to Towers of Hanoi for five rings: ```sh -./ejb 5\ +./ejb 5 ``` The format of the output for the Towers of Hanoi case is simply a @@ -57,7 +57,7 @@ text description of how to solve the puzzle. #### Output solution to the Patience puzzle for six rings: ```sh -./ejb -6\ +./ejb -6 ``` diff --git a/1993/leo/README.md b/1993/leo/README.md index 7097cc29f..ca2458114 100644 --- a/1993/leo/README.md +++ b/1993/leo/README.md @@ -35,7 +35,6 @@ where: ## Judges' remarks: -\ By default, the number of colors is 6. You may specify a value of between 1 and 15 colors. See the author's notes for instructions of how to play. @@ -78,16 +77,16 @@ backspaces. Do "disable scrolling" on cmdtool or similar emulators. ``` judges-385> ./leo - (1296): 6433 - ?? 12 # one 3 is a bull, another is a cow, and 4 is a cow - (160): 5363 - ?? 02 # both 3's are cows - (21): 4231 - ?? 22 # 2 and 3 are bulls, 4 and 1 are cows - (2): 4132 - ?? 13 # 3 is a bull; 1, 2 and 4 are cows - (1): 1234 - ?? 40 # you may enter everything there +(1296): 6433 +?? 12 # one 3 is a bull, another is a cow, and 4 is a cow +(160): 5363 +?? 02 # both 3's are cows +(21): 4231 +?? 22 # 2 and 3 are bulls, 4 and 1 are cows +(2): 4132 +?? 13 # 3 is a bull; 1, 2 and 4 are cows +(1): 1234 +?? 40 # you may enter everything there ``` ##### EXAMPLE: Guess the computer's number diff --git a/1993/plummer/README.md b/1993/plummer/README.md index 5baeda1c8..1f9241584 100644 --- a/1993/plummer/README.md +++ b/1993/plummer/README.md @@ -39,7 +39,6 @@ NOTE: an alternate version exists. See Alternate code section below. To use: - ```sh make alt ``` diff --git a/1993/schnitzi/README.md b/1993/schnitzi/README.md index 988129923..c843dae82 100644 --- a/1993/schnitzi/README.md +++ b/1993/schnitzi/README.md @@ -63,7 +63,7 @@ What is cat? After this program prints the contents of 'file', ask it some questions related to the text. -\ + The author suggests the following questions when using [schnitzi.info](schnitzi.info): diff --git a/1993/vanb/README.md b/1993/vanb/README.md index 8b2f48308..2426af462 100644 --- a/1993/vanb/README.md +++ b/1993/vanb/README.md @@ -37,7 +37,6 @@ What happens if you use something other than valid digits? ## Judges' remarks: -\ The octal expression may contain: ``` @@ -93,7 +92,7 @@ what grammar non-terminal to parse. `**O7` is the next character. `O3` is an intermediate result. Whenever you see a construct like: ``` - !(expression with O2)? +!(expression with O2)? ``` it's decrementing & testing `O2` to see what state it's in. Comparisons diff --git a/1994/schnitzi/README.md b/1994/schnitzi/README.md index 12601711a..cb3004859 100644 --- a/1994/schnitzi/README.md +++ b/1994/schnitzi/README.md @@ -76,7 +76,9 @@ feeding the source code to it will not work right. Try: - ./schnitzi < schnitzi.c +```sh +./schnitzi < schnitzi.c +``` Compare the output of the program with its source. Sure the output is different, but there is more than meets the `diff`'s eye. Can you @@ -104,7 +106,7 @@ The program generates interesting results when its source file is used as input: ```sh - schnitzi < schnitzi.c +schnitzi < schnitzi.c ``` The result of this command is a program which does the exact same diff --git a/1994/tvr/README.md b/1994/tvr/README.md index 4933e1905..6fb2d5ef8 100644 --- a/1994/tvr/README.md +++ b/1994/tvr/README.md @@ -35,9 +35,11 @@ Mode may be a value from 0 to 12. The author has provided us a spoiler version: - make tvr.alt - ./tvr.alt altmode screensize/2 < colormapfile -\ +```sh +make tvr.alt +./tvr.alt altmode screensize/2 < colormapfile +``` + where `altmode` `1` - `4` correspond to mode `0` - `3` in the original entry and `altmode 0` calculates Mandelbrot/Julian sets correctly. diff --git a/1995/cdua/README.md b/1995/cdua/README.md index 897108564..6dc319b3a 100644 --- a/1995/cdua/README.md +++ b/1995/cdua/README.md @@ -79,7 +79,7 @@ make all ### Original use: -``` +```sh ./cdua ``` diff --git a/1995/dodsond1/README.md b/1995/dodsond1/README.md index cc688dcb2..eabe06490 100644 --- a/1995/dodsond1/README.md +++ b/1995/dodsond1/README.md @@ -33,15 +33,17 @@ make all You might consider giving the following input: ``` - ... a male (who) gets very, very frustrated sitting in a chair all - the time because males are biologically driven to go out and hunt - giraffes. - -- Adjunct Professor Newt Gingrich, Reinhardt College, 1/7/95 +... a male (who) gets very, very frustrated sitting in a chair all +the time because males are biologically driven to go out and hunt +giraffes. + -- Adjunct Professor Newt Gingrich, Reinhardt College, 1/7/95 ``` ... which can be done like: - ./dodsond1 < try.this.txt +```c +./dodsond1 < try.this.txt +``` ## Author's remarks: diff --git a/1995/esde/README.md b/1995/esde/README.md index 1aaa0df07..3818be07a 100644 --- a/1995/esde/README.md +++ b/1995/esde/README.md @@ -60,13 +60,15 @@ three-digit code. This is the algorithm: These are the codes: - 0 = A, E, H, I, O, U, W, Y - 1 = B, P, F, V - 2 = C, S, G, J, K, Q, X, Z - 3 = D, T - 4 = L - 5 = M, N - 6 = R +``` +0 = A, E, H, I, O, U, W, Y +1 = B, P, F, V +2 = C, S, G, J, K, Q, X, Z +3 = D, T +4 = L +5 = M, N +6 = R +``` ### information about an info file: diff --git a/1995/garry/README.md b/1995/garry/README.md index cdb56d2f9..762953581 100644 --- a/1995/garry/README.md +++ b/1995/garry/README.md @@ -1,7 +1,7 @@ # Best Utility -Garry Glendown -Germany +Garry Glendown\ +Germany\ @@ -22,7 +22,6 @@ make all ### Try: ```sh - ./garry.test.sh ./garry < README.md @@ -54,7 +53,6 @@ make alt ### Alternate try: ```sh - GARRY=garry.alt ./garry.test.sh ./garry.alt < README.md diff --git a/1995/leo/README.md b/1995/leo/README.md index 4f244956d..3fd8e8f2e 100644 --- a/1995/leo/README.md +++ b/1995/leo/README.md @@ -33,7 +33,7 @@ See the author's information below on these details. If you don't have gs or an equivalent postscript viewer, try: ```sh - echo "" | ./leo 1 > foo.ps +echo "" | ./leo 1 > foo.ps ``` and send foo.ps to your local postscript printer or open it in an appropriate @@ -193,7 +193,6 @@ the opening for step 1 is not a single line but a cross: ``` \./ / \ -\ ``` To watch it repeatedly (as a screensaver), use: diff --git a/1995/makarios/README.md b/1995/makarios/README.md index dbed9c09f..428144741 100644 --- a/1995/makarios/README.md +++ b/1995/makarios/README.md @@ -32,7 +32,9 @@ Can you figure out how it does it? This program takes no arguments. It emits the base 8 representation of prime palindromes (palindromic in base 8, of course). -`^_^` +``` +^_^ +``` ## Copyright and CC BY-SA 4.0 License: diff --git a/1995/savastio/README.md b/1995/savastio/README.md index b132e4beb..a7cfe4d50 100644 --- a/1995/savastio/README.md +++ b/1995/savastio/README.md @@ -53,7 +53,9 @@ containing 1000 buckets of 4-digit integers. To further confuse matters, the buckets are arranged backwards in the block. For example, the number 8347108947139478934713847134 is represented as: - 7134 1384 9347 3947 9471 7108 834 +``` +7134 1384 9347 3947 9471 7108 834 +``` ### Platform limitations diff --git a/1996/jonth/README.md b/1996/jonth/README.md index 06ff957f3..89c6581fd 100644 --- a/1996/jonth/README.md +++ b/1996/jonth/README.md @@ -5,7 +5,7 @@ University of Oslo\ Gaustadveien 10B\ N 0372 Oslo\ Norway\ -http://www.uio.no/~jonth/ + ## To build: diff --git a/1996/rcm/README.md b/1996/rcm/README.md index 222d08dae..3da64214d 100644 --- a/1996/rcm/README.md +++ b/1996/rcm/README.md @@ -62,14 +62,15 @@ meets and actually exceeds specification." #### The Program Metrics Argument: -"The program source is less than 3,100 characters in length and uncompresses -file +"The program source is less than 3,100 characters in length and uncompresses file [emacs-19.34b.tar.gz](https://ftp.gnu.org/old-gnu/emacs/emacs-19.34b.tar.gz) in about 130 seconds on my HP 9000/735. The now obsolete source file `inflate.c' from the GNU gzip source tree is 31,613 characters in length and uncompresses the emacs distribution file in slightly under 25 seconds. Thus: - 3100 / 130 = 23.85 -vs- 31613 / 25 = 1264.52 +``` +3100 / 130 = 23.85 -vs- 31613 / 25 = 1264.52 +``` which represents a better than 530% improvement in the ratio of source file size to execution time." diff --git a/1996/schweikh2/README.md b/1996/schweikh2/README.md index f0c0d5342..ecb500e7c 100644 --- a/1996/schweikh2/README.md +++ b/1996/schweikh2/README.md @@ -48,7 +48,6 @@ The author also suggests: ```sh while :; do grep -v '#' schweikh2.c; done - ``` (and we do too) which works with `sh`, `bash`, `ksh` and `zsh` as well. @@ -143,12 +142,12 @@ minutes (`gcc -O3`). ### Sample arguments: ```sh -$ ./schweikh2 6 -$ ./schweikh2 7 0 -$ ./schweikh2 7 7 0\ -$ ./schweikh2 8 9 -1 -67/21 -$ ./schweikh2 8 2 2/5 -98/25 -$ ./schweikh2 2 1/0 1 1/0 +./schweikh2 6 +./schweikh2 7 0 +./schweikh2 7 7 0 +./schweikh2 8 9 -1 -67/21 +./schweikh2 8 2 2/5 -98/25 +./schweikh2 2 1/0 1 1/0 ``` ### Miscellaneous @@ -157,7 +156,7 @@ The diamond pattern can be continued without a break.\ For a nice printout try this on your Bourne compatible shell: ```sh -% while :; do grep -v '#' schweikh2.c; done +while :; do grep -v '#' schweikh2.c; done ``` diff --git a/1996/schweikh3/README.md b/1996/schweikh3/README.md index 0690efa9e..a6759497f 100644 --- a/1996/schweikh3/README.md +++ b/1996/schweikh3/README.md @@ -46,9 +46,9 @@ and thanks for the virtual memories! :-) NOTE: On some systems such as SunOS, one may need to compile with: ```make - ${CC} ${CFLAGS} \ - -I. -D_POSIX_SOURCE '-Ddifftime(a,b)=(double)(b-a)' \ - schweikh3.c -o schweikh3 + ${CC} ${CFLAGS} \ + -I. -D_POSIX_SOURCE '-Ddifftime(a,b)=(double)(b-a)' \ + schweikh3.c -o schweikh3 ``` diff --git a/1998/dlowe/README.md b/1998/dlowe/README.md index f4363a2d7..db385ec75 100644 --- a/1998/dlowe/README.md +++ b/1998/dlowe/README.md @@ -2,7 +2,7 @@ David Lowe\ US\ - +\ diff --git a/1998/dloweneil/README.md b/1998/dloweneil/README.md index e1a393373..531986768 100644 --- a/1998/dloweneil/README.md +++ b/1998/dloweneil/README.md @@ -47,9 +47,11 @@ Pressing `d` drops the current letter onto the board. Read the authors' remarks below to find out how to play. We believe that your experience may mirror one of our experiences: -> Originally, I didn't appreciate the game. Then I actually read the -> description of the controls. I started playing. I struggled. -> I spelled my first "poot". I was hooked ... +``` +Originally, I didn't appreciate the game. Then I actually read the +description of the controls. I started playing. I struggled. +I spelled my first "poot". I was hooked ... +``` ## Author's remarks: @@ -69,7 +71,7 @@ around the border of the playing board, and decide when and where to drop it into the board. Sound easy? Of course, there's a catch... ### Controls -\ + Only three controls: 'a' moves the current letter one position counterclockwise around @@ -160,7 +162,6 @@ places. - Some way of quitting gracefully. - Good Luck! diff --git a/1998/fanf/README.md b/1998/fanf/README.md index 44147f999..01b063072 100644 --- a/1998/fanf/README.md +++ b/1998/fanf/README.md @@ -1,7 +1,7 @@ # Most Obfuscated Translator -Tony Finch -United Kingdom +Tony Finch\ +United Kingdom\ @@ -179,24 +179,24 @@ couple of simple optimisations. For example, note that `K (a b)` is the same as `S (K a) (K b)`, because ``` - K (a b) x - -> a b + K (a b) x +-> a b ``` and ``` - S (K a) (K b) x - -> K a x (K b x) - -> a b + S (K a) (K b) x +-> K a x (K b x) +-> a b ``` Also, `S (K a) I` is the same as just `a` because ``` - S (K a) I x - -> K a x (I x) - -> a x + S (K a) I x +-> K a x (I x) +-> a x ``` The program simply reads a lambda expression from the standard input, diff --git a/1998/schnitzi/README.md b/1998/schnitzi/README.md index 4470ae395..1ec290e1e 100644 --- a/1998/schnitzi/README.md +++ b/1998/schnitzi/README.md @@ -1,7 +1,7 @@ # Best Flow Control -Mark Schnitzius -US +Mark Schnitzius\ +US\ diff --git a/1998/schweikh1/README.md b/1998/schweikh1/README.md index 219ea9426..e56e28d29 100644 --- a/1998/schweikh1/README.md +++ b/1998/schweikh1/README.md @@ -221,19 +221,19 @@ C compilers. must resemble one of the canonical forms, `"foo.h"` or ``. This lets us write things like - ```c\ - #define HEADER "foo.h" - #include HEADER - ``` + ```c + #define HEADER "foo.h" + #include HEADER + ``` I could not find a compiler rejecting this. However, if we're torturing the preprocessor a little more, by using token pasting, at least one compiler falls over. - ```c - #define H(x) - #include H(dio) /* expands to */ - ``` +```c +#define H(x) +#include H(dio) /* expands to */ +``` is rejected by tcc version 4.1.2, the TenDRA compiler: ``` @@ -253,21 +253,21 @@ 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 - ```c - #include - #line 42 "foo\0bar" - int main (void) { - printf ("%s %d\n", __FILE__, (int)sizeof __FILE__); - return 0; - } - ``` +```c +#include +#line 42 "foo\0bar" +int main (void) { + printf ("%s %d\n", __FILE__, (int)sizeof __FILE__); + return 0; +} +``` This is supposed to output `'foo 8'`. Here's what happens in RL: - ``` - foo 4 gcc 2.7.2.1, lcc - foo\0bar 9 tcc 4.1.2, Sunsoft cc turn "\0" into "\\0", ugh! - ``` +``` +foo 4 gcc 2.7.2.1, lcc +foo\0bar 9 tcc 4.1.2, Sunsoft cc turn "\0" into "\\0", ugh! +``` (I have written a bug report for gcc. Newer versions and egcs are ok.) diff --git a/1998/schweikh2/README.md b/1998/schweikh2/README.md index 84ceb5f37..fa47eb484 100644 --- a/1998/schweikh2/README.md +++ b/1998/schweikh2/README.md @@ -54,7 +54,7 @@ make schweikh2 often produced an error of the form: -``` +```sh gcc -ansi schweikh2.alt.c -o schweikh2.alt as: Error: cca00NzV.s, line 58: Missing " at end of string " diff --git a/2000/bmeyer/README.md b/2000/bmeyer/README.md index d68f1c716..d74d8c008 100644 --- a/2000/bmeyer/README.md +++ b/2000/bmeyer/README.md @@ -5,8 +5,7 @@ Monash University, Melbourne, Australia\ 1/832 Blackburn Rd\ Clayton, VIC 3168\ Australia\ -\ -\ + ## To build: @@ -56,7 +55,7 @@ Create a large reverse video xterm, say 200 columns wide and try: ``` Produce an even smaller output: -\ + ```sh ./bmeyer -2 200 < lavabus.pgm > lavabus.glic2 ``` @@ -114,6 +113,7 @@ The [Makefile](Makefile) defaults to `-O3` and no `asm()` call. This program is called `GLICBAWLS` + #### Function `GLICBAWLS` stands for "Grey Level Image Compression By Adaptive Weighted Least @@ -197,15 +197,13 @@ considerably better. And don't even *think* about using it for so-called "artistic" images (i.e. anything that wasn't scanned from a photo or camera).... -### WARNING +### WARNING `Glicball` is rather CPU and FPU intensive. Don't run it on anything slow. Things start to be usable around 300+MHz, with 600+ being highly desirable. - - ### Compile Instructions Unlike most compression program, `glicbawls` makes heavy use of diff --git a/2000/dlowe/README.md b/2000/dlowe/README.md index 66302afa4..db5c98359 100644 --- a/2000/dlowe/README.md +++ b/2000/dlowe/README.md @@ -52,7 +52,9 @@ of the submitters hidden until all the prize winners have been selected. ### Usage +``` ./dlowe [file ...] +``` ### Synopsis diff --git a/2000/jarijyrki/README.md b/2000/jarijyrki/README.md index 8bda3450e..c2a5a3027 100644 --- a/2000/jarijyrki/README.md +++ b/2000/jarijyrki/README.md @@ -4,8 +4,8 @@ Jari Arkko\ Kauppalantie 25A7\ 02700 Kauniainen\ Finland\ -\ -\ + + Jyrki Holopainen\ Forsellesintie 1-3A10\ 02700 Kauniainen\ diff --git a/2000/natori/README.md b/2000/natori/README.md index 3f2742285..cd7d9f354 100644 --- a/2000/natori/README.md +++ b/2000/natori/README.md @@ -1,6 +1,6 @@ # Best Small Program -NATORI Shin +NATORI Shin\ Japan diff --git a/2000/rince/README.md b/2000/rince/README.md index acf63ee99..a0b8b750d 100644 --- a/2000/rince/README.md +++ b/2000/rince/README.md @@ -129,13 +129,13 @@ from inside the monitor whilst standing on your head. In case of confusion, please consult the following chart (\*): ``` - N - ^ - | - E <---+---> W - | - v - S + N + ^ + | + E <---+---> W + | + v + S ``` (\*) Not to scale. diff --git a/2000/thadgavin/README.md b/2000/thadgavin/README.md index c5f27ca31..8ef4d2592 100644 --- a/2000/thadgavin/README.md +++ b/2000/thadgavin/README.md @@ -1,8 +1,8 @@ # Most Portable Output Thaddaeus Frogley\ -UK\ -\ +UK + Gavin Buttimore\ UK diff --git a/2000/tomx/README.md b/2000/tomx/README.md index a0d9fcb6c..bab9c0608 100644 --- a/2000/tomx/README.md +++ b/2000/tomx/README.md @@ -95,9 +95,11 @@ the `main()`, leaving the complexities of the C file elsewhere and making this source still acceptable to `make` and `sh`. The following modification to the last few lines will compile the IOCCC's famous [mkentry.c](mkentry.c). - .PHONY: /* true clean */\ - #undef true\ - #include "mkentry.c" +``` +.PHONY: /* true clean */ +#undef true +#include "mkentry.c" +``` Ain't that useful? diff --git a/2001/bellard/README.md b/2001/bellard/README.md index 86d12cd60..d785ff3bb 100644 --- a/2001/bellard/README.md +++ b/2001/bellard/README.md @@ -66,19 +66,25 @@ or by giving the C source to its standard input. - Sample compilation and execution: - ./bellard bellard.otccex.c 10 +```sh +./bellard bellard.otccex.c 10 +``` - Self compilation: - ./bellard bellard.c bellard.otccex.c 10 +```sh +./bellard bellard.c bellard.otccex.c 10 +``` - Self compilation iterated... - ./bellard bellard.c bellard.c bellard.otccex.c 10 -\ - An alternate syntax is to use it as a script interpreter: you can - put `#!/usr/local/bin/otcc` at the beginning of your C source if - you installed `otcc` at this place. +```sh +./bellard bellard.c bellard.c bellard.otccex.c 10 +``` + +An alternate syntax is to use it as a script interpreter: you can +put `#!/usr/local/bin/otcc` at the beginning of your C source if +you installed `otcc` at this place. ### Supported C language subset (read joint example [bellard.otccex.c](bellard.otccex.c) to have an introduction to `OTCC` dialect) diff --git a/2001/jason/README.md b/2001/jason/README.md index 3d043ecb5..878eca448 100644 --- a/2001/jason/README.md +++ b/2001/jason/README.md @@ -1,9 +1,9 @@ # Best Of Show -Jason Orendorff -5 Buchanan St. -Nashua, NH 03060 -US +Jason Orendorff\ +5 Buchanan St.\ +Nashua, NH 03060\ +US\ @@ -49,14 +49,13 @@ TED Shroyer came up with the idea that made it possible to hide all the text. Thanks, TED. You won. :) ```sh -$ cc -o jason jason.c -$ ./jason +cc -o jason jason.c +./jason you are in a maze of twisty little passages caves lead: left forward back you see a lamp > _ - ``` This program is a rather nostalgic little labyrinth game. Start diff --git a/2001/ollinger/README.md b/2001/ollinger/README.md index 43521c053..2329bc2ef 100644 --- a/2001/ollinger/README.md +++ b/2001/ollinger/README.md @@ -1,7 +1,7 @@ # Best of Show -Nicolas Ollinger -France +Nicolas Ollinger\ +France\ @@ -80,35 +80,36 @@ Q: Are there types of entries that are submitted so frequently that the A: Yes, there are types of entries that show up over and over again. The guidelines say: - We tend to dislike programs that: - are similar to previous winners +``` +We tend to dislike programs that: +are similar to previous winners - We like variety. However too often we see (please look at the winning - examples given to be aware of the level of the competition): +We like variety. However too often we see (please look at the winning +examples given to be aware of the level of the competition): (snip) - generating small primes (below is the list of all - prime related winners) - 1985/august - 1988/applin - 1994/weisberg - 1995/makarios - 1996/dalbec - 2000/bellard +generating small primes (below is the list of all prime related winners) - As you can see, just a list of primes (let alone small primes) - does not cut it anymore. + 1985/august + 1988/applin + 1994/weisberg + 1995/makarios + 1996/dalbec + 2000/bellard + +As you can see, just a list of primes (let alone small primes) +does not cut it anymore. (snip) - entries that use some complex state machine/table to print - something +entries that use some complex state machine/table to print something - 1988/isaak - 1988/phillipps + 1988/isaak + 1988/phillipps - Unbeaten for 12 years and counting... +Unbeaten for 12 years and counting... +``` I think this is enough motivation for trying to submit a program which uses some complex state machine/table to generate small primes and print them. diff --git a/2001/westley/README.md b/2001/westley/README.md index e13d400e2..8265ade48 100644 --- a/2001/westley/README.md +++ b/2001/westley/README.md @@ -1,7 +1,7 @@ # Best position-independent code -Brian Westley -US +Brian Westley\ +US\ @@ -202,9 +202,11 @@ comment), there are technically `28!` different programs, or `304,888,344,611,713,860,501,504,000,000` different versions, all legal C. +``` \* except in Florida voting machines \*\* all cards must be face down, nine-edge first, of course. +``` ## Copyright and CC BY-SA 4.0 License: diff --git a/2001/williams/README.md b/2001/williams/README.md index a6e79fc22..5d1a33caf 100644 --- a/2001/williams/README.md +++ b/2001/williams/README.md @@ -1,6 +1,6 @@ # Best Graphic Game -John Williams +John Williams\ US diff --git a/2004/gavin/README.md b/2004/gavin/README.md index da78d29b4..b750162f1 100644 --- a/2004/gavin/README.md +++ b/2004/gavin/README.md @@ -41,7 +41,6 @@ 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: - ```sh cp kernel fs.tar lilo.conf boot.b /mnt/floppy ``` @@ -175,7 +174,9 @@ Accesses to data in the string are made relative to the define `V`, so these may need updating as appropriate (`0x90200` is the address at which a Linux bootloader loads an x86 kernel image). +``` \* ;-) +``` ## Copyright and CC BY-SA 4.0 License: diff --git a/2004/hibachi/README.md b/2004/hibachi/README.md index 0103a1d00..903a8eaed 100644 --- a/2004/hibachi/README.md +++ b/2004/hibachi/README.md @@ -186,12 +186,12 @@ style](https://wiki.c2.com/?OneTrueBraceStyle). ### Suggested IOCCC Categories - Best Utility - Best Support - Most Portable Package - Most Likely to Cook Apache - Best Interpretation of RFC 2616 - Winner of The Far Too Much Free Time Award +* Best Utility +* Best Support +* Most Portable Package +* Most Likely to Cook Apache +* Best Interpretation of RFC 2616 +* Winner of The Far Too Much Free Time Award ## Copyright and CC BY-SA 4.0 License: diff --git a/2004/kopczynski/README.md b/2004/kopczynski/README.md index 1a89cd6b0..ef0538213 100644 --- a/2004/kopczynski/README.md +++ b/2004/kopczynski/README.md @@ -135,37 +135,47 @@ numbers from 8 to 11. 2. We know that [Euler characteristics](https://en.wikipedia.org/wiki/Euler_characteristic) is the number of "vertexes" +``` # +``` - minus the number of "edges" +minus the number of "edges" +``` ## # #. .# # .# #. ('.' must be empty) +``` - plus the number of "faces" +plus the number of "faces" +``` ## ## +``` 3. If we fill all these patterns to 2x2 squares, +``` #? ## #? #. .# ## ?? ?? #? .# #. ## +1 -1 -1 -1 -1 +1 +``` - substitute all possible "values" of `?` and sum them up, we get that it is - enough to calculate: +substitute all possible "values" of `?` and sum them up, we get that it is +enough to calculate: +``` #. .# ## .. #. #. +1 -1 -1 +``` - Note now it is simple and obfuscated enough to be used as - a "magic trick". +Note now it is simple and obfuscated enough to be used as +a "magic trick". 4. I make a 16-character array; when indexed by 4-bit value which - represents the 2x2 squares, it will return a number to add/subtract - `{-1,0,+1}` +represents the 2x2 squares, it will return a number to add/subtract +`{-1,0,+1}` 5. We convert lines of input to bitmaps (`N-bit` integers). Additionally, it is heavily obfuscated by using negative numbers (two's complement). For example, @@ -180,14 +190,16 @@ we use 15-character string.) 7. Since the rule found in (3) did not produce any funny messages, I changed it until it did. (The `#` character to find vertexes is in the top right corner, not the top left one.) The following messages will also work instead of `has dirtiest IF`: - HighlandYachter - TestDirtiestTen - has lintiest IF - TighterLaughter - HustlerDaughter - TighterDemoThen +``` +HighlandYachter +TestDirtiestTen +has lintiest IF +TighterLaughter +HustlerDaughter +TighterDemoThen +``` - They can be mixed, of course! +They can be mixed, of course! 8. NOTE: item 8 was removed by the judges so as to not spoil the challenge of figuring how arguments can be used to alter the exit value. diff --git a/2004/newbern/README.md b/2004/newbern/README.md index 204bac2ab..8687be9d0 100644 --- a/2004/newbern/README.md +++ b/2004/newbern/README.md @@ -40,12 +40,16 @@ This is a configurable banner-like program. - To convert a character glyph into a data file: - ./newbern char < some_nicely_shaped_text >> data_file +```sh +./newbern char < some_nicely_shaped_text >> data_file +``` - To print a string using glyphs from a data file: - ./newbern data_file a_string +```sh +./newbern data_file a_string +``` ### Extra functionality diff --git a/2005/sykes/README.md b/2005/sykes/README.md index 9180bf5cd..b0d54a5a3 100644 --- a/2005/sykes/README.md +++ b/2005/sykes/README.md @@ -307,7 +307,7 @@ What does this do? ```sh ./sykes pet.rom -1 ``` -\ + Have fun! diff --git a/2006/birken/README.md b/2006/birken/README.md index a78d4971e..876b38e7c 100644 --- a/2006/birken/README.md +++ b/2006/birken/README.md @@ -2,7 +2,7 @@ Michael Birken\ US\ - + ## To build: diff --git a/2006/borsanyi/README.md b/2006/borsanyi/README.md index f14800ce0..8bc362d19 100644 --- a/2006/borsanyi/README.md +++ b/2006/borsanyi/README.md @@ -2,7 +2,7 @@ Szabolcs Borsanyi\ United Kingdom\ -s.borsanyi at sussex dot ac dot uk + ## To build: diff --git a/2006/monge/README.md b/2006/monge/README.md index fb5bffaf2..618e85832 100644 --- a/2006/monge/README.md +++ b/2006/monge/README.md @@ -1,7 +1,7 @@ # Best Compiled Graphics -Maurizio Monge -Italy +Maurizio Monge\ +Italy\ @@ -74,7 +74,9 @@ effort to work on both `i386` and `x86_64`. Portable it is! :) 1. Run: - ./monge "z = 0" "z = z*z + c; Abs2(z) < 4" +``` +./monge "z = 0" "z = z*z + c; Abs2(z) < 4" +``` 2. Keep clicking with left or right button to zoom in or out. @@ -145,15 +147,21 @@ Here are a few examples of fractals you can draw: - 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" +``` +./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" +``` +./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" +``` +./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" +``` ### Compilation and portability diff --git a/2006/night/README.md b/2006/night/README.md index 3edb1667c..728c91a58 100644 --- a/2006/night/README.md +++ b/2006/night/README.md @@ -1,7 +1,7 @@ # Best Abuse of Computation -Christopher Night -US +Christopher Night\ +US\ diff --git a/2006/sykes1/README.md b/2006/sykes1/README.md index 5e592b238..668ed19be 100644 --- a/2006/sykes1/README.md +++ b/2006/sykes1/README.md @@ -42,15 +42,19 @@ time ./sykes1 19186 This was done on a CentOS 7 server with `Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz` with 16 cores (via HyperThreading): - real 7m48.287s - user 7m48.223s - sys 0m0.004s +``` +real 7m48.287s +user 7m48.223s +sys 0m0.004s +``` and done with macOS Ventura with the Max M1 chip: - real 8m26.466s - user 8m23.134s - sys 0m2.981s +``` +real 8m26.466s +user 8m23.134s +sys 0m2.981s +``` ## Judges' remarks: diff --git a/2011/dlowe/README.md b/2011/dlowe/README.md index 56324f66f..18b405b80 100644 --- a/2011/dlowe/README.md +++ b/2011/dlowe/README.md @@ -112,9 +112,11 @@ that did not win were flushed to `/dev/null`. The [earlystop.pl](earlystop.pl) tool wrote: - training 1 to 1001... - training 1001 to 2001... - prior error = 56.746974766043; current error = 58.095691135305 +``` +training 1 to 1001... +training 1001 to 2001... +prior error = 56.746974766043; current error = 58.095691135305 +``` The resulting `ioccc-winlose-trained.net` file was included in the [dlowe-aux-data.tar.bz2](dlowe-aux-data.tar.bz2) tarball. diff --git a/2011/goren/README.md b/2011/goren/README.md index 525f62bd8..0da67e62b 100644 --- a/2011/goren/README.md +++ b/2011/goren/README.md @@ -61,8 +61,10 @@ a pipe. But what IS a pipe? This program tries to provide an answer. Magritte's [test for pipes](http://en.wikipedia.org/wiki/The_Treachery_of_Images) is: -> The famous pipe. How people reproached me for it! And yet, could -> you stuff my pipe? No, it's just a representation, is it not? +``` +The famous pipe. How people reproached me for it! And yet, could +you stuff my pipe? No, it's just a representation, is it not? +``` Accordingly, this program only approves pipes which can be used for stuffing data. diff --git a/2011/hamaji/README.md b/2011/hamaji/README.md index 41b13fbd7..4d2b04f99 100644 --- a/2011/hamaji/README.md +++ b/2011/hamaji/README.md @@ -61,7 +61,7 @@ Game of Life](http://en.wikipedia.org/wiki/Conway's_Game_of_Life): 1 . 112 -\ + 1 X 1 X 3 XXX @@ -110,8 +110,8 @@ There are two solutions: ``` 11 -\ - 1 X\ + + 1 X 1 X ``` @@ -119,9 +119,9 @@ and ``` 11 -\ + 1 X - 1 X\ + 1 X ``` ### Detail diff --git a/2011/konno/README.md b/2011/konno/README.md index 74fa72fd8..b962c7b66 100644 --- a/2011/konno/README.md +++ b/2011/konno/README.md @@ -52,7 +52,7 @@ This program ignores non-lower case letters. ### Obfuscation -* `for` is not used.\ +* `for` is not used. * A part of the program is encrypted. diff --git a/2012/dlowe/README.md b/2012/dlowe/README.md index 613637dfa..1fe591070 100644 --- a/2012/dlowe/README.md +++ b/2012/dlowe/README.md @@ -1,7 +1,7 @@ # Best way to lose a life J. David Lowe\ -US +US\ \ diff --git a/2012/zeitak/README.md b/2012/zeitak/README.md index 4f0b83284..16a83e15d 100644 --- a/2012/zeitak/README.md +++ b/2012/zeitak/README.md @@ -1,7 +1,7 @@ # Balanced use of obfuscation - Gold award - Adar Zeitak\ - +Adar Zeitak\ + ## To build: @@ -82,7 +82,9 @@ around it's position. * Ignores parenthesis inside strings or character constants, so no errors will be detected in the following line: - printf(")"); +```c +printf(")"); +``` * Doesn't get confused by the [1984/anonymous](/1984/anonymous/anonymous.c) entry! @@ -91,7 +93,9 @@ around it's position. * Escapes (e.g. `\"`) are ignored, so the following line will produce an error: - printf("\""); +```c +printf("\""); +``` #### Obfuscation @@ -125,9 +129,10 @@ only function calls, typecasts, array lookups and pointer operators. at least two bytes long. * The program was tested on the following platforms: - - Ubuntu 9.04 32-bit with GCC - - Windows 7 32-bit with GCC - - Windows 7 32-bit with OpenWatcom + +- Ubuntu 9.04 32-bit with GCC +- Windows 7 32-bit with GCC +- Windows 7 32-bit with OpenWatcom ## Copyright and CC BY-SA 4.0 License: diff --git a/2013/cable2/README.md b/2013/cable2/README.md index 8743474f9..293c65ac9 100644 --- a/2013/cable2/README.md +++ b/2013/cable2/README.md @@ -1,7 +1,7 @@ # Best of show Adrian Cable\ -\ + ## To build: diff --git a/2013/endoh2/README.md b/2013/endoh2/README.md index 88d835ef9..cdc168d78 100644 --- a/2013/endoh2/README.md +++ b/2013/endoh2/README.md @@ -57,9 +57,9 @@ straightforward bitmap comparison. * LZ77-like compression for font and template data * tiny JPEG encoder - * Zig-zag space-filling curve - * Discrete cosine transform - * JPEG Huffman encoding (cheating) + * Zig-zag space-filling curve + * Discrete cosine transform + * JPEG Huffman encoding (cheating) ### Notes diff --git a/2013/hou/README.md b/2013/hou/README.md index 2d2678b2a..536f26cfa 100644 --- a/2013/hou/README.md +++ b/2013/hou/README.md @@ -2,7 +2,7 @@ Qiming Hou\ \ -\ + ## To build: diff --git a/2014/maffiodo1/README.md b/2014/maffiodo1/README.md index 6437a5639..d27d6c011 100644 --- a/2014/maffiodo1/README.md +++ b/2014/maffiodo1/README.md @@ -1,8 +1,8 @@ # Homage to a classic game - Sandro Maffiodo\ - \ - +Sandro Maffiodo\ +\ + ## To build: diff --git a/2014/maffiodo2/README.md b/2014/maffiodo2/README.md index 684059a1b..6635949c0 100644 --- a/2014/maffiodo2/README.md +++ b/2014/maffiodo2/README.md @@ -1,8 +1,8 @@ # Most tweetable entry - Sandro Maffiodo\ - \ - +Sandro Maffiodo\ +\ + ## To build: diff --git a/2014/morgan/README.md b/2014/morgan/README.md index 18b83835a..6d85373ac 100644 --- a/2014/morgan/README.md +++ b/2014/morgan/README.md @@ -1,7 +1,7 @@ # Most likely to succeed - Yves-Marie Morgan\ - +Yves-Marie Morgan\ + ## To build: diff --git a/2014/sinon/README.md b/2014/sinon/README.md index 3eca2f220..1d0db1e26 100644 --- a/2014/sinon/README.md +++ b/2014/sinon/README.md @@ -1,8 +1,8 @@ # Best choice of optimization - Don Yang\ - \ - +Don Yang\ +\ + ## To build: diff --git a/2014/skeggs/README.md b/2014/skeggs/README.md index dae43d512..1ae518ace 100644 --- a/2014/skeggs/README.md +++ b/2014/skeggs/README.md @@ -1,8 +1,8 @@ # Most dynamic - Cel Skeggs\ - \ - +Cel Skeggs\ +\ + ## To build: @@ -79,29 +79,29 @@ The current size is a third to a half of the original size before compression. Due to this, it does LOTS of things that subtly annoy compilers! - * (10) data argument not used by format string +* (10) data argument not used by format string - This occurs because some of the fprintf invocations don't use all their - parameters. The program should still work fine! + This occurs because some of the fprintf invocations don't use all their + parameters. The program should still work fine! - * (1) using the result of an assignment as a condition without parentheses +* (1) using the result of an assignment as a condition without parentheses - Somewhere, I needed to set a variable and then branch on the result. The - shortest way was to combine them. Some self-proclaimed "EXPERTS" think this - is a bad programming practice, but what do they know? :P + Somewhere, I needed to set a variable and then branch on the result. The + shortest way was to combine them. Some self-proclaimed "EXPERTS" think this + is a bad programming practice, but what do they know? :P - * (1) implicit declaration of function 'time' is invalid in C99 +* (1) implicit declaration of function 'time' is invalid in C99 - An `#include` statement is expensive, and I'm broke. + An `#include` statement is expensive, and I'm broke. - * (1) control may reach end of non-void function +* (1) control may reach end of non-void function - Turns out that sometimes, a return statement is too much. This will never - actually occur, but some C compilers think they know more about my program - than I do! :P + Turns out that sometimes, a return statement is too much. This will never + actually occur, but some C compilers think they know more about my program + than I do! :P - * (?) Under some systems, `-fPIC` is irrelevant for shared libraries. If so, - you should remove it from the Makefile. +* (?) Under some systems, `-fPIC` is irrelevant for shared libraries. If so, + you should remove it from the Makefile. ## OBFUSCATION? WHAT OBFUSCATION? THIS IS A PERFECTLY NORMAL C PROGRAM! @@ -180,56 +180,56 @@ This program is a very easy program to cause to fail! Some things to check - * On line 16, where it says `%cinclude "prog.c"`, is `prog.c` the name of the - original source code file? - * Do you have ncurses installed? - * Does your system have `ncurses.h` (like a nice system) or - `ncurses/ncurses.h` (like a rude system) ? +* On line 16, where it says `%cinclude "prog.c"`, is `prog.c` the name of the + original source code file? +* Do you have ncurses installed? +* Does your system have `ncurses.h` (like a nice system) or + `ncurses/ncurses.h` (like a rude system) ? - If it's the latter (or some other path), you'll need to update line 97. + If it's the latter (or some other path), you'll need to update line 97. - (I had to do this under Cygwin.) - * Does your system need `-fPIC` (or other arcane invocations) to compile a - shared library? If so, make sure that you include it in the -DCC argument in - the build script. - * Does your system have a vague dislike for `-fPIC`? (Like Cygwin.) You might - need to remove it from the build script. - * Does your system support `__attribute__((constructor))`? It needs to. - * Check the file `err`. Maybe it will help you figure out why a runtime- - generated program failed. The failing program should be found in `t.c`. - * Can't run a beautifier on the source code? I'm not going to help you there. + (I had to do this under Cygwin.) +* Does your system need `-fPIC` (or other arcane invocations) to compile a + shared library? If so, make sure that you include it in the -DCC argument in + the build script. +* Does your system have a vague dislike for `-fPIC`? (Like Cygwin.) You might + need to remove it from the build script. +* Does your system support `__attribute__((constructor))`? It needs to. +* Check the file `err`. Maybe it will help you figure out why a runtime- + generated program failed. The failing program should be found in `t.c`. +* Can't run a beautifier on the source code? I'm not going to help you there. I've tested it on the following platforms, in case you need to try it on one: - * 64-bit Windows 7 32-bit Cygwin with gcc 4.8.2 and standards c89, c90, c99, - and c11. Note that the program ran as 32-bit due to the version of cygwin. - * 64-bit Arch Linux with gcc 4.9.1 and standards c89, c90, c99, c11. - * 64-bit Arch Linux with clang 3.5.0 and standards c89 and c11. +* 64-bit Windows 7 32-bit Cygwin with gcc 4.8.2 and standards c89, c90, c99, + and c11. Note that the program ran as 32-bit due to the version of cygwin. +* 64-bit Arch Linux with gcc 4.9.1 and standards c89, c90, c99, c11. +* 64-bit Arch Linux with clang 3.5.0 and standards c89 and c11. I ran out of time to test it on more systems. ### Q&A - * Who am I? +* Who am I? - Yes. + Yes. - * Why doesn't your program require a pet fish license? +* Why doesn't your program require a pet fish license? - THE LEMONLORD's pet LEMONFISH was not rendered in the game, and so does not - require a pet fish license. + THE LEMONLORD's pet LEMONFISH was not rendered in the game, and so does not + require a pet fish license. - * Was this inspired by anything? +* Was this inspired by anything? - Yes, this was inspired by a minigame from an open-source codebase of Space - Station 13. I didn't, however, look at the minigame at all during the - development of this entry. + Yes, this was inspired by a minigame from an open-source codebase of Space + Station 13. I didn't, however, look at the minigame at all during the + development of this entry. - * What's the length of this REMARKS file according to the iocccsize tool? +* What's the length of this REMARKS file according to the iocccsize tool? - `$ ./iocccsize -i +Freek Wiedijk\ + ## To build: @@ -51,8 +51,10 @@ If you win a bet by demonstrating this entry, please let us know. - recursion implemented through Curry's paradoxical combinator `Y` - the readable implementation of `Y` is on lines 29-30: - W_f = \x.f(xx) - Y = \f.W_f W_f +``` +W_f = \x.f(xx) +Y = \f.W_f W_f +``` - a mixture of strict and lazy evaluation, with a `_` force function (John Tromp notes that if Turing's fixed-point combinator diff --git a/2015/burton/README.md b/2015/burton/README.md index 54a2b69f3..db39fae9c 100644 --- a/2015/burton/README.md +++ b/2015/burton/README.md @@ -1,7 +1,8 @@ # Most Useful - Dave Burton - +Dave Burton\ +\ + ## To build: @@ -194,17 +195,20 @@ long`. Changing the two `long long` typedefs to `long`, and compiling with `gcc -m32` yields a program that operates on 32-bit values, with wrap-around of shifts mod 32: - 1<<48 - 65536 0x00010000 +``` +1<<48 +65536 0x00010000 +``` gcc 4.2.1 without arguments compiles cleanly (e.g. cc prog.c -o prog). This is my workaday compiler. gcc is also clean with -ansi, and -std=c99. clang 3.6.0 lives up to its namesake, resounding on non-problems. To stifle these complaints: -\ - -Wno-return-type -Wno-parentheses -Wno-empty-body +``` +-Wno-return-type -Wno-parentheses -Wno-empty-body +``` When invoked with -ansi -pedantic, there are two warnings, which can be ignored: diff --git a/2015/dogon/README.md b/2015/dogon/README.md index 2bcba5afd..7fad6cdf3 100644 --- a/2015/dogon/README.md +++ b/2015/dogon/README.md @@ -1,7 +1,7 @@ # Most Crafty - Gil Dogon\ - +Gil Dogon\ + ## To build: diff --git a/2015/duble/README.md b/2015/duble/README.md index a9d131f05..f2cf1555e 100644 --- a/2015/duble/README.md +++ b/2015/duble/README.md @@ -1,7 +1,7 @@ # Best Handwriting - Etienne Duble \ - +Etienne Duble \ + ## To build: @@ -161,7 +161,9 @@ macro `O_o` at the top of the source file. In order to comply with the size rule, I encoded only a part of the visible ASCII chars: - a-z, A-Z, '.' ':' ',' ';' '!' and '?'. +``` +a-z, A-Z, '.' ':' ',' ';' '!' and '?'. +``` Uppercase and lowercase chars are rendered the same. The program also understand the space and the linefeed (\n). Other chars are simply ignored (most of the diff --git a/2015/endoh1/README.md b/2015/endoh1/README.md index 2f2763549..2525d8b95 100644 --- a/2015/endoh1/README.md +++ b/2015/endoh1/README.md @@ -158,15 +158,17 @@ This specifies a color used for rendering. Some interesting parameters are included in `Makefile`. Do one of the following command and open `http://127.0.0.1:10333`. - $ make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 ioccc.txt - $ make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 center.txt - $ make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 line.txt - $ make gray-scott-2 && tcpserver -v 127.0.0.1 10333 ./gray-scott-2 ioccc.txt - $ make gray-scott-3 && tcpserver -v 127.0.0.1 10333 ./gray-scott-3 ioccc.txt - $ make gray-scott-4 && tcpserver -v 127.0.0.1 10333 ./gray-scott-4 ioccc.txt - $ make fitzhugh-nagumo-1 && tcpserver -v 127.0.0.1 10333 ./fitzhugh-nagumo-1 ioccc.txt - $ make fitzhugh-nagumo-2 && tcpserver -v 127.0.0.1 10333 ./fitzhugh-nagumo-2 ioccc.txt - $ make oregonator && tcpserver -v 127.0.0.1 10333 ./oregonator ioccc.txt +``` +make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 ioccc.txt +make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 center.txt +make gray-scott-1 && tcpserver -v 127.0.0.1 10333 ./gray-scott-1 line.txt +make gray-scott-2 && tcpserver -v 127.0.0.1 10333 ./gray-scott-2 ioccc.txt +make gray-scott-3 && tcpserver -v 127.0.0.1 10333 ./gray-scott-3 ioccc.txt +make gray-scott-4 && tcpserver -v 127.0.0.1 10333 ./gray-scott-4 ioccc.txt +make fitzhugh-nagumo-1 && tcpserver -v 127.0.0.1 10333 ./fitzhugh-nagumo-1 ioccc.txt +make fitzhugh-nagumo-2 && tcpserver -v 127.0.0.1 10333 ./fitzhugh-nagumo-2 ioccc.txt +make oregonator && tcpserver -v 127.0.0.1 10333 ./oregonator ioccc.txt +``` These examples are created by drawing (and modifying) the pattern files of [Ready](https://github.com/GollyGang/ready), a cross-platform implementation of diff --git a/2015/endoh2/README.md b/2015/endoh2/README.md index 88c2d2854..0e2384cd4 100644 --- a/2015/endoh2/README.md +++ b/2015/endoh2/README.md @@ -32,22 +32,24 @@ cat prog.c At this point you might be wondering, [WTF](http://acronyms.thefreedictionary.com/WTF)?\* - * What The Freak (polite form) +* What The Freak (polite form) - * What's This For? (you may be wondering) +* What's This For? (you may be wondering) - * What the Fish (python form) +* What the Fish (python form) How is this code obfuscated? Well look again: - less prog.c +```sh +less prog.c - more prog.c +more prog.c +``` Where did those underscores come from? Well [RTFS](http://acronyms.thefreedictionary.com/RTFS)!\*\* - ** Read the Freaking Source (polite form) - ** Read The Freakin' Screen (polite form) +** Read the Freaking Source (polite form) +** Read The Freakin' Screen (polite form) If you are still puzzled, look at prog.c with your favorite text editor. @@ -56,9 +58,11 @@ If you are still puzzled, look at prog.c with your favorite text editor. **Follow this instruction literally!** - cat prog.c - gcc -w -o prog prog.c - ./prog +```sh +cat prog.c +gcc -w -o prog prog.c +./prog +``` You will do a double take. diff --git a/2015/endoh3/README.md b/2015/endoh3/README.md index 4d58fd298..ae7c0b66e 100644 --- a/2015/endoh3/README.md +++ b/2015/endoh3/README.md @@ -38,7 +38,7 @@ More generally use: ```sh cc -o prog prog.c foo.c ./prog -^C # if necessary, where ^C is ctrl-C, interrrupt +^C # if necessary, where ^C is ctrl-C, interrrupt ``` to run `prog` as whatever foo.c is in the joke PDP-11 emulator. diff --git a/2015/endoh4/README.md b/2015/endoh4/README.md index 7fb3c4f29..cd4f56252 100644 --- a/2015/endoh4/README.md +++ b/2015/endoh4/README.md @@ -60,14 +60,16 @@ experiment with numbers that have more or larger factors? Visual factorization 1-liner. Try: - gcc -o prog prog.c - ./prog @ - ./prog @ @ - ./prog @ @ @ - ./prog @ @ @ @ - ./prog @ @ @ @ @ @ - ./prog @ @ @ @ @ @ @ @ - ./prog @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +```sh +gcc -o prog prog.c +./prog @ +./prog @ @ +./prog @ @ @ +./prog @ @ @ @ +./prog @ @ @ @ @ @ +./prog @ @ @ @ @ @ @ @ +./prog @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +``` Inspired by [Animated Factorization Diagrams](http://www.datapointed.net/visualizations/math/factorization/animated-diagrams/). diff --git a/2015/hou/README.md b/2015/hou/README.md index d52748137..70772d1ab 100644 --- a/2015/hou/README.md +++ b/2015/hou/README.md @@ -1,7 +1,7 @@ # Most Well-rounded Hash - Qiming Hou \ - +Qiming Hou \ + ## To build: diff --git a/2015/mills1/README.md b/2015/mills1/README.md index f4c5127a5..9e5dc94d2 100644 --- a/2015/mills1/README.md +++ b/2015/mills1/README.md @@ -38,39 +38,40 @@ make clobber all DW=199999 DW=22 DH=16 DA=50 DI=-150 From the Makefile: +``` +# Game parameters +# +DU=99999 # Time between steps in microseconds. + # Make it larger if the game is too fast for you. - # Game parameters - # - DU=99999 # Time between steps in microseconds. - # Make it larger if the game is too fast for you. +DW=28 # Pipe-to-pipe spacing, in columns. + # Farther apart is easier. - DW=28 # Pipe-to-pipe spacing, in columns. - # Farther apart is easier. +DD=20 # Space between pipes. + # The difference between DD and DW is the width of a pipe. + # Narrow pipes are easier to fly though. - DD=20 # Space between pipes. - # The difference between DD and DW is the width of a pipe. - # Narrow pipes are easier to fly though. +DH=8 # Height of gap in pipe. + # Make this larger to make the game easier. - DH=8 # Height of gap in pipe. - # Make this larger to make the game easier. +DA=100 # Acceleration due to gravity (scaled by 256). + # Smaller values make you glide slower. - DA=100 # Acceleration due to gravity (scaled by 256). - # Smaller values make you glide slower. +DI=-200 # Impulse velocity of a flap (scaled by 256). + # Make larger if you want an less intense tapping experience! - DI=-200 # Impulse velocity of a flap (scaled by 256). - # Make larger if you want an less intense tapping experience! +DB='" +Dominik Muth\ + ## To build: @@ -73,17 +73,23 @@ Implementing your own Turing machine is easy. Take a look at the supplied header Every symbol used (except "`_`") must be explicitly declared using - #define sym_SYMBOL(sym, _SYMBOL) sym +```c +#define sym_SYMBOL(sym, _SYMBOL) sym +``` Example: - #define sym_1(sym, _1) sym +```c +#define sym_1(sym, _1) sym +``` #### Tape The initial content of the tape must be defined in the tape header using a triple like: - #define tape ((((,),...l2), l1), c, (r1, (r2..., (,)))) +```c +#define tape ((((,),...l2), l1), c, (r1, (r2..., (,)))) +``` - `l1`, `l2`, ... are the symbols to the left - `c` is the symbol at the current position @@ -110,7 +116,9 @@ There must be a state "`A`" defined, which becomes the initial state of the mach To halt the machine, use the keyword "`break`" as in - #define A_1 (2, break) +```c +#define A_1 (2, break) +``` ## Copyright and CC BY-SA 4.0 License: diff --git a/2015/schweikhardt/README.md b/2015/schweikhardt/README.md index 1f64663a9..7c4ab9aab 100644 --- a/2015/schweikhardt/README.md +++ b/2015/schweikhardt/README.md @@ -1,7 +1,7 @@ # Best Documented - Jens Schweikhardt\ - +Jens Schweikhardt\ + ## To build: @@ -229,6 +229,7 @@ the myriad of possible amino acids there are 23 from which proteins are built. In biochemistry, each is assigned a TLI (see [Proteinogenic amino acid](https://en.wikipedia.org/wiki/Proteinogenic_amino_acid)): +``` ala Alanine cys Cysteine asp Aspartic acid @@ -255,15 +256,18 @@ acid](https://en.wikipedia.org/wiki/Proteinogenic_amino_acid)): glx Glutamic acid or Glutamine xle Leucine or Isoleucine unk Unknown +`` My own research results complete this list (not yet in Wikipedia due to the rule "[No original research](https://en.wikipedia.org/wiki/Wikipedia:No_original_research)"): +``` and Androgynine xor Xenoricine not Notanamine tla Triletramine +``` Interestingly, the TLI are the perfect mnemonics for C language source. For example, `met` is "Main's Exit Type" (`int`), `ala` is "A Large @@ -460,31 +464,33 @@ Since the program frees all memory in all possible execution paths, even when it must bail out, valgrind should be happy. An early version of my program however reported this: - $ valgrind --leak-check=full --show-leak-kinds=all ./prog 6 - [...] - ==14615== HEAP SUMMARY: - ==14615== in use at exit: 4,096 bytes in 1 blocks - ==14615== total heap usage: 4 allocs, 3 frees, 4,108 bytes allocated - ==14615== - ==14615== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 1 - ==14615== at 0x4C236C0: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) - ==14615== by 0x4F62175: ??? (in /lib/libc.so.7) - ==14615== by 0x4F62073: ??? (in /lib/libc.so.7) - ==14615== by 0x4F514EE: ??? (in /lib/libc.so.7) - ==14615== by 0x4F51265: vfprintf_l (in /lib/libc.so.7) - ==14615== by 0x4F3E001: printf (in /lib/libc.so.7) - ==14615== by 0x40101E: phe (in ./prog) - ==14615== by 0x400A9F: main (in ./prog) - ==14615== - ==14615== LEAK SUMMARY: - ==14615== definitely lost: 0 bytes in 0 blocks - ==14615== indirectly lost: 0 bytes in 0 blocks - ==14615== possibly lost: 0 bytes in 0 blocks - ==14615== still reachable: 4,096 bytes in 1 blocks - ==14615== suppressed: 0 bytes in 0 blocks - ==14615== - ==14615== For counts of detected and suppressed errors, rerun with: -v - ==14615== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +``` +valgrind --leak-check=full --show-leak-kinds=all ./prog 6 +[...] +==14615== HEAP SUMMARY: +==14615== in use at exit: 4,096 bytes in 1 blocks +==14615== total heap usage: 4 allocs, 3 frees, 4,108 bytes allocated +==14615== +==14615== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 1 +==14615== at 0x4C236C0: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) +==14615== by 0x4F62175: ??? (in /lib/libc.so.7) +==14615== by 0x4F62073: ??? (in /lib/libc.so.7) +==14615== by 0x4F514EE: ??? (in /lib/libc.so.7) +==14615== by 0x4F51265: vfprintf_l (in /lib/libc.so.7) +==14615== by 0x4F3E001: printf (in /lib/libc.so.7) +==14615== by 0x40101E: phe (in ./prog) +==14615== by 0x400A9F: main (in ./prog) +==14615== +==14615== LEAK SUMMARY: +==14615== definitely lost: 0 bytes in 0 blocks +==14615== indirectly lost: 0 bytes in 0 blocks +==14615== possibly lost: 0 bytes in 0 blocks +==14615== still reachable: 4,096 bytes in 1 blocks +==14615== suppressed: 0 bytes in 0 blocks +==14615== +==14615== For counts of detected and suppressed errors, rerun with: -v +==14615== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +``` From which I concluded that `printf` allocated a single 4K block for which no matching free existed. But how to free memory allocated deep @@ -499,30 +505,32 @@ of C99 7.19.5.1, "The fclose function", was encouraging: So I `fclose(stdout)` before returning and now: - $ valgrind --leak-check=full --show-leak-kinds=all ./prog 6 - ==14571== Memcheck, a memory error detector - ==14571== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. - ==14571== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info - ==14571== Command: ./prog 6 - ==14571== - 0000000000000006 - 0000000000000003 1 - 000000000000000A 2 - 0000000000000005 3 - 0000000000000010 4 - 0000000000000008 5 - 0000000000000004 6 - 0000000000000002 7 - 0000000000000001 8 - ==14571== - ==14571== HEAP SUMMARY: - ==14571== in use at exit: 0 bytes in 0 blocks - ==14571== total heap usage: 4 allocs, 4 frees, 4,120 bytes allocated - ==14571== - ==14571== All heap blocks were freed -- no leaks are possible - ==14571== - ==14571== For counts of detected and suppressed errors, rerun with: -v - ==14571== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +``` +valgrind --leak-check=full --show-leak-kinds=all ./prog 6 +==14571== Memcheck, a memory error detector +==14571== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. +==14571== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info +==14571== Command: ./prog 6 +==14571== +0000000000000006 +0000000000000003 1 +000000000000000A 2 +0000000000000005 3 +0000000000000010 4 +0000000000000008 5 +0000000000000004 6 +0000000000000002 7 +0000000000000001 8 +==14571== +==14571== HEAP SUMMARY: +==14571== in use at exit: 0 bytes in 0 blocks +==14571== total heap usage: 4 allocs, 4 frees, 4,120 bytes allocated +==14571== +==14571== All heap blocks were freed -- no leaks are possible +==14571== +==14571== For counts of detected and suppressed errors, rerun with: -v +==14571== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +``` A squeaky clean valgrind result! @@ -532,10 +540,10 @@ FlexeLint is a commercial lint tool by [Gimpel Software](http://www.gimpel.com/html/index.htm). It supports nearly a thousand checks, broadly categorized into 4 levels, - 1. Syntax errors only (messages 1 to 399) - 2. Warnings (messages 400 to 699) - 3. Informational messages (700 to 899) - 4. Elective notes (900 to 1000 and > 9000) +1. Syntax errors only (messages 1 to 399) +2. Warnings (messages 400 to 699) +3. Informational messages (700 to 899) +4. Elective notes (900 to 1000 and > 9000) There is an [on-line demonstrator](http://www.gimpel-online.com/OnlineTesting.html) you can @@ -543,6 +551,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`). +```c /*lint -w4 turn on everything */ /*lint +esym(534,*) no demonstrator defaults */ /*lint -e966 indirectly included header file not used */ @@ -555,7 +564,7 @@ the FlexeLint configuration options in comments (no space between `/*` and `lint printf("hello, world\n"); return 0; } - +``` Possible checks include those for MISRA 2004 compliance verification. The [Motor Industry Software Reliability @@ -581,7 +590,7 @@ the remaining messages by addressing them or suppressing them in such a way that the set of suppressions was minimal. At the end of the day, this is what remained: - +``` // === Tested with FlexeLint 9.00L on FreeBSD 11 === // Compiler: // "4.2.1 Compatible FreeBSD Clang 3.6.1 (tags/RELEASE_361/final 237755)" @@ -643,6 +652,7 @@ what remained: -elib(9047) // FILE pointer dereferenced -esym(9058,__*) // tag not used outside typedef -e9092 // NULL does not expand to a pointer (but plain 0) +``` ### Compulsory obfuscations diff --git a/2018/algmyr/README.md b/2018/algmyr/README.md index 3708ec84b..0ef57133a 100644 --- a/2018/algmyr/README.md +++ b/2018/algmyr/README.md @@ -173,18 +173,24 @@ standards compliant). This is used to print the usage instructions. Compiling using - gcc -Wall -Wextra -pedantic +```sh +gcc -Wall -Wextra -pedantic +``` gives only `-Wmisleading-indentation` which is sensible considering the source code. While - clang -Wall -Wextra -pedantic +```sh +clang -Wall -Wextra -pedantic +``` is a bit more pessimistic and gives `-Wempty-body` (I like loops without bodies), `-Wstring-plus-int` (since apparently some people think string+int is a 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 +```sh +clang -Wall -Wextra -pedantic -Weverything +``` produces a few page faults of warnings and makes me feel generally bad about myself. :( diff --git a/2018/burton1/README.md b/2018/burton1/README.md index 187fd1dba..295776c56 100644 --- a/2018/burton1/README.md +++ b/2018/burton1/README.md @@ -1,7 +1,7 @@ # Best one-liner - Dave Burton\ - +Dave Burton\ + ## To build: diff --git a/2018/burton2/README.md b/2018/burton2/README.md index f2e8256c0..1b2edd260 100644 --- a/2018/burton2/README.md +++ b/2018/burton2/README.md @@ -50,45 +50,45 @@ that is saying something! What is this program weighing and how much does it we ### tac - tokenize and count C and derivative languages: ``` -tac computes C program size\ -(obfuscated / otherwise)\ -by splitting code as tokens small,\ +tac computes C program size +(obfuscated / otherwise) +by splitting code as tokens small, ignoring space, then counting all. -It tries quite hard to act the same\ -as counting tool of I-OCCC fame.\ +It tries quite hard to act the same +as counting tool of I-OCCC fame. Some bugs were fixed, it's faster too, and does more things, just add some glue! -It does far more than print the size:\ -the token part's a better prize!\ -With each upon on a single line,\ +It does far more than print the size: +the token part's a better prize! +With each upon on a single line, how many things can you design? -Included is a keyword sorter,\ -de-obfuscator, freq reporter.\ -With code produced as little parts,\ +Included is a keyword sorter, +de-obfuscator, freq reporter. +With code produced as little parts, just add your own creative arts. -But first you have to figure out\ -the braces part, without a doubt!\ -And then the code - it isn't easy:\ +But first you have to figure out +the braces part, without a doubt! +And then the code - it isn't easy: for as else? That's rather cheesy! -The rest of it is standard fare:\ -expressions strange, the globals bare,\ -confusing symbols one and oh,\ +The rest of it is standard fare: +expressions strange, the globals bare, +confusing symbols one and oh, and precedence you have to know. -The keyword list was made external,\ +The keyword list was made external, because of standards change eternal. -Thus other languages can now,\ +Thus other languages can now, be counted just like C, somehow! -I hope you find this code obscure\ -enough to win, and thus procure\ -a public place for all to see\ -how badly I can butcher C!\ +I hope you find this code obscure +enough to win, and thus procure +a public place for all to see +how badly I can butcher C! ``` ### Said another way.... diff --git a/2018/ciura/README.md b/2018/ciura/README.md index 09fc2a697..7e9211845 100644 --- a/2018/ciura/README.md +++ b/2018/ciura/README.md @@ -1,6 +1,7 @@ # Most likely to be awarded -Marcin Ciura +Marcin Ciura\ + ## To build: diff --git a/2018/ferguson/README.md b/2018/ferguson/README.md index 801c43669..1d236e9c5 100644 --- a/2018/ferguson/README.md +++ b/2018/ferguson/README.md @@ -64,14 +64,14 @@ man ./weasel.man ## Author's remarks: - 0. Preface - 1. What it is - 2. How it works - 3. Hints (Keyboards, Options, Spoilers, Example Invocations) - 4. Obfuscation (Techniques, Beauty) - 5. How to build (S and N Constants, Compilation, Portability, Installing) - 6. Final thoughts - 7. Winning comments, thanks, dedications, links, etc. +0. Preface +1. What it is +2. How it works +3. Hints (Keyboards, Options, Spoilers, Example Invocations) +4. Obfuscation (Techniques, Beauty) +5. How to build (S and N Constants, Compilation, Portability, Installing) +6. Final thoughts +7. Winning comments, thanks, dedications, links, etc. ## **0. Preface** diff --git a/2018/giles/README.md b/2018/giles/README.md index bb3434c68..3d635366e 100644 --- a/2018/giles/README.md +++ b/2018/giles/README.md @@ -1,6 +1,6 @@ # Most unstable - Edward Giles +Edward Giles ## To build: diff --git a/2018/mills/README.md b/2018/mills/README.md index c63e5fc3a..1b5bd3ddf 100644 --- a/2018/mills/README.md +++ b/2018/mills/README.md @@ -127,33 +127,35 @@ At this point, type the rather cryptic command `rk(0,0)rkunix` -- this tells the system to look at the first partition on the first RK05 fixed disk, find the `rkunix` file and load it. You should eventually see the following: - >boot -\ - 40Boot - : rk(0,0)rkunix -\ - Berkeley UNIX (Rev. 2.9.1) Sun Nov 20 14:55:50 PST 1983 - mem = 135872 -\ - CONFIGURE SYSTEM: - xp ? csr 176700 vector 254 skipped: No CSR - rk 0 csr 177400 vector 220 attached - hk ? csr 177440 vector 210 skipped: No CSR - rl ? csr 174400 vector 160 skipped: No CSR - rp ? csr 176700 vector 254 skipped: No CSR - ht 0 csr 172440 vector 224 skipped: No CSR - tm 0 csr 172520 vector 224 skipped: No CSR - ts 0 csr 172520 vector 224 skipped: No CSR - dh ? csr 160020 vector 370 skipped: No CSR - dm ? csr 170500 vector 360 skipped: No autoconfig routines - dz ? csr 160110 vector 320 skipped: No CSR - dz ? csr 160110 vector 320 skipped: No CSR - dn 0 csr 175200 vector 300 skipped: No autoconfig routines - vp ? csr 177500 vector 174 skipped: No autoconfig routines - lp ? csr 177514 vector 200 skipped: No CSR - Erase=^?, kill=^U, intr=^C - #\ -\ +`` +>boot + +40Boot +: rk(0,0)rkunix + +Berkeley UNIX (Rev. 2.9.1) Sun Nov 20 14:55:50 PST 1983 +mem = 135872 + +CONFIGURE SYSTEM: +xp ? csr 176700 vector 254 skipped: No CSR +rk 0 csr 177400 vector 220 attached +hk ? csr 177440 vector 210 skipped: No CSR +rl ? csr 174400 vector 160 skipped: No CSR +rp ? csr 176700 vector 254 skipped: No CSR +ht 0 csr 172440 vector 224 skipped: No CSR +tm 0 csr 172520 vector 224 skipped: No CSR +ts 0 csr 172520 vector 224 skipped: No CSR +dh ? csr 160020 vector 370 skipped: No CSR +dm ? csr 170500 vector 360 skipped: No autoconfig routines +dz ? csr 160110 vector 320 skipped: No CSR +dz ? csr 160110 vector 320 skipped: No CSR +dn 0 csr 175200 vector 300 skipped: No autoconfig routines +vp ? csr 177500 vector 174 skipped: No autoconfig routines +lp ? csr 177514 vector 200 skipped: No CSR +Erase=^?, kill=^U, intr=^C +# +``` + Congratulations, you are running BSD UNIX 2.9 in single-user mode as root. On the other hand, if you did a typo somewhere, the boot loader has probably @@ -166,15 +168,17 @@ root prompt. Most of the commands you are familiar with work here (this was 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 - .msgsrc bin etc lost+found rkunix usr - # df - Filesystem Mounted on kbytes used free % used - /dev/rk0 / 1958 1688 270 86% - # bin/cc mullender.c - # ./a.out +``` +# ls +.cshrc .profile boot hkunix mnt tmp +.login 2.9stamp dev lib mullender.c unix +.msgsrc bin etc lost+found rkunix usr +# df +Filesystem Mounted on kbytes used free % used +/dev/rk0 / 1958 1688 270 86% +# bin/cc mullender.c +# ./a.out +``` The program you've just run was the [winner of the first IOCCC contest from 1984] [1] (or was it 1894?), a personal favorite of mine. It is rather @@ -204,19 +208,23 @@ disk image. Type `make v6` to build it, then type `./prog` to run it. You should see the boot loader prompt which is a single `@`: - @ +``` +@ +``` At this point, you again must type a special incantation: `rkunix`. After that you should see: - @rkunix - mem = 1035 - RESTRICTED RIGHTS -\ - Use, duplication or disclosure is subject to - restrictions stated in Contract with Western - Electric Company, Inc. - # +``` +@rkunix +mem = 1035 +RESTRICTED RIGHTS + +Use, duplication or disclosure is subject to +restrictions stated in Contract with Western +Electric Company, Inc. +# +``` You are now running a single-user session of v6 UNIX. You might want to start with `stty -lcase` because otherwise everything will be IN ALL CAPS. @@ -226,35 +234,37 @@ may need to use Control-E to quit the simulation. Assuming you're more careful than that, we can try a few commands: - @rkunix - mem = 1035 - RESTRICTED RIGHTS -\ - Use, duplication or disclosure is subject to - restrictions stated in Contract with Western - Electric Company, Inc. - # STTY -LCASE - # ls - bin - dev - etc - hpunix - lib - mnt - rkunix - rpunix - tmp - unix - usr - # cat > foo.c - main() - { - printf("Hello, World!\n"); - } - ^D - # cc foo.c - # ./a.out - Hello, World! +``` +@rkunix +mem = 1035 +RESTRICTED RIGHTS + +Use, duplication or disclosure is subject to +restrictions stated in Contract with Western +Electric Company, Inc. +# STTY -LCASE +# ls +bin +dev +etc +hpunix +lib +mnt +rkunix +rpunix +tmp +unix +usr +# cat > foo.c +main() +{ + printf("Hello, World!\n"); +} +^D +# cc foo.c +# ./a.out +Hello, World! +``` Why is Version 6 interesting? Well, it was the oldest version that I could find a boot image of that had a C compiler... This C compiler is recognizably @@ -306,15 +316,19 @@ You can try out this version by typing `make v0`. Since this version is a native PDP-7 emulation, it gets its own binary. Type `./v0` to run it. You should see the login prompt. - login: +``` +login: +``` There are two user accounts `ken` and `dmr`, with the passwords `ken` and `dmr` respectively. Let's try the Dennis Richie's `dmr` account: - login: dmr - password: dmr - @ ls - . ? +``` +login: dmr +password: dmr +@ ls +. ? +``` Even though this is not Ken's doing, I feel this gives me licence to include this quote from the BSD `fortune` program: @@ -339,7 +353,9 @@ directory has a hard link to `dd`, which is the directory that holds all of the user home directories (this will eventually become `/`, the root path). We can do - @ ln dd dmr . +``` +@ ln dd dmr . +``` To make the new link (note that `ln` doesn't support paths either, so you have to give it three arguments -- a directory in the current dir, a file in that @@ -347,46 +363,48 @@ directory, and the new name). Now `ls` will work, and we can try some other things while we are here: - login: dmr - password: dmr - @ ln dd dmr . - @ ls - dd\ - system\ - as.s\ - b_readme - bi.s\ - bl.s\ - db.s\ - hello.b\ - ops.s\ - .\ - @ cat b_readme - Here is how to compile and run hello.b: -\ - @ bc hello.b hello.s - @ as ops.s bl.s hello.s bi.s - I - II - ops.s\ - bl.s\ - hello.s\ - bi.s\ - @ a.out - Hello, World! -\ -\ - @ bc hello.b hello.s - @ as ops.s bl.s hello.s bi.s - I - II - ops.s\ - bl.s\ - hello.s\ - bi.s\ - @ a.out - Hello, World! - @ +``` +login: dmr +password: dmr +@ ln dd dmr . +@ ls +dd +system +as.s +b_readme +bi.s +bl.s +db.s +hello.b +ops.s +. +@ cat b_readme +Here is how to compile and run hello.b: + +@ bc hello.b hello.s +@ as ops.s bl.s hello.s bi.s +I +II +ops.s +bl.s +hello.s +bi.s +@ a.out +Hello, World! + + +@ bc hello.b hello.s +@ as ops.s bl.s hello.s bi.s +I +II +ops.s +bl.s +hello.s +bi.s +@ a.out +Hello, World! +@ +``` The last command is invoking the compiler for an extremely early version of the [B programming language] [3], the predecessor to C. Thompson missed the diff --git a/2018/poikola/README.md b/2018/poikola/README.md index 538d3795a..b59a48c34 100644 --- a/2018/poikola/README.md +++ b/2018/poikola/README.md @@ -32,8 +32,10 @@ On terminal supports 24 bit color, has black background, and size at least 125x3 It is said by some students of Astronomy: - Oh, Be A Fine Gal, Kiss Me! - Oh, Be A Fine Gentleman, Kiss Me! +``` +Oh, Be A Fine Gal, Kiss Me! +Oh, Be A Fine Gentleman, Kiss Me! +``` Many [Mnemonic variations](http://www.star.ucl.ac.uk/%7Epac/obafgkmrns.html) exist. You might wish, on a star, to better understand the colors being displayed. diff --git a/2018/vokes/README.md b/2018/vokes/README.md index 092d990af..3a0a597ac 100644 --- a/2018/vokes/README.md +++ b/2018/vokes/README.md @@ -48,36 +48,42 @@ it produces a build order with any dependency cycles gathered. For example, the following input (provided as `example-1.txt`): - 0 4 8 - 1 0 - 2 1 3 - 3 2 - 4 1 - 5 4 6 - 6 5 2 - 7 3 6 7 +``` +0 4 8 +1 0 +2 1 3 +3 2 +4 1 +5 4 6 +6 5 2 +7 3 6 7 +``` would be interpreted as: - 0 -> 4, 8 - 1 -> 0 - 2 -> 1, 3 - 3 -> 2 - 4 -> 1 - 5 -> 4, 6 - 6 -> 5, 2 - 7 -> 3, 6, 7 +``` +0 -> 4, 8 +1 -> 0 +2 -> 1, 3 +3 -> 2 +4 -> 1 +5 -> 4, 6 +6 -> 5, 2 +7 -> 3, 6, 7 +``` So, node 0 has edges to / depends on nodes 4 and 8, node 1 depends on node 0, and so on. Then, it groups the graph's nodes into strongly connected components and prints them in reverse-topologically sorted order: - 0: 8 - 1: 0 1 4 - 2: 2 3 - 3: 5 6 - 4: 7 +``` +0: 8 +1: 0 1 4 +2: 2 3 +3: 5 6 +4: 7 +``` It uses Tarjan's strongly connected components algorithm for the grouping and reverse-topological sorting, along with a bonus hidden @@ -90,8 +96,10 @@ Limitations". To build: +``` ${CC} -o prog prog.c -std=c11 -O3 \ -Wall -Wextra -pedantic -Wno-missing-prototypes +``` `-Wno-missing-prototypes` is necessary because there aren't any prototypes. (They would put the program well over the size limit.) diff --git a/2018/yang/README.md b/2018/yang/README.md index 260bf676f..3031ddb26 100644 --- a/2018/yang/README.md +++ b/2018/yang/README.md @@ -1,7 +1,7 @@ # Most shifty - Don Yang\ - +Don Yang\ + ## To build: diff --git a/2019/adamovsky/README.md b/2019/adamovsky/README.md index 4a225e440..cef302f81 100644 --- a/2019/adamovsky/README.md +++ b/2019/adamovsky/README.md @@ -1,6 +1,7 @@ # Most functional interpreter -Ondřej Adamovský +Ondřej Adamovský\ + ## To build: diff --git a/2019/burton/README.md b/2019/burton/README.md index ce71f93c7..6361fdfec 100644 --- a/2019/burton/README.md +++ b/2019/burton/README.md @@ -35,7 +35,7 @@ unix utilities available as winning entries. ### Synopsis: -Feed it anything on stdin.\ +Feed it anything on stdin. The output should look familiar. Compiles cleanly with: @@ -67,13 +67,13 @@ This program follows FreeBSD and macOS, the arbiters of correct for these purpos ### Limits: -Requires the C locale and ASCII character set.\ +Requires the C locale and ASCII character set. Input should be less than ten million octets "toavoidthisproblem". ### See Also: -You can enjoy this code from beginning to end.\ -No whitespace was harmed in the creation of this program.\ +You can enjoy this code from beginning to end. +No whitespace was harmed in the creation of this program. All your base belong to us, but the constants seem a bit ... off? ### Bonus diff --git a/2019/diels-grabsch2/README.md b/2019/diels-grabsch2/README.md index 60b233bf6..7952f7486 100644 --- a/2019/diels-grabsch2/README.md +++ b/2019/diels-grabsch2/README.md @@ -75,7 +75,9 @@ are step 1 and step 2 achieved then? Regarding step 1, note that the large string literal - "`x{bh}ndbq..." +``` +"`x{bh}ndbq..." +``` in the last line doesn't look like C code. Moreover, it is too short to contain even a compressed representation of all preceding and diff --git a/2019/endoh/README.md b/2019/endoh/README.md index f76a8b2aa..d88548dd3 100644 --- a/2019/endoh/README.md +++ b/2019/endoh/README.md @@ -73,46 +73,52 @@ Program received signal SIGSEGV, Segmentation fault. Okay, check the backtrace. - (gdb) backtrace - #0 0x0000000000000000 in ?? () - #1 0x0000555555555201 in x23 () at prog.c:35 - #2 0x000055555555571a in x64 () at prog.c:100 - #3 0x0000555555555747 in x65 () at prog.c:101 - #4 0x0000555555555774 in x66 () at prog.c:102 - #5 0x00005555555557ce in x69 () at prog.c:105 - #6 0x0000555555555828 in x6e () at prog.c:110 - #7 0x0000555555555747 in x65 () at prog.c:101 +``` +(gdb) backtrace +#0 0x0000000000000000 in ?? () +#1 0x0000555555555201 in x23 () at prog.c:35 +#2 0x000055555555571a in x64 () at prog.c:100 +#3 0x0000555555555747 in x65 () at prog.c:101 +#4 0x0000555555555774 in x66 () at prog.c:102 +#5 0x00005555555557ce in x69 () at prog.c:105 +#6 0x0000555555555828 in x6e () at prog.c:110 +#7 0x0000555555555747 in x65 () at prog.c:101 ... +``` See the line numbers and lookup the ASCII table. - 35 = '#' - 100 = 'd' - 101 = 'e' - 102 = 'f' - 105 = 'i' - 110 = 'n' - 101 = 'e' - ... +``` + 35 = '#' +100 = 'd' +101 = 'e' +102 = 'f' +105 = 'i' +110 = 'n' +101 = 'e' +... +``` ### One more thing: The original program can be used as a GDB command file. - $ gdb -q -x prog.c ./prog | cat - Reading symbols from ./prog...done. +``` +gdb -q -x prog.c ./prog | cat +Reading symbols from ./prog...done. - Program received signal SIGSEGV, Segmentation fault. - 0x0000000000000000 in ?? () - #0 0x0000000000000000 in ?? () - #1 0x0000555555555201 in x23 () at prog.c:35 - #2 0x000055555555571a in x64 () at prog.c:100 - #3 0x0000555555555747 in x65 () at prog.c:101 - #4 0x0000555555555774 in x66 () at prog.c:102 - #5 0x00005555555557ce in x69 () at prog.c:105 - #6 0x0000555555555828 in x6e () at prog.c:110 - #7 0x0000555555555747 in x65 () at prog.c:101 - ... +Program received signal SIGSEGV, Segmentation fault. +0x0000000000000000 in ?? () +#0 0x0000000000000000 in ?? () +#1 0x0000555555555201 in x23 () at prog.c:35 +#2 0x000055555555571a in x64 () at prog.c:100 +#3 0x0000555555555747 in x65 () at prog.c:101 +#4 0x0000555555555774 in x66 () at prog.c:102 +#5 0x00005555555557ce in x69 () at prog.c:105 +#6 0x0000555555555828 in x6e () at prog.c:110 +#7 0x0000555555555747 in x65 () at prog.c:101 +... +``` By using this, you can confirm that it is actually a quine. diff --git a/2019/giles/README.md b/2019/giles/README.md index 0edfedd2b..61cc4ee6c 100644 --- a/2019/giles/README.md +++ b/2019/giles/README.md @@ -67,7 +67,7 @@ Interesting fact: The size of the program from `./iocccsize -i` is 2019. ./prog input [output [size [dry [wet [damping]]]]] prog.exe input [output [size [dry [wet [damping]]]]] ``` -\ + * `input`: The path to the input file. Required. * `output`: The path to the output file. Optional, defaults to `out.wav`. * `size`: The perceived size of the room, i.e. the approximate amount of time diff --git a/2019/karns/README.md b/2019/karns/README.md index 54bac79a3..b619734ed 100644 --- a/2019/karns/README.md +++ b/2019/karns/README.md @@ -54,14 +54,14 @@ movement as one step? ## Author's remarks: ### The Program: -\ + This program is pretty simple! It performs a breadth first search on the specified graph. The graph can be any ascii text file that has an 'at' character, which is going to be the starting location, and a '!' character which will be the destination. The nodes on this graph that are spaces are connected with any directly -adjacent nodes that are also spaces. Nodes that aren't spaces are not\ +adjacent nodes that are also spaces. Nodes that aren't spaces are not connected with anything. ### Compiling and Running: @@ -83,7 +83,7 @@ cat | ./tbfs Examples: ```sh -./tbfs < maze\ +./tbfs < maze ./tbfs < prog.c ``` diff --git a/2019/lynn/README.md b/2019/lynn/README.md index 16bab9120..456fe0b91 100644 --- a/2019/lynn/README.md +++ b/2019/lynn/README.md @@ -1,6 +1,6 @@ # Most functional compiler -Ben Lynn +Ben Lynn\ diff --git a/2019/mills/README.md b/2019/mills/README.md index a271e8c24..aeee35b77 100644 --- a/2019/mills/README.md +++ b/2019/mills/README.md @@ -114,74 +114,80 @@ This will immediately start outputting gibberish to the output, e.g. produces: - sins ohennAu - T-teooclelp tiThoWy -\ - g - nlakuafy\ - e - sselW usnsofueB Aoee pasfUsuslhe ooM ot Wou moy - me neltAl -no IoyI mhuyakse inT-l chu ghenn ffo? fnsoe yhyye - ue nnfrlass heUthole saounlcesyee pee\ - t, - T0:0% 3.210888 - o',,vU - An ,hTf lnm Far rur:s moilt WoEgrv wonds mith Aog thernw - Rni So - co Nnd : - For an bImy pgafoun: - Wf'r hom wortiverita - int fod mous Eheledet, - Tho he theket nonS wnu-ang dorlaMSp - nrocWiSe tflg 'o. - T0:0% 2.995950 - d whecedhencrysesil yr bn, - we hh y thiwt -\ -\ - hut fithlot, - Fmdy s he alt - Vh th no dh foud bobt werw:s Aotnf Fhwi't whe, eusu -\ - lhh thele wewcond ary soupfy wind tDont couc ths: - er fucwald oncli hen bos, f - T0:1% 2.878945 +``` +sins ohennAu +T-teooclelp tiThoWy + +g +nlakuafy +e +sselW usnsofueB Aoee pasfUsuslhe ooM ot Wou moy +me neltAl -no IoyI mhuyakse inT-l chu ghenn ffo? fnsoe yhyye +ue nnfrlass heUthole saounlcesyee pee +t, +T0:0% 3.210888 +o',,vU + An ,hTf lnm Far rur:s moilt WoEgrv wonds mith Aog thernw +Rni So +co Nnd : +For an bImy pgafoun: +Wf'r hom wortiverita +int fod mous Eheledet, +Tho he theket nonS wnu-ang dorlaMSp +nrocWiSe tflg 'o. +T0:0% 2.995950 +d whecedhencrysesil yr bn, +we hh y thiwt + + +hut fithlot, +Fmdy s he alt +Vh th no dh foud bobt werw:s Aotnf Fhwi't whe, eusu + +lhh thele wewcond ary soupfy wind tDont couc ths: +er fucwald oncli hen bos, f +T0:1% 2.878945 +``` The gibberish is the networks attempt to write a play. So far, it's not very successful! Between the chunks of gibberish are training progress reports that look like - T0:1% 2.878945 +``` +T0:1% 2.878945 +``` This tells you that we are 1% through training epoch 0, and that the training [loss][6] is about 2.88. As the training continues, the training loss will reduce and the generated snippets will improve quickly: - ses, kuth - LAs of the wish, - As, I nos you, - Yov not to nalll, - Tr tot wonds. -\ - First Sondy, llt lrte, our, tw. -\ - First. -\ - BRUTUS: - Helsting the kith gops of hoch Whay, fars surd what to, - The cownens golt te. - T0:12% 2.259114 - eplerrotrur tandans one wiok thy or thach and cullice ded yourssting - And wours: - Whed ur surt. -\ - SINENIUS: - On we lain bith - rerytund: tich lon hyivetetgor. -\ - VOLUONIA: - He brich nom dove worthan then wise, - T0:13% 2.254926 +``` +ses, kuth +LAs of the wish, +As, I nos you, +Yov not to nalll, +Tr tot wonds. + +First Sondy, llt lrte, our, tw. + +First. + +BRUTUS: +Helsting the kith gops of hoch Whay, fars surd what to, +The cownens golt te. +T0:12% 2.259114 +eplerrotrur tandans one wiok thy or thach and cullice ded yourssting +And wours: +Whed ur surt. + +SINENIUS: +On we lain bith +rerytund: tich lon hyivetetgor. + +VOLUONIA: +He brich nom dove worthan then wise, +T0:13% 2.254926 +``` It's already started to figure out things about Shakespeare plays -- how to spell short English words, how long lines tend to be, and that characters take @@ -191,40 +197,42 @@ turns speaking with their names capitalized. The training loss has dropped to Eventually, we will finish with the training data set and move on to a validation cycle: - y fath onother, - I sucess, - For I me the west crare. -\ - TRANIO: - Whow and'd have not to had you you one in my lapteny she very ame come me a gut and shourd aghir you as ignested; shend to make I strem - To h - T0:99% 1.924063 - notnce gaud and is nicked thou day, ha the dusing you disaid: in thim, you things in ere thee thus erile Iht that tare theme my hast thesp thou shay: thou not eaten-or-ho-bess resing: I the but had d - T0:99% 1.923128 - V0:0% 1.678907 - V0:9% 1.700527 - V0:18% 1.733179 - V0:27% 1.714891 - V0:36% 1.716672 - V0:45% 1.782946 - V0:54% 1.835629 - V0:63% 1.876108 - V0:72% 1.906814 - V0:81% 1.924096 - V0:90% 1.954492 - V0:99% 1.969287 - serfs you'll alliencseard: - We - got you? before - I say. -\ - Farstred dentlentecaly, sir, I it one bosticield - All me the backnour mino, - Whith capitaned mid! but stell the ifvemion - Willerity. -\ - First Cumfol of - T1:0% 1.885619 +``` +y fath onother, +I sucess, +For I me the west crare. + +TRANIO: +Whow and'd have not to had you you one in my lapteny she very ame come me a gut and shourd aghir you as ignested; shend to make I strem +To h +T0:99% 1.924063 + notnce gaud and is nicked thou day, ha the dusing you disaid: in thim, you things in ere thee thus erile Iht that tare theme my hast thesp thou shay: thou not eaten-or-ho-bess resing: I the but had d +T0:99% 1.923128 +V0:0% 1.678907 +V0:9% 1.700527 +V0:18% 1.733179 +V0:27% 1.714891 +V0:36% 1.716672 +V0:45% 1.782946 +V0:54% 1.835629 +V0:63% 1.876108 +V0:72% 1.906814 +V0:81% 1.924096 +V0:90% 1.954492 +V0:99% 1.969287 +serfs you'll alliencseard: +We +got you? before +I say. + +Farstred dentlentecaly, sir, I it one bosticield +All me the backnour mino, +Whith capitaned mid! but stell the ifvemion +Willerity. + +First Cumfol of +T1:0% 1.885619 +``` Validation cycles are used to test the network to see if it has learned to generalize -- how well performs on data it hasn't seen before (as opposed to @@ -232,7 +240,9 @@ the training data that the network will see many times as it trains). Progress on the validation set is also displayed with a validation progress report that looks like - V0:36% 1.716672 +``` +V0:36% 1.716672 +``` which means we are 36% of the way through the validation for epoch 0, and the validation loss is about 1.72. Comparing the validation loss and the @@ -335,28 +345,30 @@ lacks history: produces: - UERond w, -\ -\ - Gir: - KINof s, mesther s thouth. - E: - KINTret, at fu, - GOMy t, as sth kesewit sooos atse ang k, ck, - Sotheouserivesthecowhet been's, t he, h nre; t and, har wiread of pincer cedst sur has, ut: -\ - T14:67% 2.465115 - UKESpan, - NGaromy soreate e m esewfoure pamitherarjulthengeoly tl. - NG s at e! w. -\ - WAllinoully? - Wamisw ofilem: - I'delandinarrstath har aksubly s cath Whern t Is, weciss: -\ - GLat s; llde. - Y aterit dsthence\ - T14:67% 2.465404 +``` +UERond w, + + +Gir: +KINof s, mesther s thouth. +E: +KINTret, at fu, +GOMy t, as sth kesewit sooos atse ang k, ck, +Sotheouserivesthecowhet been's, t he, h nre; t and, har wiread of pincer cedst sur has, ut: + +T14:67% 2.465115 +UKESpan, +NGaromy soreate e m esewfoure pamitherarjulthengeoly tl. +NG s at e! w. + +WAllinoully? +Wamisw ofilem: +I'delandinarrstath har aksubly s cath Whern t Is, weciss: + +GLat s; llde. +Y aterit dsthence +T14:67% 2.465404 +``` It is able to guess at what character is likely to follow the current one (by doing a [linear regression][13]), but it lacks any history beyond that to diff --git a/2020/burton/README.md b/2020/burton/README.md index 55ace2c9b..466b96b3d 100644 --- a/2020/burton/README.md +++ b/2020/burton/README.md @@ -1,6 +1,6 @@ # Best one-liner -Dave Burton +Dave Burton\ diff --git a/2020/endoh1/README.md b/2020/endoh1/README.md index d29b5a0ae..a292a913b 100644 --- a/2020/endoh1/README.md +++ b/2020/endoh1/README.md @@ -1,6 +1,6 @@ # Most explosive -Yusuke Endoh +Yusuke Endoh\ \ Mastodon: [@mame@ruby.social](https://ruby.social/@mame) diff --git a/2020/giles/README.md b/2020/giles/README.md index a1c79620e..aa3a19231 100644 --- a/2020/giles/README.md +++ b/2020/giles/README.md @@ -92,12 +92,14 @@ $ ./prog 867-5309 | aplay Each tone in a DTMF signal is a combination of two frequencies. The lower frequency determines which row the digit is in, and the higher frequency determines the column. There are 4 possible row frequencies and 4 possible column frequencies. +``` | | **1209 Hz** | **1336 Hz** | **1477 Hz** | **1633 Hz** | |------------|-------------|-------------|-------------|-------------| | **697 Hz** | 1 | 2 abc | 3 def | A | | **770 Hz** | 4 ghi | 5 jkl | 6 mno | B | | **852 Hz** | 7 pqrs | 8 tuv | 9 wxyz | C | | **941 Hz** | * | 0 | # | D | +``` This program determines which frequencies are present in the input by passing it through a set of 8 virtual resonators, each tuned to one of the frequencies used for DTMF. These can be implemented using only basic arithmetic, and they are able to 'select' a specific frequency from the input sound, blocking all other frequencies from reaching the output. The loudness of the sound output from each resonator can therefore be used as a measure of how much of a particular frequency was present in the input. The program then decides, over the course of one tone, which row frequency and which column frequency were most prominent.