From d84fc3a89309aa7eb1558c278fb69b8071b773e3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 03:12:54 -0800 Subject: [PATCH 01/27] Add 2015/hou/rfc1321.txt The README.md file now links to the downloaded copy. This entry is not done but I needed the change to the README.md out of the way for a commit I plan on that will be a mass edit to README.md files. --- 2015/hou/README.md | 2 +- 2015/hou/rfc1321.txt | 1179 ++++++++++++++++++++++++++++++++++++++++++ thanks-for-fixes.md | 4 + 3 files changed, 1184 insertions(+), 1 deletion(-) create mode 100644 2015/hou/rfc1321.txt diff --git a/2015/hou/README.md b/2015/hou/README.md index 5e6abfa6f..7b6146b2f 100644 --- a/2015/hou/README.md +++ b/2015/hou/README.md @@ -22,7 +22,7 @@ echo "" | ./prog ## Judges' remarks: A good start for understanding this entry might be -https://www.ietf.org/rfc/rfc1321.txt. How does it compute this using only a +[rfc1321.txt](rfc1321.txt). How does it compute this using only a single looping construct? The original reference source code for this algorithm is about 355 lines of code, yet this entry is only 199 lines with one statement per line and it isn't using lots of macro expansion tricks like diff --git a/2015/hou/rfc1321.txt b/2015/hou/rfc1321.txt new file mode 100644 index 000000000..68af27d2b --- /dev/null +++ b/2015/hou/rfc1321.txt @@ -0,0 +1,1179 @@ + + + + + + +Network Working Group R. Rivest +Request for Comments: 1321 MIT Laboratory for Computer Science + and RSA Data Security, Inc. + April 1992 + + + The MD5 Message-Digest Algorithm + +Status of this Memo + + This memo provides information for the Internet community. It does + not specify an Internet standard. Distribution of this memo is + unlimited. + +Acknowlegements + + We would like to thank Don Coppersmith, Burt Kaliski, Ralph Merkle, + David Chaum, and Noam Nisan for numerous helpful comments and + suggestions. + +Table of Contents + + 1. Executive Summary 1 + 2. Terminology and Notation 2 + 3. MD5 Algorithm Description 3 + 4. Summary 6 + 5. Differences Between MD4 and MD5 6 + References 7 + APPENDIX A - Reference Implementation 7 + Security Considerations 21 + Author's Address 21 + +1. Executive Summary + + This document describes the MD5 message-digest algorithm. The + algorithm takes as input a message of arbitrary length and produces + as output a 128-bit "fingerprint" or "message digest" of the input. + It is conjectured that it is computationally infeasible to produce + two messages having the same message digest, or to produce any + message having a given prespecified target message digest. The MD5 + algorithm is intended for digital signature applications, where a + large file must be "compressed" in a secure manner before being + encrypted with a private (secret) key under a public-key cryptosystem + such as RSA. + + + + + + + +Rivest [Page 1] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + The MD5 algorithm is designed to be quite fast on 32-bit machines. In + addition, the MD5 algorithm does not require any large substitution + tables; the algorithm can be coded quite compactly. + + The MD5 algorithm is an extension of the MD4 message-digest algorithm + 1,2]. MD5 is slightly slower than MD4, but is more "conservative" in + design. MD5 was designed because it was felt that MD4 was perhaps + being adopted for use more quickly than justified by the existing + critical review; because MD4 was designed to be exceptionally fast, + it is "at the edge" in terms of risking successful cryptanalytic + attack. MD5 backs off a bit, giving up a little in speed for a much + greater likelihood of ultimate security. It incorporates some + suggestions made by various reviewers, and contains additional + optimizations. The MD5 algorithm is being placed in the public domain + for review and possible adoption as a standard. + + For OSI-based applications, MD5's object identifier is + + md5 OBJECT IDENTIFIER ::= + iso(1) member-body(2) US(840) rsadsi(113549) digestAlgorithm(2) 5} + + In the X.509 type AlgorithmIdentifier [3], the parameters for MD5 + should have type NULL. + +2. Terminology and Notation + + In this document a "word" is a 32-bit quantity and a "byte" is an + eight-bit quantity. A sequence of bits can be interpreted in a + natural manner as a sequence of bytes, where each consecutive group + of eight bits is interpreted as a byte with the high-order (most + significant) bit of each byte listed first. Similarly, a sequence of + bytes can be interpreted as a sequence of 32-bit words, where each + consecutive group of four bytes is interpreted as a word with the + low-order (least significant) byte given first. + + Let x_i denote "x sub i". If the subscript is an expression, we + surround it in braces, as in x_{i+1}. Similarly, we use ^ for + superscripts (exponentiation), so that x^i denotes x to the i-th + power. + + Let the symbol "+" denote addition of words (i.e., modulo-2^32 + addition). Let X <<< s denote the 32-bit value obtained by circularly + shifting (rotating) X left by s bit positions. Let not(X) denote the + bit-wise complement of X, and let X v Y denote the bit-wise OR of X + and Y. Let X xor Y denote the bit-wise XOR of X and Y, and let XY + denote the bit-wise AND of X and Y. + + + + + +Rivest [Page 2] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +3. MD5 Algorithm Description + + We begin by supposing that we have a b-bit message as input, and that + we wish to find its message digest. Here b is an arbitrary + nonnegative integer; b may be zero, it need not be a multiple of + eight, and it may be arbitrarily large. We imagine the bits of the + message written down as follows: + + m_0 m_1 ... m_{b-1} + + The following five steps are performed to compute the message digest + of the message. + +3.1 Step 1. Append Padding Bits + + The message is "padded" (extended) so that its length (in bits) is + congruent to 448, modulo 512. That is, the message is extended so + that it is just 64 bits shy of being a multiple of 512 bits long. + Padding is always performed, even if the length of the message is + already congruent to 448, modulo 512. + + Padding is performed as follows: a single "1" bit is appended to the + message, and then "0" bits are appended so that the length in bits of + the padded message becomes congruent to 448, modulo 512. In all, at + least one bit and at most 512 bits are appended. + +3.2 Step 2. Append Length + + A 64-bit representation of b (the length of the message before the + padding bits were added) is appended to the result of the previous + step. In the unlikely event that b is greater than 2^64, then only + the low-order 64 bits of b are used. (These bits are appended as two + 32-bit words and appended low-order word first in accordance with the + previous conventions.) + + At this point the resulting message (after padding with bits and with + b) has a length that is an exact multiple of 512 bits. Equivalently, + this message has a length that is an exact multiple of 16 (32-bit) + words. Let M[0 ... N-1] denote the words of the resulting message, + where N is a multiple of 16. + +3.3 Step 3. Initialize MD Buffer + + A four-word buffer (A,B,C,D) is used to compute the message digest. + Here each of A, B, C, D is a 32-bit register. These registers are + initialized to the following values in hexadecimal, low-order bytes + first): + + + + +Rivest [Page 3] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + word A: 01 23 45 67 + word B: 89 ab cd ef + word C: fe dc ba 98 + word D: 76 54 32 10 + +3.4 Step 4. Process Message in 16-Word Blocks + + We first define four auxiliary functions that each take as input + three 32-bit words and produce as output one 32-bit word. + + F(X,Y,Z) = XY v not(X) Z + G(X,Y,Z) = XZ v Y not(Z) + H(X,Y,Z) = X xor Y xor Z + I(X,Y,Z) = Y xor (X v not(Z)) + + In each bit position F acts as a conditional: if X then Y else Z. + The function F could have been defined using + instead of v since XY + and not(X)Z will never have 1's in the same bit position.) It is + interesting to note that if the bits of X, Y, and Z are independent + and unbiased, the each bit of F(X,Y,Z) will be independent and + unbiased. + + The functions G, H, and I are similar to the function F, in that they + act in "bitwise parallel" to produce their output from the bits of X, + Y, and Z, in such a manner that if the corresponding bits of X, Y, + and Z are independent and unbiased, then each bit of G(X,Y,Z), + H(X,Y,Z), and I(X,Y,Z) will be independent and unbiased. Note that + the function H is the bit-wise "xor" or "parity" function of its + inputs. + + This step uses a 64-element table T[1 ... 64] constructed from the + sine function. Let T[i] denote the i-th element of the table, which + is equal to the integer part of 4294967296 times abs(sin(i)), where i + is in radians. The elements of the table are given in the appendix. + + Do the following: + + /* Process each 16-word block. */ + For i = 0 to N/16-1 do + + /* Copy block i into X. */ + For j = 0 to 15 do + Set X[j] to M[i*16+j]. + end /* of loop on j */ + + /* Save A as AA, B as BB, C as CC, and D as DD. */ + AA = A + BB = B + + + +Rivest [Page 4] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + CC = C + DD = D + + /* Round 1. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + [ABCD 0 7 1] [DABC 1 12 2] [CDAB 2 17 3] [BCDA 3 22 4] + [ABCD 4 7 5] [DABC 5 12 6] [CDAB 6 17 7] [BCDA 7 22 8] + [ABCD 8 7 9] [DABC 9 12 10] [CDAB 10 17 11] [BCDA 11 22 12] + [ABCD 12 7 13] [DABC 13 12 14] [CDAB 14 17 15] [BCDA 15 22 16] + + /* Round 2. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + [ABCD 1 5 17] [DABC 6 9 18] [CDAB 11 14 19] [BCDA 0 20 20] + [ABCD 5 5 21] [DABC 10 9 22] [CDAB 15 14 23] [BCDA 4 20 24] + [ABCD 9 5 25] [DABC 14 9 26] [CDAB 3 14 27] [BCDA 8 20 28] + [ABCD 13 5 29] [DABC 2 9 30] [CDAB 7 14 31] [BCDA 12 20 32] + + /* Round 3. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + [ABCD 5 4 33] [DABC 8 11 34] [CDAB 11 16 35] [BCDA 14 23 36] + [ABCD 1 4 37] [DABC 4 11 38] [CDAB 7 16 39] [BCDA 10 23 40] + [ABCD 13 4 41] [DABC 0 11 42] [CDAB 3 16 43] [BCDA 6 23 44] + [ABCD 9 4 45] [DABC 12 11 46] [CDAB 15 16 47] [BCDA 2 23 48] + + /* Round 4. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + [ABCD 0 6 49] [DABC 7 10 50] [CDAB 14 15 51] [BCDA 5 21 52] + [ABCD 12 6 53] [DABC 3 10 54] [CDAB 10 15 55] [BCDA 1 21 56] + [ABCD 8 6 57] [DABC 15 10 58] [CDAB 6 15 59] [BCDA 13 21 60] + [ABCD 4 6 61] [DABC 11 10 62] [CDAB 2 15 63] [BCDA 9 21 64] + + /* Then perform the following additions. (That is increment each + of the four registers by the value it had before this block + was started.) */ + A = A + AA + B = B + BB + C = C + CC + D = D + DD + + end /* of loop on i */ + + + +Rivest [Page 5] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +3.5 Step 5. Output + + The message digest produced as output is A, B, C, D. That is, we + begin with the low-order byte of A, and end with the high-order byte + of D. + + This completes the description of MD5. A reference implementation in + C is given in the appendix. + +4. Summary + + The MD5 message-digest algorithm is simple to implement, and provides + a "fingerprint" or message digest of a message of arbitrary length. + It is conjectured that the difficulty of coming up with two messages + having the same message digest is on the order of 2^64 operations, + and that the difficulty of coming up with any message having a given + message digest is on the order of 2^128 operations. The MD5 algorithm + has been carefully scrutinized for weaknesses. It is, however, a + relatively new algorithm and further security analysis is of course + justified, as is the case with any new proposal of this sort. + +5. Differences Between MD4 and MD5 + + The following are the differences between MD4 and MD5: + + 1. A fourth round has been added. + + 2. Each step now has a unique additive constant. + + 3. The function g in round 2 was changed from (XY v XZ v YZ) to + (XZ v Y not(Z)) to make g less symmetric. + + 4. Each step now adds in the result of the previous step. This + promotes a faster "avalanche effect". + + 5. The order in which input words are accessed in rounds 2 and + 3 is changed, to make these patterns less like each other. + + 6. The shift amounts in each round have been approximately + optimized, to yield a faster "avalanche effect." The shifts in + different rounds are distinct. + + + + + + + + + + +Rivest [Page 6] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +References + + [1] Rivest, R., "The MD4 Message Digest Algorithm", RFC 1320, MIT and + RSA Data Security, Inc., April 1992. + + [2] Rivest, R., "The MD4 message digest algorithm", in A.J. Menezes + and S.A. Vanstone, editors, Advances in Cryptology - CRYPTO '90 + Proceedings, pages 303-311, Springer-Verlag, 1991. + + [3] CCITT Recommendation X.509 (1988), "The Directory - + Authentication Framework." + +APPENDIX A - Reference Implementation + + This appendix contains the following files taken from RSAREF: A + Cryptographic Toolkit for Privacy-Enhanced Mail: + + global.h -- global header file + + md5.h -- header file for MD5 + + md5c.c -- source code for MD5 + + For more information on RSAREF, send email to . + + The appendix also includes the following file: + + mddriver.c -- test driver for MD2, MD4 and MD5 + + The driver compiles for MD5 by default but can compile for MD2 or MD4 + if the symbol MD is defined on the C compiler command line as 2 or 4. + + The implementation is portable and should work on many different + plaforms. However, it is not difficult to optimize the implementation + on particular platforms, an exercise left to the reader. For example, + on "little-endian" platforms where the lowest-addressed byte in a 32- + bit word is the least significant and there are no alignment + restrictions, the call to Decode in MD5Transform can be replaced with + a typecast. + +A.1 global.h + +/* GLOBAL.H - RSAREF types and constants + */ + +/* PROTOTYPES should be set to one if and only if the compiler supports + function argument prototyping. +The following makes PROTOTYPES default to 0 if it has not already + + + +Rivest [Page 7] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + been defined with C compiler flags. + */ +#ifndef PROTOTYPES +#define PROTOTYPES 0 +#endif + +/* POINTER defines a generic pointer type */ +typedef unsigned char *POINTER; + +/* UINT2 defines a two byte word */ +typedef unsigned short int UINT2; + +/* UINT4 defines a four byte word */ +typedef unsigned long int UINT4; + +/* PROTO_LIST is defined depending on how PROTOTYPES is defined above. +If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it + returns an empty list. + */ +#if PROTOTYPES +#define PROTO_LIST(list) list +#else +#define PROTO_LIST(list) () +#endif + +A.2 md5.h + +/* MD5.H - header file for MD5C.C + */ + +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + + + + +Rivest [Page 8] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +These notices must be retained in any copies of any part of this +documentation and/or software. + */ + +/* MD5 context. */ +typedef struct { + UINT4 state[4]; /* state (ABCD) */ + UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} MD5_CTX; + +void MD5Init PROTO_LIST ((MD5_CTX *)); +void MD5Update PROTO_LIST + ((MD5_CTX *, unsigned char *, unsigned int)); +void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); + +A.3 md5c.c + +/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm + */ + +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + */ + +#include "global.h" +#include "md5.h" + +/* Constants for MD5Transform routine. + */ + + + +Rivest [Page 9] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + +static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); +static void Encode PROTO_LIST + ((unsigned char *, UINT4 *, unsigned int)); +static void Decode PROTO_LIST + ((UINT4 *, unsigned char *, unsigned int)); +static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); +static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); + +static unsigned char PADDING[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* F, G, H and I are basic MD5 functions. + */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits. + */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. +Rotation is separate from addition to prevent recomputation. + */ +#define FF(a, b, c, d, x, s, ac) { \ + (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + + + +Rivest [Page 10] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) { \ + (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) { \ + (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) { \ + (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +/* MD5 initialization. Begins an MD5 operation, writing a new context. + */ +void MD5Init (context) +MD5_CTX *context; /* context */ +{ + context->count[0] = context->count[1] = 0; + /* Load magic initialization constants. +*/ + context->state[0] = 0x67452301; + context->state[1] = 0xefcdab89; + context->state[2] = 0x98badcfe; + context->state[3] = 0x10325476; +} + +/* MD5 block update operation. Continues an MD5 message-digest + operation, processing another message block, and updating the + context. + */ +void MD5Update (context, input, inputLen) +MD5_CTX *context; /* context */ +unsigned char *input; /* input block */ +unsigned int inputLen; /* length of input block */ +{ + unsigned int i, index, partLen; + + /* Compute number of bytes mod 64 */ + index = (unsigned int)((context->count[0] >> 3) & 0x3F); + + /* Update number of bits */ + if ((context->count[0] += ((UINT4)inputLen << 3)) + + + +Rivest [Page 11] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + < ((UINT4)inputLen << 3)) + context->count[1]++; + context->count[1] += ((UINT4)inputLen >> 29); + + partLen = 64 - index; + + /* Transform as many times as possible. +*/ + if (inputLen >= partLen) { + MD5_memcpy + ((POINTER)&context->buffer[index], (POINTER)input, partLen); + MD5Transform (context->state, context->buffer); + + for (i = partLen; i + 63 < inputLen; i += 64) + MD5Transform (context->state, &input[i]); + + index = 0; + } + else + i = 0; + + /* Buffer remaining input */ + MD5_memcpy + ((POINTER)&context->buffer[index], (POINTER)&input[i], + inputLen-i); +} + +/* MD5 finalization. Ends an MD5 message-digest operation, writing the + the message digest and zeroizing the context. + */ +void MD5Final (digest, context) +unsigned char digest[16]; /* message digest */ +MD5_CTX *context; /* context */ +{ + unsigned char bits[8]; + unsigned int index, padLen; + + /* Save number of bits */ + Encode (bits, context->count, 8); + + /* Pad out to 56 mod 64. +*/ + index = (unsigned int)((context->count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + MD5Update (context, PADDING, padLen); + + /* Append length (before padding) */ + MD5Update (context, bits, 8); + + + +Rivest [Page 12] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + /* Store state in digest */ + Encode (digest, context->state, 16); + + /* Zeroize sensitive information. +*/ + MD5_memset ((POINTER)context, 0, sizeof (*context)); +} + +/* MD5 basic transformation. Transforms state based on block. + */ +static void MD5Transform (state, block) +UINT4 state[4]; +unsigned char block[64]; +{ + UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + + Decode (x, block, 64); + + /* Round 1 */ + FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ + FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ + FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ + FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ + FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ + FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ + FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ + FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ + FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ + FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ + FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ + FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ + FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ + FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ + FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ + FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ + + /* Round 2 */ + GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ + GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ + GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ + GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ + GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ + GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ + GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ + GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ + GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ + GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ + GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ + + + +Rivest [Page 13] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ + GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ + GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ + GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ + GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ + + /* Round 3 */ + HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ + HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ + HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ + HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ + HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ + HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ + HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ + HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ + HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ + HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ + HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ + HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ + HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ + HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ + HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ + HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ + + /* Round 4 */ + II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ + II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ + II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ + II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ + II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ + II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ + II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ + II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ + II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ + II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ + II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ + II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ + II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ + II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ + II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ + II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + + /* Zeroize sensitive information. + + + +Rivest [Page 14] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +*/ + MD5_memset ((POINTER)x, 0, sizeof (x)); +} + +/* Encodes input (UINT4) into output (unsigned char). Assumes len is + a multiple of 4. + */ +static void Encode (output, input, len) +unsigned char *output; +UINT4 *input; +unsigned int len; +{ + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) { + output[j] = (unsigned char)(input[i] & 0xff); + output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); + output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); + output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); + } +} + +/* Decodes input (unsigned char) into output (UINT4). Assumes len is + a multiple of 4. + */ +static void Decode (output, input, len) +UINT4 *output; +unsigned char *input; +unsigned int len; +{ + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) + output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | + (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); +} + +/* Note: Replace "for loop" with standard memcpy if possible. + */ + +static void MD5_memcpy (output, input, len) +POINTER output; +POINTER input; +unsigned int len; +{ + unsigned int i; + + for (i = 0; i < len; i++) + + + +Rivest [Page 15] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + output[i] = input[i]; +} + +/* Note: Replace "for loop" with standard memset if possible. + */ +static void MD5_memset (output, value, len) +POINTER output; +int value; +unsigned int len; +{ + unsigned int i; + + for (i = 0; i < len; i++) + ((char *)output)[i] = (char)value; +} + +A.4 mddriver.c + +/* MDDRIVER.C - test driver for MD2, MD4 and MD5 + */ + +/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All +rights reserved. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + */ + +/* The following makes MD default to MD5 if it has not already been + defined with C compiler flags. + */ +#ifndef MD +#define MD MD5 +#endif + +#include +#include +#include +#include "global.h" +#if MD == 2 +#include "md2.h" +#endif +#if MD == 4 + + + +Rivest [Page 16] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +#include "md4.h" +#endif +#if MD == 5 +#include "md5.h" +#endif + +/* Length of test block, number of test blocks. + */ +#define TEST_BLOCK_LEN 1000 +#define TEST_BLOCK_COUNT 1000 + +static void MDString PROTO_LIST ((char *)); +static void MDTimeTrial PROTO_LIST ((void)); +static void MDTestSuite PROTO_LIST ((void)); +static void MDFile PROTO_LIST ((char *)); +static void MDFilter PROTO_LIST ((void)); +static void MDPrint PROTO_LIST ((unsigned char [16])); + +#if MD == 2 +#define MD_CTX MD2_CTX +#define MDInit MD2Init +#define MDUpdate MD2Update +#define MDFinal MD2Final +#endif +#if MD == 4 +#define MD_CTX MD4_CTX +#define MDInit MD4Init +#define MDUpdate MD4Update +#define MDFinal MD4Final +#endif +#if MD == 5 +#define MD_CTX MD5_CTX +#define MDInit MD5Init +#define MDUpdate MD5Update +#define MDFinal MD5Final +#endif + +/* Main driver. + +Arguments (may be any combination): + -sstring - digests string + -t - runs time trial + -x - runs test script + filename - digests file + (none) - digests standard input + */ +int main (argc, argv) +int argc; + + + +Rivest [Page 17] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + +char *argv[]; +{ + int i; + + if (argc > 1) + for (i = 1; i < argc; i++) + if (argv[i][0] == '-' && argv[i][1] == 's') + MDString (argv[i] + 2); + else if (strcmp (argv[i], "-t") == 0) + MDTimeTrial (); + else if (strcmp (argv[i], "-x") == 0) + MDTestSuite (); + else + MDFile (argv[i]); + else + MDFilter (); + + return (0); +} + +/* Digests a string and prints the result. + */ +static void MDString (string) +char *string; +{ + MD_CTX context; + unsigned char digest[16]; + unsigned int len = strlen (string); + + MDInit (&context); + MDUpdate (&context, string, len); + MDFinal (digest, &context); + + printf ("MD%d (\"%s\") = ", MD, string); + MDPrint (digest); + printf ("\n"); +} + +/* Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte + blocks. + */ +static void MDTimeTrial () +{ + MD_CTX context; + time_t endTime, startTime; + unsigned char block[TEST_BLOCK_LEN], digest[16]; + unsigned int i; + + + + +Rivest [Page 18] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + printf + ("MD%d time trial. Digesting %d %d-byte blocks ...", MD, + TEST_BLOCK_LEN, TEST_BLOCK_COUNT); + + /* Initialize block */ + for (i = 0; i < TEST_BLOCK_LEN; i++) + block[i] = (unsigned char)(i & 0xff); + + /* Start timer */ + time (&startTime); + + /* Digest blocks */ + MDInit (&context); + for (i = 0; i < TEST_BLOCK_COUNT; i++) + MDUpdate (&context, block, TEST_BLOCK_LEN); + MDFinal (digest, &context); + + /* Stop timer */ + time (&endTime); + + printf (" done\n"); + printf ("Digest = "); + MDPrint (digest); + printf ("\nTime = %ld seconds\n", (long)(endTime-startTime)); + printf + ("Speed = %ld bytes/second\n", + (long)TEST_BLOCK_LEN * (long)TEST_BLOCK_COUNT/(endTime-startTime)); +} + +/* Digests a reference suite of strings and prints the results. + */ +static void MDTestSuite () +{ + printf ("MD%d test suite:\n", MD); + + MDString (""); + MDString ("a"); + MDString ("abc"); + MDString ("message digest"); + MDString ("abcdefghijklmnopqrstuvwxyz"); + MDString + ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); + MDString + ("1234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890"); +} + +/* Digests a file and prints the result. + + + +Rivest [Page 19] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + */ +static void MDFile (filename) +char *filename; +{ + FILE *file; + MD_CTX context; + int len; + unsigned char buffer[1024], digest[16]; + + if ((file = fopen (filename, "rb")) == NULL) + printf ("%s can't be opened\n", filename); + + else { + MDInit (&context); + while (len = fread (buffer, 1, 1024, file)) + MDUpdate (&context, buffer, len); + MDFinal (digest, &context); + + fclose (file); + + printf ("MD%d (%s) = ", MD, filename); + MDPrint (digest); + printf ("\n"); + } +} + +/* Digests the standard input and prints the result. + */ +static void MDFilter () +{ + MD_CTX context; + int len; + unsigned char buffer[16], digest[16]; + + MDInit (&context); + while (len = fread (buffer, 1, 16, stdin)) + MDUpdate (&context, buffer, len); + MDFinal (digest, &context); + + MDPrint (digest); + printf ("\n"); +} + +/* Prints a message digest in hexadecimal. + */ +static void MDPrint (digest) +unsigned char digest[16]; +{ + + + +Rivest [Page 20] + +RFC 1321 MD5 Message-Digest Algorithm April 1992 + + + unsigned int i; + + for (i = 0; i < 16; i++) + printf ("%02x", digest[i]); +} + +A.5 Test suite + + The MD5 test suite (driver option "-x") should print the following + results: + +MD5 test suite: +MD5 ("") = d41d8cd98f00b204e9800998ecf8427e +MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661 +MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72 +MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0 +MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b +MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = +d174ab98d277d9f5a5611c2c9f419d9f +MD5 ("123456789012345678901234567890123456789012345678901234567890123456 +78901234567890") = 57edf4a22be3c955ac49da2e2107b67a + +Security Considerations + + The level of security discussed in this memo is considered to be + sufficient for implementing very high security hybrid digital- + signature schemes based on MD5 and a public-key cryptosystem. + +Author's Address + + Ronald L. Rivest + Massachusetts Institute of Technology + Laboratory for Computer Science + NE43-324 + 545 Technology Square + Cambridge, MA 02139-1986 + + Phone: (617) 253-5880 + EMail: rivest@theory.lcs.mit.edu + + + + + + + + + + + + +Rivest [Page 21] + \ No newline at end of file diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 7f7d937df..1384a6c40 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3802,6 +3802,10 @@ simply typing `make back_to` or `make mullender`. [Cody](#cody) added explicit linking of libm (`-lm`) for systems that do not do this (Linux doesn't seem to but macOS does). +Cody also added the RFC 1321 text file, [rfc1321.txt](2015/hou/rfc1321.txt) to +the directory, to make it so one need not download it, and which the README.md +file now links to. + ## [2015/howe](2015/howe/prog.c) ([README.md](2015/howe/README.md)) From 00f28639e354e90c345b6ef359c1bb631c636edc Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 03:19:14 -0800 Subject: [PATCH 02/27] Typo fix in 2015/howe/spoiler/err.h --- 2015/howe/spoiler/err.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2015/howe/spoiler/err.h b/2015/howe/spoiler/err.h index 839c76ac4..1a6ba9346 100644 --- a/2015/howe/spoiler/err.h +++ b/2015/howe/spoiler/err.h @@ -1,5 +1,5 @@ /* - * Trival err.h + * Trivial err.h */ #ifndef __err_h__ @@ -43,4 +43,4 @@ extern "C" { } #endif -#endif /* __err_h__ */ \ No newline at end of file +#endif /* __err_h__ */ From 94a69dfc998ce089e11e024d945e0c968a5f2d1b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 03:29:59 -0800 Subject: [PATCH 03/27] Fix dead links in 2015/muth/machine_*.h With the exception of those on the IOCCC website (maybe one other place but don't think so) the links were dead. These have been replaced for historical purposes with a captured copy on the Internet Wayback Machine. This entry should now be entirely complete. --- 2015/muth/machine_beaver_4_2.h | 2 +- 2015/muth/machine_champ_2_4.h | 2 +- 2015/muth/machine_chaos_5_2.h | 4 ++-- 2015/muth/machine_cmplx_5_2.h | 2 +- 2015/muth/machine_count_5_2.h | 2 +- 2015/muth/machine_great_3_2.h | 2 +- 2015/muth/machine_ru_2_4.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/2015/muth/machine_beaver_4_2.h b/2015/muth/machine_beaver_4_2.h index 13ad467c4..f0fac1373 100644 --- a/2015/muth/machine_beaver_4_2.h +++ b/2015/muth/machine_beaver_4_2.h @@ -1,5 +1,5 @@ /* - * 4 state, 2 symbol busy beaver, http://www.logique.jussieu.fr/~michel/ha.html#tm42 + * 4 state, 2 symbol busy beaver, https://web.archive.org/web/20150926094245/http://www.logique.jussieu.fr/~michel/ha.html#tm42 * * halts after 107 steps */ diff --git a/2015/muth/machine_champ_2_4.h b/2015/muth/machine_champ_2_4.h index 77d437d8e..24a8533d3 100644 --- a/2015/muth/machine_champ_2_4.h +++ b/2015/muth/machine_champ_2_4.h @@ -1,5 +1,5 @@ /* - * 2 state, 4 symbol current champion, http://www.logique.jussieu.fr/~michel/ha.html#tm24 + * 2 state, 4 symbol current champion, https://web.archive.org/web/20150926094245/http://www.logique.jussieu.fr/~michel/ha.html#tm24 * * halts after 3932964 steps */ diff --git a/2015/muth/machine_chaos_5_2.h b/2015/muth/machine_chaos_5_2.h index d16b9b4d4..1180a4e0a 100644 --- a/2015/muth/machine_chaos_5_2.h +++ b/2015/muth/machine_chaos_5_2.h @@ -1,7 +1,7 @@ /* - * chaos machine, http://www.drb.insel.de/~heiner/BB/mabu90.html + * chaos machine, https://web.archive.org/web/20131104160623/http://www.drb.insel.de/~heiner/BB/mabu90.html * - * does not halt (http://www.drb.insel.de/~heiner/BB/TM4-proof.txt) + * does not halt (https://web.archive.org/web/20131104203330/http://www.drb.insel.de/~heiner/BB/TM4-proof.txt) */ #define sym_1(sym, _1) sym diff --git a/2015/muth/machine_cmplx_5_2.h b/2015/muth/machine_cmplx_5_2.h index 27908da4b..7874f3248 100644 --- a/2015/muth/machine_cmplx_5_2.h +++ b/2015/muth/machine_cmplx_5_2.h @@ -1,5 +1,5 @@ /* - * complex machine, http://www.drb.insel.de/~heiner/BB/mabu90.html + * complex machine, https://web.archive.org/web/20131104160623/http://www.drb.insel.de/~heiner/BB/mabu90.html */ #define sym_1(sym, _1) sym diff --git a/2015/muth/machine_count_5_2.h b/2015/muth/machine_count_5_2.h index ee9b9a3ce..e006207d5 100644 --- a/2015/muth/machine_count_5_2.h +++ b/2015/muth/machine_count_5_2.h @@ -1,5 +1,5 @@ /* - * counting machine, http://www.drb.insel.de/~heiner/BB/mabu90.html + * counting machine, https://web.archive.org/web/20131104160623/http://www.drb.insel.de/~heiner/BB/mabu90.html * * does not halt */ diff --git a/2015/muth/machine_great_3_2.h b/2015/muth/machine_great_3_2.h index f4ffbe797..07596f5a3 100644 --- a/2015/muth/machine_great_3_2.h +++ b/2015/muth/machine_great_3_2.h @@ -1,5 +1,5 @@ /* - * greater machine, http://www.drb.insel.de/~heiner/BB/mabu90.html + * greater machine, https://web.archive.org/web/20131104160623/http://www.drb.insel.de/~heiner/BB/mabu90.html * * does not halt */ diff --git a/2015/muth/machine_ru_2_4.h b/2015/muth/machine_ru_2_4.h index e9523be82..3dd5768f8 100644 --- a/2015/muth/machine_ru_2_4.h +++ b/2015/muth/machine_ru_2_4.h @@ -1,5 +1,5 @@ /* - * 2 state, 4 symbol current runner-up, http://www.logique.jussieu.fr/~michel/ha.html#tm24 + * 2 state, 4 symbol current runner-up, https://web.archive.org/web/20150926094245/http://www.logique.jussieu.fr/~michel/ha.html#tm24 * * halts after 7195 steps */ From feedf2133f29c84102cb06940881f78f250f8af1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:17:09 -0800 Subject: [PATCH 04/27] Improve how to define sleep time in 1985/lycklama With Makefile variables one can just do for instance: make SLEEP=700 clobber alt which will set the macro Z to 700. --- 1985/lycklama/Makefile | 8 +++++++- 1985/lycklama/README.md | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/1985/lycklama/Makefile b/1985/lycklama/Makefile index a5565d8f3..d25eca3e9 100644 --- a/1985/lycklama/Makefile +++ b/1985/lycklama/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=500 +CDEFINE= -DZ=${SLEEP} # Include files that are needed to compile # @@ -137,6 +137,12 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +SLEEP=500 + +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} + + # data files # data: ${DATA} diff --git a/1985/lycklama/README.md b/1985/lycklama/README.md index 984b319fd..1cfb41ccb 100644 --- a/1985/lycklama/README.md +++ b/1985/lycklama/README.md @@ -12,7 +12,7 @@ make alt ``` To see why we recommend the alternate version instead of the original version, -see below and the [original code](#original-code) section. +see below and the [Original code](#original-code) section. ### Try: @@ -25,7 +25,7 @@ reconfigure it like: ```sh -make CDEFINE+="-DZ=700" clobber alt +make SLEEP=700 clobber alt ``` which would set it at 700. Then, whether you use the default value or not, try: From e8ad7a89f5802b2b970963f10b3337a58671987f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:21:23 -0800 Subject: [PATCH 05/27] Add comment about SLEEP var in lycklama Makefile --- 1985/lycklama/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/1985/lycklama/Makefile b/1985/lycklama/Makefile index d25eca3e9..858bd0d80 100644 --- a/1985/lycklama/Makefile +++ b/1985/lycklama/Makefile @@ -137,6 +137,7 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variable to control amount of time to sleep between writes for alt code. SLEEP=500 ${PROG}.alt: ${PROG}.alt.c From 8f4f9a650ab7dc7f054e41d65acd909d1afc4cd6 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:26:52 -0800 Subject: [PATCH 06/27] Improve how to redefine size in 1985/shapiro Now one can just do: make clobber SIZE=5 alt for example. This is done through a Makefile variable. --- 1985/shapiro/Makefile | 7 +++++-- 1985/shapiro/README.md | 4 ++-- 1985/shapiro/try.alt.sh | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/1985/shapiro/Makefile b/1985/shapiro/Makefile index b25f0e5b2..f2f18b470 100644 --- a/1985/shapiro/Makefile +++ b/1985/shapiro/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DC=39 +CDEFINE= -DC=${SIZE} # Include files that are needed to compile # @@ -136,8 +136,11 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variable to control size of maze for alt code +SIZE=39 + ${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -DC=${SIZE} $< -o $@ ${LDFLAGS} # data files # diff --git a/1985/shapiro/README.md b/1985/shapiro/README.md index 2471841c0..ab23af709 100644 --- a/1985/shapiro/README.md +++ b/1985/shapiro/README.md @@ -5,7 +5,7 @@ make all ``` There is alternate code which allows one to change the size of the maze. See -[alternate code](#alternate-code) below. +[Alternate code](#alternate-code) below. ### To run: @@ -32,7 +32,7 @@ make alt If you wish to change the value you can do it like: ```sh -make clobber CDEFINE="-DC=5" alt +make clobber SIZE=5 alt ``` Note that if it is not a number then obviously there will be a compilation diff --git a/1985/shapiro/try.alt.sh b/1985/shapiro/try.alt.sh index b5cbfdc43..6ab48c125 100755 --- a/1985/shapiro/try.alt.sh +++ b/1985/shapiro/try.alt.sh @@ -25,7 +25,8 @@ while ((i < 5)); do fi read -r -n 1 -p "Press any key to set to $C: " - make clobber CC="$CC" CDEFINE="-DC=$C" alt >/dev/null + echo 1>&2 + make clobber CC="$CC" SIZE="$C" alt >/dev/null ./shapiro.alt ((i++)) done @@ -39,7 +40,7 @@ while :; do # ^-- SC2143 (style): Use grep -q instead of comparing output with [ -n .. ]. # shellcheck disable=SC2143 if [[ $(echo "$REPLY" | grep -E '\<[0-9]+\>') ]]; then - make clobber CC="$CC" CDEFINE="-DC=\"$REPLY\"" alt >/dev/null + make clobber CC="$CC" SIZE="$REPLY" alt >/dev/null ./shapiro.alt else exit 0 From 2277d88ac5e980c850f7dd7688bb7359e319f2d7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:35:17 -0800 Subject: [PATCH 07/27] Improve how to redefine max moves in 1991/rince By a Makefile variable using make MAXMOVES=N clobber alt where N is an integer will set the maximum number of moves one may make in the second alt version (rince.alt2.c) (the first alt version rince.alt.c has no limit). --- 1991/rince/Makefile | 6 ++++-- 1991/rince/README.md | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/1991/rince/Makefile b/1991/rince/Makefile index 681278ff1..5dcb45555 100644 --- a/1991/rince/Makefile +++ b/1991/rince/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DMAX_MOVES=484 +CDEFINE= -DMAX_MOVES=${MAXMOVES} # Include files that are needed to compile # @@ -137,11 +137,13 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variable to control max number of moves +MAXMOVES=484 ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} ${PROG}2.alt: ${PROG}.alt2.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -DMAX_MOVES=${MAXMOVES} $< -o $@ ${LDFLAGS} # data files # diff --git a/1991/rince/README.md b/1991/rince/README.md index f936ed236..7ed7df087 100644 --- a/1991/rince/README.md +++ b/1991/rince/README.md @@ -20,9 +20,10 @@ that's fewer than the original program. The first alternate version, [rince.alt.c](rince.alt.c), disables a maximum move count so that anyone with enough patience and time can complete the puzzle, -without having to worry about how many moves they make. The second version, -[rince.alt2.c](rince.alt2.c), allows one to reconfigure at compilation the -maximum number of moves, even if that is lowering the count. +without having to worry about how many moves they make, assuming they don't get +stuck. The second version, [rince.alt2.c](rince.alt2.c), allows one to +reconfigure at compilation the maximum number of moves, even if that is lowering +the count. The author set the maximum number of moves to 484. @@ -39,12 +40,13 @@ restrictions in the number of movements and the second one, `rince.alt2`, has a configurable maximum number of moves allowed, defaulting to the entry's max, 484. -To reconfigure the maximum number of moves: +To reconfigure the maximum number of moves to 700: ```sh -make clobber CDEFINE+="-DMAX_MOVES=5" alt +make clobber MAXMOVES=700 alt ``` + ### Alternate use: To run the first alt version: From 37a466224b5796147b0823b9b96c988309b36448 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:40:15 -0800 Subject: [PATCH 08/27] Improve how redefine sleep in 1992/kivinen Using a Makefile variable one can do for instance make clobber SLEEP=30000 alt to change the Z macro, the time to sleep. --- 1992/kivinen/Makefile | 8 +++++++- 1992/kivinen/README.md | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/1992/kivinen/Makefile b/1992/kivinen/Makefile index 0aae99170..730917f9d 100644 --- a/1992/kivinen/Makefile +++ b/1992/kivinen/Makefile @@ -59,7 +59,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=20000 +CDEFINE= -DZ=${SLEEP} # Include files that are needed to compile # @@ -138,6 +138,12 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variable to control amount of time to sleep between writes for alt code. +SLEEP= 20000 +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} + + # data files # data: ${DATA} diff --git a/1992/kivinen/README.md b/1992/kivinen/README.md index 6e86a1a4f..8f9458e96 100644 --- a/1992/kivinen/README.md +++ b/1992/kivinen/README.md @@ -39,9 +39,9 @@ Also try changing the speed this game moves. For instance if you wish to change the `usleep(3)` value to `30000` from `20000`, try: ```sh -make clobber CDEFINE="-DZ=30000" alt # make it slower +make clobber SLEEP=30000 alt # make it slower -make clobber CDEFINE="-DZ=10000" alt # make it faster +make clobber SLEEP=10000 alt # make it faster ``` Then use the same syntax as above and described by the author. From 881aac67670e3a765e1a79f710862f21a0a3fd5f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:41:58 -0800 Subject: [PATCH 09/27] Add missing space after = in 1985/shapiro .. the Makefile, that is. --- 1985/shapiro/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1985/shapiro/Makefile b/1985/shapiro/Makefile index f2f18b470..6aa897cc0 100644 --- a/1985/shapiro/Makefile +++ b/1985/shapiro/Makefile @@ -137,7 +137,7 @@ alt: data ${ALT_TARGET} @${TRUE} # variable to control size of maze for alt code -SIZE=39 +SIZE= 39 ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} -DC=${SIZE} $< -o $@ ${LDFLAGS} From fb245cbf53ddcbe9218a180784457e5d33dd0678 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:43:03 -0800 Subject: [PATCH 10/27] Add missing space after = in 1991/rince/Makefile --- 1991/rince/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1991/rince/Makefile b/1991/rince/Makefile index 5dcb45555..9c60e9201 100644 --- a/1991/rince/Makefile +++ b/1991/rince/Makefile @@ -138,7 +138,7 @@ alt: data ${ALT_TARGET} @${TRUE} # variable to control max number of moves -MAXMOVES=484 +MAXMOVES= 484 ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} From 49945cb95fac03f9a99093beef5ecd75dd64ca78 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:45:35 -0800 Subject: [PATCH 11/27] Improve how to redefine sleep in 1993/cmills Using a Makefile variable one can now do make clobber SLEEP=200 alt to change the time to sleep, rather than the more awkward redefining CDEFINE. --- 1993/cmills/Makefile | 7 +++++-- 1993/cmills/README.md | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/1993/cmills/Makefile b/1993/cmills/Makefile index 967ece1e9..85af27aab 100644 --- a/1993/cmills/Makefile +++ b/1993/cmills/Makefile @@ -57,7 +57,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=100 +CDEFINE= -DZ=${SLEEP} # Include files that are needed to compile # @@ -141,8 +141,11 @@ chris: ${PROG} alt: data ${ALT_TARGET} @${TRUE} +# variable to control how long to sleep in alt version between updates +SLEEP= 100 + ${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} # data files # diff --git a/1993/cmills/README.md b/1993/cmills/README.md index 15ad711c1..eae5bc027 100644 --- a/1993/cmills/README.md +++ b/1993/cmills/README.md @@ -12,7 +12,7 @@ make alt To configure how many microseconds to sleep before updates try: ```sh -make clobber CDEFINE="-DZ=200" alt +make clobber SLEEP=200 alt ``` NOTE: this entry requires `X11/Xlib.h` header file and the X11 library to @@ -32,7 +32,6 @@ STATUS: known bug - please help us fix For more detailed information see [1993 cmills in bugs.md](/bugs.md#1993-cmills). - ## To use: ```sh From 0fcd68f250156cc5742e5d07e4e5dda9d9873a26 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:48:10 -0800 Subject: [PATCH 12/27] Improve how to redefine sleep time in 1993/plummer Using a Makefile variable one may do make clobber SLEEP=50 alt to change the Z macro to 50 or whatever they want. --- 1993/plummer/Makefile | 6 ++++-- 1993/plummer/README.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/1993/plummer/Makefile b/1993/plummer/Makefile index b1c56da2e..8107ae4e8 100644 --- a/1993/plummer/Makefile +++ b/1993/plummer/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=200 +CDEFINE= -DZ=${SLEEP} # Include files that are needed to compile # @@ -138,8 +138,10 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variable to control how long to sleep in alt version +SLEEP= 200 ${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} # data files # diff --git a/1993/plummer/README.md b/1993/plummer/README.md index 26de8dda2..7d6288840 100644 --- a/1993/plummer/README.md +++ b/1993/plummer/README.md @@ -44,7 +44,7 @@ make alt If you wish to change the time to sleep (default `200`) you can do so like: ```sh -make clobber CDEFINE="-DZ=50" alt +make clobber SLEEP=50 alt ``` From 031ca74d9e34215fa2e36fd7fb27fc9feec65ab3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:52:44 -0800 Subject: [PATCH 13/27] Improve how to redefine sleep in 1993/rince Using a Makefile variable one can now do just make clobber SLEEP=18 alt or whatever number they wish. Also added jkb.alt and jkb.alt2 rules that correspond to the jkb rule. --- 1993/rince/.gitignore | 2 ++ 1993/rince/Makefile | 20 +++++++++++++++++++- 1993/rince/README.md | 4 +--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/1993/rince/.gitignore b/1993/rince/.gitignore index c935df6bd..9bee489dc 100644 --- a/1993/rince/.gitignore +++ b/1993/rince/.gitignore @@ -1,4 +1,6 @@ jkb +jkb.alt +jkb.alt2 rince rince.orig rince.alt diff --git a/1993/rince/Makefile b/1993/rince/Makefile index badac181e..b0d789b75 100644 --- a/1993/rince/Makefile +++ b/1993/rince/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=17 +CDEFINE= -DZ=${SLEEP} # Include files that are needed to compile # @@ -143,6 +143,24 @@ jkb: ${PROG} alt: data ${ALT_TARGET} @${TRUE} +# variable to control how long to sleep in alt version +SLEEP= 17 + +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} + +${PROG}.alt2: ${PROG}.alt2.c + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} + +jkb.alt: ${PROG}.alt + ${RM} -f $@ + ${LN} $< $@ + +jkb.alt2: ${PROG}.alt + ${RM} -f $@ + ${LN} $< $@ + + # data files # data: ${DATA} diff --git a/1993/rince/README.md b/1993/rince/README.md index c2d4cbeb6..63e218c73 100644 --- a/1993/rince/README.md +++ b/1993/rince/README.md @@ -20,8 +20,6 @@ STATUS: INABIAF - please **DO NOT** fix For more detailed information see [1993 rince in bugs.md](/bugs.md#1993-rince). - - ## To use: ```sh @@ -61,7 +59,7 @@ changed). ```sh -make CDEFINE="-DZ=18" clobber alt +make SLEEP=18 clobber alt ``` Replace 18 with whatever number you wish. From dd98bfe5ce035bb7ff07a6bd4a704b52c88e88b8 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:55:45 -0800 Subject: [PATCH 14/27] Improve how to set number of arrows 1994/dodsond2 Using a Makefile variable one can now do make clobber ARROWS=5 alt or whatever they wish to set it to. The code already checked the range. --- 1994/dodsond2/Makefile | 7 +++++-- 1994/dodsond2/README.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/1994/dodsond2/Makefile b/1994/dodsond2/Makefile index d93a70cab..2c276590a 100644 --- a/1994/dodsond2/Makefile +++ b/1994/dodsond2/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DW=3 +CDEFINE= -DW=${ARROWS} # Include files that are needed to compile # @@ -138,8 +138,11 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variable to allow overriding how many arrows to start with +ARROWS= 3 + ${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -DW=${ARROWS} $< -o $@ ${LDFLAGS} # data files # diff --git a/1994/dodsond2/README.md b/1994/dodsond2/README.md index 5c86b55e4..dcfd713d2 100644 --- a/1994/dodsond2/README.md +++ b/1994/dodsond2/README.md @@ -46,7 +46,7 @@ The default number of arrows in this version is 3 but if you want to change it, say to 5, try: ```sh -make clobber CDEFINE="-DW=5" alt +make clobber ARROWS=5 alt ``` From 75839e221ce250bfa598edb4737c81342192dc35 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 08:08:03 -0800 Subject: [PATCH 15/27] Improve redefining keys in 1998/banks The Makefile now has variables so one can do something like: make clobber IT=key DT=key ... all The alt code has hard coded alternatives to page up and page down keys. The reason it's hard coded is it would necessarily overcomplicate the build process, requiring different macro names for alt and original code, and since you can redefine them all in the original entry this is not a problem. It is merely a convenience for those who are fine with defaults. The replacement keys are both on the left side as it would be harder to have to use left and right when trying to use the right side for other keys (at least on a QWERTY keyboard?). I tried to clean up the build instructions in the README.md file for this too but this was a bit complicated to do. It might need a bit more work. --- 1998/banks/Makefile | 19 +++++-- 1998/banks/README.md | 129 +++++++++++++++++++++++++------------------ 2 files changed, 90 insertions(+), 58 deletions(-) diff --git a/1998/banks/Makefile b/1998/banks/Makefile index 315611910..2097f2162 100644 --- a/1998/banks/Makefile +++ b/1998/banks/Makefile @@ -57,11 +57,21 @@ CSTD= -std=gnu90 # ARCH= +# variables that control the control keys + +IT= XK_Page_Up +DT= XK_Page_Down +UP= XK_Up +DN= XK_Down +LT= XK_Left +RT= XK_Right +CS= XK_Return +dt= 0.02 # Defines that are needed to compile # -CDEFINE= -DIT=XK_Page_Up -DDT=XK_Page_Down \ - -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ - -DCS=XK_Return -Ddt=0.02 +CDEFINE= -DIT=${IT} -DDT=${DT} \ + -DUP=${UP} -DDN=${DN} -DLT=${LT} -DRT=${RT} \ + -DCS=${CS} -Ddt=${dt} # Include files that are needed to compile # @@ -142,8 +152,7 @@ alt: data ${ALT_TARGET} @${TRUE} ${PROG}.alt: ${PROG}.c - ${CC} ${CFLAGS} -UIT -UDT -DIT=XK_f -DDT=XK_d -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ - -DCS=XK_Return -Ddt=0.02 $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -UIT -UDT -DIT=XK_f -DDT=XK_d $< -o $@ ${LDFLAGS} # data files diff --git a/1998/banks/README.md b/1998/banks/README.md index b2934e52c..563eb18c2 100644 --- a/1998/banks/README.md +++ b/1998/banks/README.md @@ -4,10 +4,59 @@ make all ``` + + +You may redefine all the keys and the time step with predefined macros. The +author provided the following able: + +``` +Control Description Default Key +------- ------------------------- ----------- + IT Increase throttle XK_Page_Up + DT Decrease throttle XK_Page_Down + FD Move stick forward XK_Up + BK Move stick back XK_Down + LT Move stick left XK_Left + RT Move stick right XK_Right + CS Center stick XK_Enter +``` + +There is another macro, `dt`, which is the time step. See some important points +on this in the author's comments in the [Alternate Build +Instructions](#alternate-build-instructions) section. + +If however you wish to change the above controls, see the header file +[keysym.h](keysym.h) for the definitions of other characters that you might wish +to use. The name of the macro in the header file is what you need to set the +macros to, depending on what controls you wish to redefine. For instance, to set +the throttle up and down to `u` and `d`: + + +```sh +make clobber IT=XK_u DT=XK_d all +``` + +because in the header file you can see that `XK_u` corresponds to `u` and `XK_d` +corresponds to `d`: + +```c +#define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */ +#define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */ +``` + +Note that the [keysym.h](keysym.h) file is not complete from X11; it's just the +more likely candidates (and some that are probably unlikely :-) ). + +The upper case letters would be `XK_U` and `XK_D` and you can search the header +file for 'LATIN CAPITAL D', for example. + For those who do not have a Page Up or Page Down key, see [alternate -code](#alternate-code) below. The same method may be used if you wish to -redefine other keys but the alt build sets a default for those without page up -and page down. +code](#alternate-code) below. The difference from the alt build and the original +entry is that the page up and page down keys are defined to a default but they +are hard coded as doing otherwise would necessarily complicate the build +instructions. Since you can use the original entry to redefine these this is not +a problem and is purely a convenience .. if only for those who are okay with the +preselected alternative keys. ## To use: @@ -33,62 +82,35 @@ you can regain control? If you do not have access to a page up or page down key, for instance you're using a Mac, you can use the alt code (though it actually uses the same code) that will redefine the keys to increase throttle and decrease throttle. This -same method can be used with the original code but this is sets up a default for -the missing keys of Macs. +same method can be used with the original code but this sets up predefined keys +in place of Page Up and Page Down. -The keys were somewhat arbitrarily selected but it was decided to make them on -the left side of the keyboard as one might have a harder time using the arrows -at the same time as typing on the right side. +The keys were somewhat arbitrarily selected but it was decided to make them both +on the left side of a QWERTY keyboard as one might have a harder time using the +arrows at the same time as typing on the right side. ### Alternate build: As the Makefile allows you to configure the keys to use you may redefine the -keys. This can be done for both versions but if you don't have certain keys it's -even more important. In the main program increasing throttle is by page up and -decreasing throttle is page down. In the alt build it is `f` and `d` -respectively as these are letters on the left side of the keyboard which is -easier to use if one is using the right side for movement. +keys but with the alt build you cannot, as described earlier, redefine the page +up and page down replacement keys. If you want to do that you should use the +original entry as described in the to build section above. -To use the default changes: +In the alt build it is `f` and `d` respectively as these are letters on the left +side of the keyboard which is easier to use if one is using the right side for +movement. These are hard coded, as noted. + +To use the default settings for the alternate build: ```sh make alt ``` -If however you wish to change these, see the header file [keysym.h](keysym.h) -for the definitions of other characters that you might wish to use. The name of -the macro in the header file is what you need to set the macros in the Makefile -to, depending on what controls you wish to redefine. +You may change the other keys as described in the build instructions, above, but +this alt code can be seen as an alternative for those who don't have or don't +want to use page up and page down. -For instance if you want to use 'u' to increase throttle and 'd' to decrease -throttle you would do: - -```sh -make clobber CDEFINE="-UIT -UDT -DIT=XK_u -DDT=XK_d -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ - -DCS=XK_Return" alt -``` - -because in the header file you can see that `XK_u` corresponds to `u` and `XK_d` -corresponds to `d`: - -```c -#define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */ -#define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */ -``` - -Note that you must specify all keys and other `-D` macros if you redefine any of -them. - -The upper case letters would be `XK_U` and `XK_D` and you can search the header -file for 'LATIN CAPITAL D', for example. - -See [alternate build instructions](#alternate-build-instructions) for the proper -macro names. You may do the above for the entry itself as well, of course, if -you do not like the defaults selected. - -Note that the [keysym.h](keysym.h) file is not complete from X11; it's just the -more likely candidates (and some that are probably unlikely :-) ). ### Alternate use: @@ -133,6 +155,7 @@ indicator, or compass. 0 is north, 90 is east, 180 is south, 270 is west. The third instrument is the altimeter, which measures your height above ground level in feet. + ### Features * Simulator models a [Piper @@ -241,8 +264,10 @@ to default values. Use this section if you want to compile with different options. To map a key to a control, you must pass an option to the -compiler in the format `-Dcontrol=key`. The possible controls -you can map are described in the table below: +compiler in the format `-Dcontrol=key` or if you use the Makefile you can do +`make control=key`. + +The possible controls you can map are described in the table below: ``` Control Description Default Key @@ -260,16 +285,14 @@ Values for the possible keys can be found in the X Windows header file ``. This file is most likely a cross-reference to another header, ``. -You must map all seven controls to keys at compile time, or the -compilation will fail. - For example, to map Center Stick to the space-bar, the compile -option would be `-DCS=XK_space`. +option would be `-DCS=XK_space` or `make CS=XK_space`. To set the time step size, you must pass the following option to the compiler: `-Ddt=duration`, where `dt` is literal, and where -`duration` is the time in seconds you want the time step to be. +`duration` is the time in seconds you want the time step to be. Alternatively, +if you use the provided Makefile, you may just do `make dt=time`. Two things to keep in mind when selecting a time step. Time steps that are too large (more than about `0.03`) will cause From 1041382f681cc3fb7d825a834e92eb709fc04c3c Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:22:51 -0800 Subject: [PATCH 16/27] Improve redefining size in 1998/schweikh3 Now one can do make clobber SIZE=55555 alt or whatever size they wish. --- 1998/schweikh3/Makefile | 10 +++++++++- 1998/schweikh3/README.md | 5 ++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/1998/schweikh3/Makefile b/1998/schweikh3/Makefile index d7e2f2bab..fefa31df9 100644 --- a/1998/schweikh3/Makefile +++ b/1998/schweikh3/Makefile @@ -55,10 +55,13 @@ CSTD= -std=gnu90 # ARCH= +# variable for size, primarily for alt code +# +SIZE=32767 # Defines that are needed to compile # CDEFINE= -DM0=sizeof -DM1=long -DM2=void \ - -DM3=realloc -DM4=calloc -DM5=free -DSZ=32767 + -DM3=realloc -DM4=calloc -DM5=free -DSZ=${SIZE} # Include files that are needed to compile # @@ -138,6 +141,11 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} + +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${LN} -sf $@ samefile.alt + # data files # data: ${DATA} diff --git a/1998/schweikh3/README.md b/1998/schweikh3/README.md index aac682d00..190aca9ab 100644 --- a/1998/schweikh3/README.md +++ b/1998/schweikh3/README.md @@ -54,11 +54,10 @@ If you wish to change the size to say, 55555: ```sh -make clobber CDEFINE="-DSZ=55555" alt +make clobber SIZE=55555 alt ``` -or whatever you wish to redefine it to. See [alternate code](#alternate-code) -below. +or whatever you wish to redefine it to. ## Judges' remarks: From 515105864def1f5fcbae10f9f51e9e71baf8e1fa Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:30:09 -0800 Subject: [PATCH 17/27] Improve redefining sleep time in 2000/thadgavin Now one can do instead make SLEEP=555 SDL_SLEEP=555 alt where SLEEP is the variable for the curses version and SDL_SLEEP is for the SDL version. One need not specify both if they do not want to redefine one or the other and of course one doesn't have to specify a sleep time at all either. --- 2000/thadgavin/Makefile | 6 +++++- 2000/thadgavin/README.md | 13 ++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/2000/thadgavin/Makefile b/2000/thadgavin/Makefile index 8ed8c5916..551244ba6 100644 --- a/2000/thadgavin/Makefile +++ b/2000/thadgavin/Makefile @@ -56,9 +56,13 @@ CSTD= -std=gnu99 # ARCH= +# variables for redefining the time to sleep, primarily for alt code +# +SLEEP= 30 +SDL_SLEEP= 150000 # Defines that are needed to compile # -CDEFINE= -DZ=30 -DZS=150000 +CDEFINE= -DZ=${SLEEP} -DZS=${SDL_SLEEP} # Include files that are needed to compile # diff --git a/2000/thadgavin/README.md b/2000/thadgavin/README.md index c27eaf4ed..748218453 100644 --- a/2000/thadgavin/README.md +++ b/2000/thadgavin/README.md @@ -37,8 +37,10 @@ You might also care to reconfigure the speed at which the programs run. The code calls `usleep(3)` with two default values, one for SDL and one for curses. The curses and SDL macros are defined respectively in the Makefile: -``` --DZ=30 -DZS=150000 +```make +SLEEP= 30 +SDL_SLEEP= 150000 +CDEFINE= -DZ=${SLEEP} -DZS=${SDL_SLEEP} ``` which corresponds to how long the program sleeps (in microseconds) between @@ -47,19 +49,20 @@ to the defaults as above so that you don't have to specify both just to configure one. To change the SDL one to something like `15000` you can do: ```sh -make CDEFINE="-DZS=15000" clobber alt +make SDL_SLEEP=15000 clobber alt ``` and to change the curses one to `40`: ```sh -make CDEFINE="-DZ=40" clobber alt +make SLEEP=40 clobber alt ``` Then use the program(s) in the same way. The different macros is because the curses version is already much slower and so -it's better to not tie the two values together. +it's better to not tie the two values together. You may of course combine them +in one command. ## Original code: From b8473b5b6a30a316fb9b7047a1153addee9a9a6f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:43:49 -0800 Subject: [PATCH 18/27] Improve how to redefine macros in 2001/kev Now one can do make clobber PORT=37337 SPEED=50 everything The l_ macro can also be redefined with the 'L' variable but this is not recommended especially if you don't know what you're doing so it's barely mentioned in the README.md file. --- 2001/kev/Makefile | 8 +++++++- 2001/kev/README.md | 11 ++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/2001/kev/Makefile b/2001/kev/Makefile index 4449ffbc6..ff6d6e312 100644 --- a/2001/kev/Makefile +++ b/2001/kev/Makefile @@ -57,9 +57,15 @@ CSTD= -std=gnu99 # ARCH= +# variables for the macros for easier redefining +# +PORT= 5455 +SPEED= 100 +L= "socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + # Defines that are needed to compile # -CDEFINE= -DPORT=5455 -DSPEED=100 -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" +CDEFINE= -DPORT=${PORT} -DSPEED=${SPEED} -Dl_=${L} # Include files that are needed to compile # diff --git a/2001/kev/README.md b/2001/kev/README.md index 98580b79f..de2ab8b34 100644 --- a/2001/kev/README.md +++ b/2001/kev/README.md @@ -42,23 +42,24 @@ If you need to change the speed you can reconfigure it like (say for over a network and not the same host): ```sh -make clobber CDEFINE="-DSPEED=50" all # original default value which is very fast +make clobber SPEED=50 all # original default value which is very fast ``` If you wish to change the port you can do so like: ```sh -make clobber CDEFINE="-DPORT=3773" all +make clobber PORT=3773 all ``` Of course if you want a port < 1024 you'll need to be root so don't do that. And if you know what you're doing you can redefine the call to the `socket(2)` -syscall with the `l_` macro. Of course you can do more than one at the same -time. For instance to change the speed and port: +syscall with the `l_` macro, changing the `L` variable like one would `PORT`. Of +course you can do more than one at the same time. For instance to change the +speed and port: ```sh -make clobber CDEFINE="-DSPEED=512 -DPORT=3773" all +make clobber SPEED=512 PORT=3773 all ``` If you have `xterm` try on one system: From c3fdf7c917cab4d27f13d5dd52a45b860f686cbf Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:49:18 -0800 Subject: [PATCH 19/27] Improve how to redefine macros in 2004/gavare Now one can do make clobber XX=640 YY=480 AA=3 alt or whatever, rather than the more awkward setting of CDEFINE. --- 2004/gavare/Makefile | 6 +++++- 2004/gavare/README.md | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/2004/gavare/Makefile b/2004/gavare/Makefile index 673fc7fd4..18fd65c94 100644 --- a/2004/gavare/Makefile +++ b/2004/gavare/Makefile @@ -56,9 +56,13 @@ CSTD= -std=gnu99 # ARCH= +# variables for the macros for easier redefining +XX= 1024 +YY= 768 +AA= 3 # Defines that are needed to compile # -CDEFINE= -DXX=1024 -DYY=768 -DAA=3 +CDEFINE= -DXX=${XX} -DYY=${YY} -DAA=${AA} # Include files that are needed to compile # diff --git a/2004/gavare/README.md b/2004/gavare/README.md index 21c046b6c..598d2da01 100644 --- a/2004/gavare/README.md +++ b/2004/gavare/README.md @@ -46,17 +46,17 @@ make alt To change the default size from 1024x768 try: ```sh -make clobber CDEFINE="-DXX=640 -DYY=480" alt +make clobber XX=640 YY=480 alt ``` You might also wish to change the anti-alias setting: ```sh -make clobber CDEFINE="-DAA=2" alt +make clobber AA=2 alt ``` -This is not possible with the author's version but it is with the Windows -version (see below). +This is not possible with the author's version but it is with the alt versions +(Windows - see below - and otherwise). As the Windows version will not compile on most viewers' systems we do not build it with `make alt`; instead try: From 209410fa83b336ac9f04d81b6aa2eac77ba6952b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:53:14 -0800 Subject: [PATCH 20/27] Improve how to redefine macro in 2004/jdalbec Now one can do make clobber Ag=47 alt to make the number of numbers on a single line 47 (of course at the same time as defeating the purpose :-) ). --- 2004/jdalbec/Makefile | 5 ++++- 2004/jdalbec/README.md | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/2004/jdalbec/Makefile b/2004/jdalbec/Makefile index 6758a837b..c3ffea978 100644 --- a/2004/jdalbec/Makefile +++ b/2004/jdalbec/Makefile @@ -56,9 +56,12 @@ CSTD= -ansi # ARCH= +# variable for redefining macro Ag +# +Ag= 11 # Defines that are needed to compile # -CDEFINE= -DAg=11 +CDEFINE= -DAg=${Ag} # Include files that are needed to compile # diff --git a/2004/jdalbec/README.md b/2004/jdalbec/README.md index 041f9f023..8ce367774 100644 --- a/2004/jdalbec/README.md +++ b/2004/jdalbec/README.md @@ -52,7 +52,7 @@ you wish to make it silver, 47 (a prime) protons, do: ```sh -make clobber CDEFINE="-DAg=47" alt +make clobber Ag=47 alt ``` though it might be odd to have 47 numbers on a line as it would defeat the @@ -60,7 +60,7 @@ purpose. :-) Or if you prefer some prime, golden irony: ```sh -make clobber CDEFINE="-DAg=79" alt +make clobber Ag=79 alt ``` From a6aa0332cd34c206eb55bc160f5f6480a5b70cce Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:03:34 -0800 Subject: [PATCH 21/27] Improve how to redefine macros in 2006/monge Now one can do make clobber WIDTH=500 HEIGHT=500 ITERATIONS=512 alt or whatever. --- 2006/monge/Makefile | 8 +++++++- 2006/monge/README.md | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/2006/monge/Makefile b/2006/monge/Makefile index 3b6fc5d4a..f1e5045bf 100644 --- a/2006/monge/Makefile +++ b/2006/monge/Makefile @@ -143,8 +143,14 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variables to help redefine width, height or iterations in alt version +# +WIDTH= 400 +HEIGHT= 300 +ITERATIONS= 128 + ${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -DW=${WIDTH} -DH=${HEIGHT} -DI=${ITERATIONS} $< -o $@ ${LDFLAGS} # data files # diff --git a/2006/monge/README.md b/2006/monge/README.md index 4fe28852b..8f2574df5 100644 --- a/2006/monge/README.md +++ b/2006/monge/README.md @@ -6,8 +6,8 @@ Make sure you have the SDL1 (not SDL2!) development environment installed. make ``` -There is alternate code that lets you redefine the width and height and number -of iterations to use. See [alternate code](#alternate-code) below. +There is alternate version that lets you redefine the width and height and number +of iterations to use. See [Alternate code](#alternate-code) below. ### Bugs and (Mis)features: @@ -67,13 +67,13 @@ of the variables `W`, `H` and `I`. The defaults are (respectively) 400, 300 and the same then do: ```sh -make clobber CDEFINE="-DW=500 -DH=500" alt +make clobber WIDTH=500 HEIGHT=500 alt ``` If you wish to keep the dimensions the same but change the iterations to 512: ```sh -make clobber CDEFINE="-DI=512" alt +make clobber ITERATIONS=512 alt ``` If you specify a value less than 1 for any of these it sets it back to the From faff15f900ddec61739f93b52836800098955280 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:07:28 -0800 Subject: [PATCH 22/27] Improve how to redefine sleep time in 2006/sloane Now one can do make clobber SLEEP=555 alt or whatever. --- 2006/sloane/Makefile | 5 ++++- 2006/sloane/README.md | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/2006/sloane/Makefile b/2006/sloane/Makefile index e60349445..bf4edcbbd 100644 --- a/2006/sloane/Makefile +++ b/2006/sloane/Makefile @@ -57,9 +57,12 @@ CSTD= -std=gnu99 # ARCH= +# variable to simplify redefining sleep duration for alt code +# +SLEEP= 75000 # Defines that are needed to compile # -CDEFINE= -DS=75000 +CDEFINE= -DS=${SLEEP} # Include files that are needed to compile # diff --git a/2006/sloane/README.md b/2006/sloane/README.md index 18d10b22e..751278624 100644 --- a/2006/sloane/README.md +++ b/2006/sloane/README.md @@ -24,7 +24,7 @@ value used in `usleep()`. The default is `-DS=75000` but you can easily change it. To do so try: ```sh -make CDEFINE="-DS=70000" clobber alt +make clobber SLEEP=70000 clobber alt ./sloane.alt ``` @@ -32,7 +32,7 @@ If you wish to make it like the original, as if the below [Original code](#original-code) was being used, you can do: ```sh -make CDEFINE="-DS=0" clobber alt +make SLEEP=0 clobber alt ./sloane.alt ``` From 05707864276f7c3da47cc077cd6151b587b624a7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:16:10 -0800 Subject: [PATCH 23/27] Update todo file There are still a few entries that need to be improved for the easier redefining of macros (usually for alt versions) via the Makefile but as this is tedious I have grown tired of it for the day. The thanks file for some of these might need to be updated as well. The todo file includes the entries modified today that have to be checked so this is not lost though not many have to be updated in this way. This is primarily for entries that this improves the build of the original entry too like 1998/banks. --- tmp/things-todo.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tmp/things-todo.md b/tmp/things-todo.md index 94a5dad0a..8df6dafbd 100644 --- a/tmp/things-todo.md +++ b/tmp/things-todo.md @@ -1,5 +1,5 @@ # A todo list of known things to check and/or do -*Last updated: Wed 06 Dec 2023 13:24:33 UTC* +*Last updated: Thu 07 Dec 2023 19:12:36 UTC* This document is primarily for [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) as he (that is I :-) ) wanted a way @@ -169,3 +169,32 @@ the rest of the entries are done, assuming that it's possible. - Although I will have to do this when another issue is opened up I am aware of some issues in 2020/ferguson1/.winner.json. I do not want to forget this, however, so I am noting it here. + +- Finish going through entries (Makefile and README.md files) that have the +ability to redefine macros but only in an awkward way like `make clobber +CDEFINE="-D.."`. To find entries that were done by me: `git grep -c 'CDEFINE' +'*README.md'` but the `2000/thadgavin` is already done. The reference to +`CDEFINE` might want to be removed but that can be decided when this is done +too. The entries done as of 7 Dec 2023 are: + - 2006/sloane + - 2006/monge + - 2004/jdalbec + - 2004/gavare + - 2001/kev + - 2000/thadgavin + - 1998/schweikh3 + - 1998/banks + - 1994/dodsond2 + - 1993/rince + - 1993/plummer + - 1993/cmills + - 1992/kivinen + - 1991/rince + - 1985/shapiro + - 1985/lycklama + ... and at least one of them needs to have the thanks file updated as it + helps with the original entry itself. This one is 1998/banks but there might + be more (and there is at least one not done yet that this will apply I + believe). + + From b9ed94d0a2be7741dc0bf12035a636ffd453f369 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:44:37 -0800 Subject: [PATCH 24/27] Add 2015/duble/try.sh + format/typo checks --- 2015/duble/README.md | 74 ++++++++++++++++++++++++++------------------ 2015/duble/try.sh | 38 +++++++++++++++++++++++ thanks-for-fixes.md | 5 +++ 3 files changed, 87 insertions(+), 30 deletions(-) create mode 100755 2015/duble/try.sh diff --git a/2015/duble/README.md b/2015/duble/README.md index 4de5be6f6..b21cb6656 100644 --- a/2015/duble/README.md +++ b/2015/duble/README.md @@ -4,6 +4,9 @@ make ``` +There is an alternate version of this entry, discussed in the author's remarks. +See [Alternate code](#alternate-code) below. + ## To use: @@ -15,36 +18,34 @@ echo Some text | ./prog ### Try: ```sh -echo Hello, world | ./prog - -DRAFT=1 ./prog < prog.c - -./prog -> [type] -(...observe...) - -./prog < prog.c +./try.sh ``` ## Alternate code: -An alternate version of this entry, prog.alt.c, is provided. This alternate -code is discussed below in the "prog.c vs prog.alt.c" section of the Author's -comments below. +This alternate code, provided by the author, is discussed in more detail by the +author in the 'prog.c vs prog.alt.c' section of their remarks. -To compile this alternate version: - make alt +### Alternate build: + +```sh +make alt +``` + + +### Alternate use: Use `prog.alt` as you would `prog` above. -### Selected Judges Remarks: + +### Judges' remarks: Beautiful penmanship! However, your fonts may vary. -How does this entry compress the font it uses? What's the purpose of lrand48()? -Why does the program dump core, when it does :) ? +How does this entry compress the font it uses? What's the purpose of +`lrand48(3)`? Why does the program dump core, when it does :) ? ## Author's remarks: @@ -54,13 +55,14 @@ Why does the program dump core, when it does :) ? This program **prints text in your terminal with an interesting hand-writing effect**. -It uses the *braille patterns* range of the unicode standard: this +It uses the *Braille patterns* range of the unicode standard: this allows to consider each terminal character as a tiny 2x4 bitmap. Turning the Braille code into something visual might be considered blasphemous. When I was fighting to make this program work, I started wondering if it was not the reason for its very erratic behaviour. + ### prog.c vs prog.alt.c The file `prog.alt.c` is the one I submitted. @@ -71,30 +73,36 @@ with other compilers or optimization levels). These have been fixed in `prog.c`. After this fix, in order to remain rule-2-compliant, a variable name has also been shortened in this file. + ### How to build If you have `clang`: - $ CC=clang make -e +```sh +CC=clang make -e +``` Otherwise (gcc): - $ make +```sh +make +``` (You will get a few warnings in this case.) + ### How to use it You need a terminal configured to handle a *UTF-8* encoding and a font including -*braille patterns*. +*Braille patterns*. This is the default on most modern GNU/Linux operating systems. The default terminal application (gnome-terminal) or even a simple xterm should render things properly. -I tested this on several Debian and Ubuntu systems, 32 and 64bits (no -configuration was needed). +I tested this on several Debian and Ubuntu systems, 32 and 64bits and no +configuration was needed. I also tested it on FreeBSD 9.3 32bits (font and encoding configuration was needed in this case). @@ -123,9 +131,9 @@ $ ./prog This entry is obfuscated in various ways: * The structure is hidden by avoiding loops, `if` statements, ternary -conditionals, and jump-related instructions. Instead, recursivity is heavily +conditionals, and jump-related instructions. Instead, recursion is heavily used. -* Merging all functions into one added even more recursivity. ;) +* Merging all functions into one added even more recursion. ;) * The provided code does not contain the same number of opening and closing parenthesis. * Preprocessing the code inflates it and adds lots of indents. Removing some @@ -144,8 +152,8 @@ On the other hand, the following may help: * The code layout should help to identify which part of the code is obfuscated. ;) -* File 'codes.txt' shows how each character is drawn. This data is encoded in -macro `O_o` at the top of the source file. +* File [codes.txt](codes.txt) shows how each character is drawn. This data is +encoded in macro `O_o` at the top of the source file. ### Limitations: @@ -160,23 +168,27 @@ 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 +the space and the linefeed (`\n`). Other chars are simply ignored (most of the time ;) + #### Stack size -This limitation is due to the heavy use of recursivity. After having processed a +This limitation is due to the heavy use of recursion. After having processed a large number of characters, the process may exceed the stack size and crash. (However I did not experience this myself. The top-level recursion might be removed by the compiler as part of its optimizations.) + #### Line rendering The program does its best to avoid cutting words at the end of lines, but it could still happen in case of long words. + ### Subtleties and extra features + #### Handling more than text docs? Given the limited set of characters handled, the program is mostly limited to @@ -185,12 +197,13 @@ simple text documents. Thus, if you try for example: ```sh -$ ./prog < prog.c\ +$ ./prog < prog.c ``` You will not get something that looks like C code. (but you can still try, if you are curious. :) + #### A 'draft' mode Defining an environment variable called DRAFT will enable the 'draft-mode'. @@ -202,6 +215,7 @@ $ echo 'testing the draft mode' | DRAFT=1 ./prog The program will run much faster but the rendering will be less precise. + #### The subtle interactive mode I saved the best for last: usually, programs that handle an "interactive mode" diff --git a/2015/duble/try.sh b/2015/duble/try.sh new file mode 100755 index 000000000..a6d75794a --- /dev/null +++ b/2015/duble/try.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2015/duble +# + +# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it +# this way allows us to have the user specify a different compiler in an easy +# way. +if [[ -z "$CC" ]]; then + CC="cc" +fi + +make CC="$CC" all >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear + +echo "$ echo \"Hello, world!\" | ./prog" 1>&2 +echo "Hello, world!" | ./prog + +echo "$ echo \"IOCCC 2015\" | ./prog" 1>&2 +echo "IOCCC 2015" | ./prog + +echo "$ DRAFT=1 ./prog < prog.c" 1>&2 +DRAFT=1 ./prog < prog.c + +echo "$ ./prog < prog.c" 1>&2 +./prog < prog.c + +echo "$ ./prog < lorem-ipsum.txt" 1>&2 +./prog < lorem-ipsum.txt + +echo "Type in text, hitting enter after each line." 1>&2 +echo "Watch the output each time and try again." 1>&2 +echo "Hit ctrl-c to exit." 1>&2 +echo 1>&2 +echo "$ ./prog" 1>&2 +./prog diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 1384a6c40..e42977782 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3786,6 +3786,11 @@ output. # 2015 +## [2015/duble](2015/duble/prog.c) ([README.md](2015/duble/README.md])) + +[Cody](#cody) added the [try.sh](2015/duble/try.sh) script. + + ## [2015/endoh3](2015/endoh3/prog.c) ([README.md](2015/endoh3/README.md])) [Cody](#cody) fixed this to compile with Linux which was having a problem with duplicate From ddf5746d4e84247df5acb3c6390f4526e9e1bcb7 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Thu, 7 Dec 2023 16:10:14 -0800 Subject: [PATCH 25/27] add note to 2014/maffiodo2 README.md about tooting --- 2014/maffiodo2/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/2014/maffiodo2/README.md b/2014/maffiodo2/README.md index be59bfd5b..c9ecb07cd 100644 --- a/2014/maffiodo2/README.md +++ b/2014/maffiodo2/README.md @@ -64,6 +64,14 @@ to social media that has a small size limit. Who will be the first to tweet this source? How many re-tweets will such tweet get? And how many people will really understand the tweet? +Judges' 2023 update: Last year we would have referred to a +[toot](https://en.wikipedia.org/wiki/Mastodon_\(social_network\)#Comparison_to_Twitter), +as in a [Mastodon](https://fosstodon.org/@ioccc) *toot*. +This year we might have mentioned the term +[publish](https://www.itechpost.com/articles/115087/20221116/mastodon-officially-replaced-toot-publish.htm) +although we remain fond of the +[historic Mastodon term, toot](https://gizmodo.com/mastodon-toot-retired-twitter-tweet-equivalent-1849786221). + ## Author's remarks: From 6805d14c807055a0bb9285cdb29b66d0be82c75f Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Thu, 7 Dec 2023 17:43:37 -0800 Subject: [PATCH 26/27] moved and improved thanks Moved thanks-for-fixes.md -> thanks-for-help.md References to thanks-for-help.md are referred to as just the _thanks file_. Updated links to reflect the above file change. Links to winner files in bugs.md now start with /. Updated the `/inc/sidenav.default.html` file to use an improved sidenav menu that includes a link to "How to enter the IOCCC". Fixed reference to FAQ entry regarding 'gets()' in `bugs.md`. Removed some trailing whitespace in `bugs.md`. Removed some trailing whitespace in `faq.md`. Fixed links into specific thanks file entries. Added more info to FAQ 0.0 "How may I submit to the IOCCC?". The temporary top level HTML files (contact.html, index.html, judges.html, news.html, winners.html, years.html) have a consistent set of links (w/o any bold links) that match the revised `/inc/sidenav.default.html` sidenav menu. These temporary top level HTML files are not yet being built and so they do not yet use the `inc/*.html` system. TODO: Turn contact.html, index.html, judges.html, news.html, winners.html, and years.html into markdown files that markdown to HTML tools will generate. NOTE: Trying to resolve a GitHub pull request conflict. *sigh* --- 1988/dale/README.md | 2 +- bugs.md | 54 +- contact.html | 20 +- faq.md | 45 +- inc/sidenav.default.html | 9 +- index.html | 23 +- judges.html | 20 +- news.html | 25 +- thanks-for-fixes.md => thanks-for-help.md | 1027 ++++++++++----------- winners.html | 20 +- years.html | 20 +- 11 files changed, 654 insertions(+), 611 deletions(-) rename thanks-for-fixes.md => thanks-for-help.md (75%) diff --git a/1988/dale/README.md b/1988/dale/README.md index 5eaa360de..41ada589c 100644 --- a/1988/dale/README.md +++ b/1988/dale/README.md @@ -44,7 +44,7 @@ make clobber alt ``` Use `dale.alt` as you would `dale` above. To understand the differences in more -detail, see [thanks-for-fixes.md](/thanks-for-fixes.md). +detail, see [thanks-for-help.md](/thanks-for-help.md). ## Judges' remarks: diff --git a/bugs.md b/bugs.md index 531f8670e..c3ebc8eb6 100644 --- a/bugs.md +++ b/bugs.md @@ -20,10 +20,11 @@ request](https://github.com/ioccc-src/temp-test-ioccc/pulls) (with ONE PULL REQUEST *PER* FIX, please)! We will be **happy to credit anyone who submits successful [GitHub pull -requests](https://github.com/ioccc-src/temp-test-ioccc/pulls)** in the [thanks -file](thanks-for-fixes.md). If you're a previous winner we will add a link to your winning -entries in the file (if you're not a previous winner we can add a link to your -GitHub page or personal website if you have one, should you wish). +requests](https://github.com/ioccc-src/temp-test-ioccc/pulls)** in the +[thanks](/thanks-for-help.md) file. If you're a previous winner we will +add a link to your winning entries in the file (if you're not a previous +winner we can add a link to your GitHub page or personal website if you +have one, should you wish). If you do fix an entry please feel free to delete the entry from this file! Otherwise if you wish to not worry about it we can do that to make sure the @@ -632,13 +633,14 @@ also have `abba` which the original code does not! Now notice how the `avnz` in the first line got changed to `niam`, its ROT13 value. Notice also how some of these are in comments! -`main()` is in there somewhere and that had to be changed to call `pain()` (see -the [entry in the thanks file](/thanks-for-fixes.md#1989westley-readmemd) for -details on how as this was not as straight forward as it is for other entries) -as well. Now if you notice on that line you have in a comment `niam`. If you -were to change that to `niap` (pain backwards) that function would end up as -`pain()` in generated code! That's assuming that it's just the reversal version, -of course but ver1 is the ROT13 version. +`main()` is in there somewhere and that had to be changed to call +`pain()` (see the [thanks](/thanks-for-help.md#1989_westley) +file (see the _1989/westley_ section for details on how as this was +not as straight forward as it is for other entries) as well. Now +if you notice on that line you have in a comment `niam`. If you +were to change that to `niap` (pain backwards) that function would +end up as `pain()` in generated code! That's assuming that it's +just the reversal version, of course but ver1 is the ROT13 version. These facts are bad enough but then you throw in the reverse of it without ROT13 and then another version that has the reversal _and_ ROT13 then you can see it's @@ -830,22 +832,21 @@ entry itself. Can you fix the actual entry? You are welcome to try and do so. ### STATUS: uses gets() - change to fgets() if possible ### Source code: [1992/gson/gson.c](1992/gson/gson.c) -### Information: [1992/gson/README.md])1992/gson/README.md_ +### Information: [1992/gson/README.md])(1992/gson/README.md) Cody changed it so that the buffer size is `ARG_MAX+1` to try and get past the problem of `gets()` being used in a more complex way. It would be ideal if it were to use `fgets()` though. This will probably be looked at later but you're welcome to try and fix this too! A tip on how -`gets()` is being used is in the [thanks-for-fixes.md](thanks-for-fixes.md) -file. +`gets()` is being used is in the [FAQ](/faq.md#gets) file. ## 1992 kivinen ### STATUS: known bug - please help us fix ### Source code: [1992/kivinen/kivinen.c](1992/kivinen/kivinen.c) -### Information: [1992/kivinen/README.md])1992/kivinen/README.md_ +### Information: [1992/kivinen/README.md](1992/kivinen/README.md) When you start the program everything starts to move over to the right side and then ends. [Yusuke Endoh](/winners.html#Yusuke_Endoh) pointed out that if you @@ -1122,7 +1123,7 @@ pit room you will end up dying even though you didn't explicitly move there. ### Information: [1994/ldb/README.md](1994/ldb/README.md) [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to compile -with modern systems (see the [thanks-for-fixes.md](thanks-for-fixes.md) file for +with modern systems (see the [thanks](/thanks-for-help.md) file for what had to change) but the entry also used `gets()` which in some systems would print out a warning along with the output of the program. Naturally it could also overflow long lines. Cody changed it to `fgets()` to prevent the display @@ -1575,7 +1576,7 @@ see that it does indeed crash! The reason for this not working is really strange. ```sh -$ echo "7 P 6 d P P 8 p" | ./dlowe +$ echo "7 P 6 d P P 8 p" | ./dlowe 7668 $ echo "7 P 6 d P P 8 p" | ./dlowe | grep 7 $ @@ -1613,7 +1614,7 @@ $ ``` Well this explains why the `tr` does not transliterate it to `poot` but why is -this happening? Why can't it be redirected to another file even? +this happening? Why can't it be redirected to another file even? If it could be figured out why it's not writing to stdout and yet at the same time is writing to stdout one bug could be fixed. Maybe it's the perl messing @@ -1700,7 +1701,7 @@ To not get 'unimplemented' you can remove from the perl: ```perl -sub AUTOLOAD { print"unimplemented\n"} +sub AUTOLOAD { print"unimplemented\n"} ``` (Note that the author stated this was used for exception handling so another @@ -1867,7 +1868,7 @@ explicitly stated that it requires i386 linux. There I found what should be a more portable version which is included as [otccelf.c](2001/bellard/otccelf.c) (after adding some `#include`s and the -modification by Yusuke noted in the [thanks-for-fixes.md](/thanks-for-fixes.md) +modification by Yusuke noted in the [thanks](/thanks-for-help.md) file) but it appears this *also* requires i386 linux; indeed looking at the code it hard codes paths that are i386 specific to linux. @@ -2009,7 +2010,7 @@ identified by `R`. Since the game never ends properly the score is not printed either. It appears that the crash happens in more than one place. For instance it has -happened at +happened at ```c XCheckMaskEvent(d, 4,&e) @@ -2028,7 +2029,7 @@ In both cases the pointer `d` was corrupted: (Display *) 0x0000000000000001 ``` -It is believed that it also happened at +It is believed that it also happened at ```c XDrawString(d,w,g,W/3,H/2,m,B); @@ -3239,9 +3240,10 @@ There was no IOCCC in 2023. We hope this document was of use to you in determining which entries are known to have a problem, what entries are known to have features that are not bugs and so on. We also thank you for going through this document and, if you propose any -[fixes](/thanks-for-fixes.md) via a [GitHub pull +fixes via a [GitHub pull request](https://github.com/ioccc-src/temp-test-ioccc/pulls) or otherwise, we thank you as well for the help! We will happily add you to the +[thanks](/thanks-for-help.md) file. There was no IOCCC in these years. @@ -3256,8 +3258,8 @@ completed. We hope this document was of use to you in determining which entries are known to have a problem, what entries are known to have features that are not bugs and -so on. We also thank you for going through this document and, if you propose any -[fixes](/thanks-for-fixes.md) via a [GitHub pull +so on. We also thank you for going through this document and, if you propose any +fixes] via a [GitHub pull request](https://github.com/ioccc-src/temp-test-ioccc/pulls) or otherwise, we thank you as well for the help! We will happily add you to the -[thanks-for-fixes.md](/thanks-for-fixes.md) file as well. +[thanks](/thanks-for-help.md) file as well. diff --git a/contact.html b/contact.html index 148be2d31..75e889332 100644 --- a/contact.html +++ b/contact.html @@ -13,18 +13,22 @@ Contest

-The judges | IOCCC home page | -FAQ | -How to enter | -Contacting the IOCCC +Winning entries | +People who have won +

+IOCCC News | +How to enter the IOCCC | +FAQ

Known Bugs & (Mis)features | -Thanks for the fixes +Fixing IOCCC winners | +Fixing the web site | +Fixing winner info | +Thanks for the help

-IOCCC news | -People who have won | -Winning entries +The judges | +Contacting the IOCCC

diff --git a/faq.md b/faq.md index e4ca2c7f7..697730cb3 100644 --- a/faq.md +++ b/faq.md @@ -1,7 +1,7 @@ # FAQ Table of Contents ## Section 0 - [Submitting entries to a new IOCCC](#faq0) -- [0.0 - How do I submit my entry to the IOCCC?](#faq0_0) +- [0.0 - How may I submit to the IOCCC?](#faq0_0) - [0.1 - What types of entries have been over-submitted to the IOCCC?](#faq0_1) - [0.2 - What should I put in my entry's Makefile?](#faq0_2) - [0.3 - May I use a different source or compiled filename than prog.c or prog?](#faq0_3) @@ -70,9 +70,11 @@ other inconsistencies with the original entry?](#faq4_3) ## Section 0: Submitting entries to a new IOCCC -### FAQ 0.0: How do I submit my entry to the IOCCC? +### FAQ 0.0: How may I submit to the IOCCC? -0. Verify that for submissions. +To submit your code to the IOCCC, you **MUST** follow these steps: + +0. Verify that the IOCCC is open for submissions Check the [status.json](status.json) URL and check the [IOCCC news](news.html#news) to @@ -81,16 +83,25 @@ see of the IOCCC is open. You may only register for the IOCCC and you may only submit your entries to the IOCCC when the IOCCC is **OPEN**. -1. Register for the IOCCC +1. Read the latest IOCCC rules and review the IOCCC guidelines + +Please read any pay close attention to the [official IOCCC rules](/rules.html). + +You are also **highly encouraged** to review the +[official IOCCC guidelines](/guidelines.html) as they contain important +suggestions, useful hints, and IOCCC humor. :-) + +2. Register for the IOCCC ``` XXX - instructions TBD - XXX ``` + Once you have been registered, you will receive an email message for how to prepare your entries for submission, and how to upload the compressed tarballs to our submission portal. -2. Obtain the latest mkiocccentry toolkit +3. Obtain the latest mkiocccentry toolkit If you do not have an mkiocccentry tool directory: @@ -108,13 +119,13 @@ git fetch git rebase ``` -3. Make the mkiocccentry toolkit +4. Make the mkiocccentry toolkit ```sh make clobber all ``` -4. Run the mkiocccentry tool to form your entry tarball +5. Run the mkiocccentry tool to form your entry tarball ```sh ./mkiocccentry work_dir prog.c Makefile remarks.md [file ...] @@ -138,7 +149,15 @@ remarks.md Remarks about your entry in markdown format NOTE: It is *NOT* necessary to install the tools to use them as you can run the tools from the top of the _mkiocccentry repo_ directory just fine. -5. upload your entry to the IOCCC submit server +If `mkiocccentry` tool indicates that there is a problem with your entry, +especially if it identifies a [rule 2](/rules.html#2) related problem, +you are **strongly** encouraged to revise and correct your entry and +then re-run the `mkiocccentry` tool. + +If you choose to risk of violating rules, be sure an explain your reason +for doing so in your _remarks.md_ file. + +6. upload your entry to the IOCCC submit server ``` XXX - instructions TBD - XXX @@ -764,7 +783,7 @@ for 64-bit systems. Many were fixed to work with modern systems but some are supposed to only work with 32-bit systems so any updated version of these entries should be an alternate version. -Other entries like [2001/herrmann2](/thanks-for-fixes.md#2001herrmann2-readmemd) +Other entries like [2001/herrmann2](/thanks-for-help.md#2001_herrmann2) now work with 32-bit AND 64-bit systems. Please see the [bugs.md](/bugs.md) file for the problematic entry in question to see if the problem is known, and if a fix is wanted, consider trying to port the code to a 64-bit system and submitting a pull request with that change. Pull requests that fix such code while trying to minimize the impact of any changes and preserving the spirit of the orignal code are very welcome! @@ -1231,7 +1250,7 @@ version like `winner.alt.c` or `prog.alt.c`. In fact it is advisable to look at the original code when reading the author's (and sometimes authors') remarks. -### FAQ 4.1: Why were some calls to the libc function `gets(3)` changed to use `fgets(3)`? +### FAQ 4.1: Why were some calls to the libc function `gets(3)` changed to use `fgets(3)`? Some may wonder: "Doesn't this tamper with the entry too much?" @@ -1441,7 +1460,7 @@ Note that just because you have a fix does not mean it'll be accepted. This might be because the author objects or it doesn't fit in some way or another. Of course if the entry does not work we'll certainly be more inclined to accept the fix. If it is accepted we'll be happy to credit you in the -[thanks](/thanks-for-fixes.md) file. If you're a previous winner we will happily +[thanks](/thanks-for-help.md) file. If you're a previous winner we will happily link to your entries; if you're not we can link to your website if you wish. See [FAQ 5.2](#faq5_2) for information on how to submit a fix to an IOCCC entry. @@ -1474,7 +1493,7 @@ files and we welcome these too! IOCCC winning entries are presented! In any event we will happily add you to the -[thanks-for-fixes.md](/thanks-for-fixes.md) file for your help! +[thanks](/thanks-for-help.md) file for your help! And of course, an IOCCC winner may update their own entries (metadata as well as source code and any extra files) by opening a @@ -1558,7 +1577,7 @@ When in doubt, consider opening up an [IOCCC issue](https://github.com/ioccc-src See [FAQ 5.3](#faq5_3) for information on opening up an IOCCC issue. -## FAQ 5.5: How may I correct or update IOCCC author information? +## FAQ 5.5: How may I correct or update IOCCC author information? Authors of IOCCC winning entries are kept in JSON files of the form: diff --git a/inc/sidenav.default.html b/inc/sidenav.default.html index c0cbc909a..90e52448e 100644 --- a/inc/sidenav.default.html +++ b/inc/sidenav.default.html @@ -12,17 +12,20 @@

+
+ The IOCCC Judges + Contacting the IOCCC
Jump to top diff --git a/index.html b/index.html index 046c0ec63..2f1449a7f 100644 --- a/index.html +++ b/index.html @@ -45,19 +45,22 @@ then consider making pull requests against the

-The judges | -IOCCC home page | -FAQ | -Contacting the IOCCC | -IOCCC news +IOCCC home page | +Winning entries | +People who have won +

+IOCCC News | +How to enter the IOCCC | +FAQ

Known Bugs & (Mis)features | -Thanks for the fixes | -IOCCC news | +Fixing IOCCC winners | +Fixing the web site | +Fixing winner info | +Thanks for the help

-IOCCC news | -People who have won | -Winning entries +The judges | +Contacting the IOCCC

diff --git a/judges.html b/judges.html index 7b108ee07..2ee5549dd 100644 --- a/judges.html +++ b/judges.html @@ -13,18 +13,22 @@ Contest

-The judges | IOCCC home page | -FAQ | -How to enter | -Contacting the IOCCC +Winning entries | +People who have won +

+IOCCC News | +How to enter the IOCCC | +FAQ

Known Bugs & (Mis)features | -Thanks for the fixes +Fixing IOCCC winners | +Fixing the web site | +Fixing winner info | +Thanks for the help

-IOCCC news | -People who have won | -Winning entries +The judges | +Contacting the IOCCC

diff --git a/news.html b/news.html index 5aa1b554d..ecc0020af 100644 --- a/news.html +++ b/news.html @@ -45,19 +45,22 @@ then consider making pull requests against the

-The judges | -IOCCC home page | -FAQ | -How to enter | -Contacting the IOCCC +IOCCC home page | +Winning entries | +People who have won +

+IOCCC News | +How to enter the IOCCC | +FAQ

Known Bugs & (Mis)features | -Thanks for the fixes | -IOCCC news +Fixing IOCCC winners | +Fixing the web site | +Fixing winner info | +Thanks for the help

-IOCCC news | -People who have won | -Winning entries +The judges | +Contacting the IOCCC

@@ -173,7 +176,7 @@ Mikkola (@Virtaava@home.social) we now maintain a In addition to the IOCCC-style easter egg, you may count on the JSON status page having a JSON member with name of "contest" that will have a value of either "closed" or "open". -When a future IOCCC is announced or the IOCCC is currently open, +When a future IOCCC is announced or the IOCCC is currently open, the JSON member with name of "contest" will change from "closed" to "open".

diff --git a/thanks-for-fixes.md b/thanks-for-help.md similarity index 75% rename from thanks-for-fixes.md rename to thanks-for-help.md index e42977782..e103a048b 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-help.md @@ -31,13 +31,13 @@ on a winner by winner basis. # 1984 -## [1984/anonymous](1984/anonymous/anonymous.c) ([README.md](1984/anonymous/README.md)) +## [1984/anonymous](/1984/anonymous/anonymous.c) ([README.md](/1984/anonymous/README.md)) [Cody](#cody) fixed this to work for macOS. -The problem was to do with the way that the `read(2)` function was redefined. +The problem was to do with the way that the `read(/2)` function was redefined. With macOS the second arg needs to be a `void *` and this also necessitated some -casts to `int` (on the second arg) in the call to `write(2)` (in `read()`). +casts to `int` (on the second arg) in the call to `write(/2)` (in `read()`). Later Cody corrected the mistake where the `"hello, world!"` string was on one line rather than two lines which the author told us (Landon) that they liked. @@ -45,16 +45,16 @@ Thus now it is like the original where the first line ends with `"hell\` and the second line starts with `o, world!\n"`. By request, the original code is provided as -[anonymous.alt.c](1984/anonymous/anonymous.alt.c) so that one can look at it and +[anonymous.alt.c](/1984/anonymous/anonymous.alt.c) so that one can look at it and the famous tattoo which we also include here: -![1984-anonymous-tattoo.jpg](1984/anonymous/1984-anonymous-tattoo.jpg) +![1984-anonymous-tattoo.jpg](/1984/anonymous/1984-anonymous-tattoo.jpg) ...which was done in 2005 by [Thomas Scovell](https://web.archive.org/web/20070120220721/https://thomasscovell.com/tattoo.php). -## [1984/decot](1984/decot/decot.c) ([README.md](1984/decot/README.md])) +## [1984/decot](/1984/decot/decot.c) ([README.md](/1984/decot/README.md])) [Cody](#cody) fixed this to not require `-traditional-cpp` which some compilers like clang do not support. Fixing `-traditional-cpp` is, as noted later on, very @@ -119,7 +119,7 @@ cd 1984/decot ; make diff_orig_prog ``` -## [1984/laman](1984/laman/laman.c) ([README.md](1984/laman/README.md])) +## [1984/laman](/1984/laman/laman.c) ([README.md](/1984/laman/README.md])) [Cody](#cody) fixed this to not crash when no arg is specified. Note that if the arg is not a positive number it will not do anything useful or anything at all. @@ -128,19 +128,19 @@ This was fixed on 30 October 2023 after the bug status was changed from INABIAF (it's not a bug it's a feature) to bug. -## [1984/mullender](1984/mullender/mullender.c) ([README.md](1984/mullender/README.md])) +## [1984/mullender](/1984/mullender/mullender.c) ([README.md](/1984/mullender/README.md])) -[Cody](#cody) provided an [alternate version](1984/mullender/mullender.alt.c), an +[Cody](#cody) provided an [alternate version](/1984/mullender/mullender.alt.c), an improved version of the judges, so that everyone can enjoy it with systems that are not VAX/PDP. We also refer you to the [FAQ](faq.md) as there are some winning entries that also let one enjoy it - with more to them of course! Cody further added the second alt version, -[mullender.alt2.c](1984/mullender/mullender.alt2.c) which is like the -[1984/mullender/mullender.alt.c](1984/mullender/mullender.alt.c) except that it +[mullender.alt2.c](/1984/mullender/mullender.alt2.c) which is like the +[1984/mullender/mullender.alt.c](/1984/mullender/mullender.alt.c) except that it starts over after it times out. -Cody also added the [gentab.c](1984/mullender/gentab.c) file, fixed to compile +Cody also added the [gentab.c](/1984/mullender/gentab.c) file, fixed to compile (and work, though see [bugs.md](#1984mullender-readmemd)) with modern systems and so that it would create the proper array (it had unbalanced '}'s), which the author noted in their remarks (which Cody also found). As this file uses the old @@ -153,7 +153,7 @@ Repo](https://github.com/dspinellis/unix-history-repo/tree/Research-Release). # 1985 -## [1985/applin](1985/applin/applin.c) ([README.md](1985/applin/README.md])) +## [1985/applin](/1985/applin/applin.c) ([README.md](/1985/applin/README.md])) Both [Cody](#cody) and [Yusuke](#yusuke) fixed this; Yusuke got this to not crash and Cody fixed it to work with macOS. @@ -177,7 +177,7 @@ why?) but to make it more friendly to users Cody made it print a `\n` prior to returning to the shell. The original version does not have this change. -## [1985/august](1985/august/august.c) ([README.md](1985/august/README.md)) +## [1985/august](/1985/august/august.c) ([README.md](/1985/august/README.md)) [Cody](#cody), out of abundance of caution, added a second arg to `main()` because some versions of clang object to the number of args of `main()`, saying that it must @@ -185,14 +185,14 @@ be 0, 2 or 3. The version this has been observed in does not actually object to 1 arg but it is entirely possible that this changes so a second arg (that's not needed and is unused) has been added just in case. -Cody also added the script [primes.sh](1985/august/primes.sh) which allows one +Cody also added the script [primes.sh](/1985/august/primes.sh) which allows one to check the output for the first N prime numbers of the output, where N is either the default or user specified. The inspiration was the previous 'try' command he gave to have fun with finding primes that might seem unusual in a way. -## [1985/lycklama](1985/lycklama/lycklama.c) ([README.md](1985/lycklama/README.md])) +## [1985/lycklama](/1985/lycklama/lycklama.c) ([README.md](/1985/lycklama/README.md])) [Cody](#cody) fixed this to compile with modern compilers. In the past one could get away with defining some macro to `#define` and then use `#foo` to have the same @@ -203,27 +203,27 @@ changed the `#o` lines to `#define`. Also `unistd.h` had to be `#include`d. that Cody added. See the README.md for details. -## [1985/shapiro](1985/shapiro/shapiro.c) ([README.md](1985/shapiro/README.md])) +## [1985/shapiro](/1985/shapiro/shapiro.c) ([README.md](/1985/shapiro/README.md])) [Cody](#cody) added the alt code which allows one to resize the maze and he also added -the [try.alt.sh](1985/shapiro/try.alt.sh) script that randomly selects sizes +the [try.alt.sh](/1985/shapiro/try.alt.sh) script that randomly selects sizes (five times) and compiles and runs it. After the five runs it prompts you to enter a number, in an infinite loop, exiting if any non-digits are in input (this includes negative numbers which in the code actually sets it back to 39, the default). -## [1985/sicherman](1985/sicherman/sicherman.c) ([README.md](1985/sicherman/README.md])) +## [1985/sicherman](/1985/sicherman/sicherman.c) ([README.md](/1985/sicherman/README.md])) [Cody](#cody) fixed this _very twisted entry_ to not require `-traditional-cpp`. Fixing `-traditional-cpp` is, as noted later on, very complicated, but Cody would like to refer you to the original file -[sicherman.orig.c](1985/sicherman/sicherman.orig.c) and he suggests that you -then compare it to [sicherman.c](1985/sicherman/sicherman.c) for some good old +[sicherman.orig.c](/1985/sicherman/sicherman.orig.c) and he suggests that you +then compare it to [sicherman.c](/1985/sicherman/sicherman.c) for some good old C-fashioned fun (alternatively, see below explanation)! Later on Cody improved the fix so that it looks much more like the [original -entry](1985/sicherman/sicherman.c). He did this several more times and it's +entry](/1985/sicherman/sicherman.c). He did this several more times and it's as close to the original as one can get without causing compiler errors. To get this to all work the following changes were made. If you really want to @@ -252,12 +252,12 @@ were actually not what they appear: the only arg that existed in `main()` was - The macros `C` and `V` were changed to lower case. This is because it felt like the `C=" ..`' part in `subr()` would be better to be upper case as it talks about the language. Also in the second [alternate -version](1985/sicherman/sicherman.alt2.c) (the first being the +version](/1985/sicherman/sicherman.alt2.c) (the first being the original code) which is in case a new version of clang ever objects to only one arg in `main()` (which is not out of the realm of possibility), `main()` can have `C` as `argc` to `main()` so it would read like it once did: `C manual` albeit with a `,` separating the two. The [second -alternate](1985/sicherman/sicherman.alt2.c) version is compiled +alternate](/1985/sicherman/sicherman.alt2.c) version is compiled in case the first does not. Originally the macros were kept the same and the `C` in `subr()` was `c`. It feels better (in some ways) to make it so that the `C` for the language is upper case though, and since it actually translated to @@ -322,12 +322,12 @@ case as `c`. # 1986 -## [1986/hague](1986/hague/hague.c) ([README.md](1986/hague/README.md])) +## [1986/hague](/1986/hague/hague.c) ([README.md](/1986/hague/README.md])) [Cody](#cody) made this use `fgets()`. -## [1986/holloway](1986/holloway/holloway.c) ([README.md](1986/holloway/README.md])) +## [1986/holloway](/1986/holloway/holloway.c) ([README.md](/1986/holloway/README.md])) [Cody](#cody) fixed this to compile and work with clang (it already worked with gcc). The problem was that clang is more strict about the type of second arg to @@ -337,7 +337,7 @@ and then using `t` instead of `s` it compiles and runs successfully under clang and gcc. -## [1986/marshall](1986/marshall/marshall.c) ([README.md](1986/marshall/README.md])) +## [1986/marshall](/1986/marshall/marshall.c) ([README.md](/1986/marshall/README.md])) [Cody](#cody) got this to compile and work with clang and gcc. He noted that he tried to keep the ASCII art as close to the original as possible. The line lengths are @@ -345,7 +345,7 @@ the same but some spaces had to be changed to non-spaces. This fix was very interesting and quite amusing, showing up problems with two different compilers. This is a brief summary but much more is explained in the -[compilers.md](1986/marshall/compilers.md) file, giving which compilers had +[compilers.md](/1986/marshall/compilers.md) file, giving which compilers had which problems in which systems: the optimiser being enabled in one compiler let it work but broke it in the other; and disabling it would let it work in the one that didn't work but suddenly the one that worked wouldn't work. And by 'not @@ -356,29 +356,29 @@ This problem was only after getting clang to compile, of course. It did not compile it because it is more strict about the second and third args to `main()` and the third arg was an `int`. -We encourage you to read the [compilers.md](1986/marshall/compilers.md) file to +We encourage you to read the [compilers.md](/1986/marshall/compilers.md) file to see how odd this problem was and what Cody did to fix it, if nothing else but for entertainment! -## [1986/pawka](1986/pawka/pawka.c) ([README.md](1986/pawka/README.md)) +## [1986/pawka](/1986/pawka/pawka.c) ([README.md](/1986/pawka/README.md)) [Cody](#cody) noticed and fixed a funny mistake in the Makefile where a `-Wno-strict-prototypes` was in the wrong location, suggesting that there is a `-D` needed to compile the entry. -## [1986/wall](1986/wall/wall.c) ([README.md](1986/wall/README.md])) +## [1986/wall](/1986/wall/wall.c) ([README.md](/1986/wall/README.md])) [Cody](#cody) fixed this so that it does not require `-traditional-cpp`. This took a fair bit of tinkering as this entry *very twisted*; fixing `-traditional-cpp` is, as noted earlier, very complicated, but we encourage you to look at [original -code](1986/wall/wall.orig.c) to see how different C was in 1986, as well as +code](/1986/wall/wall.orig.c) to see how different C was in 1986, as well as below. [Yusuke](#yusuke) originally patched this to use `strdup()` on two strings and this let it work with gcc but it still required `-traditional-cpp`. The [alternate -code](1986/wall/wall.alt.c) is the version patched by Yusuke should you wish to +code](/1986/wall/wall.alt.c) is the version patched by Yusuke should you wish to try it with a compiler that has the `-traditional-cpp`. See the README.md file for details. @@ -458,7 +458,7 @@ Some of the changes required: # 1987 -## [1987/heckbert](1987/heckbert/heckbert.c) ([README.md](1987/heckbert/README.md)) +## [1987/heckbert](/1987/heckbert/heckbert.c) ([README.md](/1987/heckbert/README.md)) [Cody](#cody) made this look more like the original entry by restoring the `#define` of `define`. It's not used but it now looks closer to the original. @@ -469,7 +469,7 @@ that for System V we had to do this) Cody added to the Makefile `-Dindex=strchr`. -## [1987/lievaart](1987/lievaart/lievaart.c) ([README.md](1987/lievaart/README.md)) +## [1987/lievaart](/1987/lievaart/lievaart.c) ([README.md](/1987/lievaart/README.md)) [Cody](#cody) added back the documented checks for invalid input which no longer worked and instead resulted in either accepting the level, whether or not it was a @@ -514,12 +514,12 @@ well (the one with the board and the one without, the entry itself with the size constraints of the contest). -## [1987/wall](1987/wall/wall.c) ([README.md](1987/wall/README.md])) +## [1987/wall](/1987/wall/wall.c) ([README.md](/1987/wall/README.md])) [Cody](#cody) made this use `fgets(3)`. -## [1987/westley](1987/westley/westley.c) ([README.md](1987/westley/README.md])) +## [1987/westley](/1987/westley/westley.c) ([README.md](/1987/westley/README.md])) [Cody](#cody) fixed this for modern systems. The problem was `'assignment to cast is illegal, lvalue casts are not supported'`. For the original file see the @@ -537,7 +537,7 @@ unlikely(?) but nevertheless suggested case that `putchar()` is not available. # 1988 -## [1988/dale](1988/dale/dale.c) ([README.md](1988/dale/README.md])) +## [1988/dale](/1988/dale/dale.c) ([README.md](/1988/dale/README.md])) [Cody](#cody) fixed this twisted entry (as we called it :-) ) for modern compilers, including making it no longer require `-traditional-cpp`. Fixing @@ -615,21 +615,21 @@ See the README.md file for details on the original code, provided as an alt version in case you have an older compiler or wish to try `-traditional-cpp`. -## [1988/isaak](1988/isaak/isaak.c) ([README.md](1988/isaak/README.md])) +## [1988/isaak](/1988/isaak/isaak.c) ([README.md](/1988/isaak/README.md])) [Cody](#cody) fixed this to work for modern systems. The problem was that the important function, a redefinition of `exit()`, was not being called in `main()`. The -original version is in [1988/isaak/isaak.alt.c](1988/isaak/isaak.alt.c). See the +original version is in [1988/isaak/isaak.alt.c](/1988/isaak/isaak.alt.c). See the README.md file for more details. -## [1988/litmaath](1988/litmaath/litmaath.c) ([README.md](1988/litmaath/README.md)) +## [1988/litmaath](/1988/litmaath/litmaath.c) ([README.md](/1988/litmaath/README.md)) [Cody](#cody) added the alt code which is code that we suggested at the time of publication, in the remarks, to help understand the entry, and for fun. -## [1988/phillipps](1988/phillipps/phillipps.c) ([README.md](1988/phillipps/README.md])) +## [1988/phillipps](/1988/phillipps/phillipps.c) ([README.md](/1988/phillipps/README.md])) [Cody](#cody) fixed this for modern systems. It did not compile with clang because it requires the second and third args of `main()` to be `char **` but even before @@ -648,14 +648,14 @@ same code. Additionally, `main()` returns `!pain(...)` like `main()` used to do to itself and `pain()` does now. -## [1988/reddy](1988/reddy/reddy.c) ([README.md](1988/reddy/README.md)) +## [1988/reddy](/1988/reddy/reddy.c) ([README.md](/1988/reddy/README.md)) [Cody](#cody) made this use `fgets(3)`. -## [1988/spinellis](1988/spinellis/spinellis.c) ([README.md](1988/spinellis/README.md])) +## [1988/spinellis](/1988/spinellis/spinellis.c) ([README.md](/1988/spinellis/README.md])) -[Cody](#cody) provided an [alternate version](1988/spinellis/spinellis.alt.c) so that +[Cody](#cody) provided an [alternate version](/1988/spinellis/spinellis.alt.c) so that this will work with compilers like clang. An alternate version had to be provided because not doing so would be tampering with the entry too much. It would work but it would not show the same creativity and cleverness. @@ -669,9 +669,9 @@ doing this) that with a slight modification this entry can be C++ instead. We do thank him for this ghastly point! :-) -## [1988/westley](1988/westley/westley.c) ([README.md](1988/westley/README.md])) +## [1988/westley](/1988/westley/westley.c) ([README.md](/1988/westley/README.md])) -The [original version](1988/westley/westley.alt.c), provided as alternate code, +The [original version](/1988/westley/westley.alt.c), provided as alternate code, was fixed by Misha Dynin, based on the judges' remarks, so that this would work with modern C compilers. We encourage you to try the alternate version to see what happens with current compilers! See the README.md files for details. @@ -679,7 +679,7 @@ what happens with current compilers! See the README.md files for details. [Cody](#cody) changed the `int`s to be `float` as that's what they are printed as: not strictly necessary but nonetheless more correct, even if not warned against. -Cody added the [try.sh](1988/westley/try.sh) script to show the magic of the +Cody added the [try.sh](/1988/westley/try.sh) script to show the magic of the entry as seeing the code with the result at once is far more beautiful. @@ -687,17 +687,17 @@ entry as seeing the code with the result at once is far more beautiful. # 1989 -## [1989/fubar](1989/fubar/fubar.c) ([README.md](1989/fubar/README.md])) +## [1989/fubar](/1989/fubar/fubar.c) ([README.md](/1989/fubar/README.md])) [Cody](#cody) got this to work with modern systems. The main issues were that an `#include` had to be added along with fixing the path (due to `.` not being in `$PATH`) to files referred to in the code. -## [1989/jar.1](1989/jar.1/jar.1.c) ([README.md](1989/jar.1/README.md])) +## [1989/jar.1](/1989/jar.1/jar.1.c) ([README.md](/1989/jar.1/README.md])) To prevent annoying output to `/dev/tty` we changed the code to simulate the -output via `strings(1)` but [Cody](#cody) removed the ill-famed `useless use of cat` to +output via `strings(/1)` but [Cody](#cody) removed the ill-famed `useless use of cat` to shut [ShellCheck](https://github.com/koalaman/shellcheck) up. Why is it ill-famed? Because there is no such thing as a useless cat, that's why! For instance, the fact they even exist is proof that @@ -711,7 +711,7 @@ anyway, and since one may still run the code or the script (for the original entry and the alt code) anyway, it works out well. -## [1989/jar.2](1989/jar.2/jar.2.c) ([README.md](1989/jar.2/README.md])) +## [1989/jar.2](/1989/jar.2/jar.2.c) ([README.md](/1989/jar.2/README.md])) [Cody](#cody) fixed this to work with modern compilers. Modern compilers do not allow code like: @@ -727,39 +727,39 @@ code like: He notes that there _is_ a way to get it (or something close to it) to work. Do you know how? -Cody also provided the [try.sh](1989/jar.2/try.sh) script and the -supplementary files [try.txt](1989/jar.2/try.txt), -[fib.lisp](1989/jar.2/fib.lisp) and -[chocolate_cake.lisp](1989/jar.2/chocolate_cake.lisp). The `try.txt` comes +Cody also provided the [try.sh](/1989/jar.2/try.sh) script and the +supplementary files [try.txt](/1989/jar.2/try.txt), +[fib.lisp](/1989/jar.2/fib.lisp) and +[chocolate_cake.lisp](/1989/jar.2/chocolate_cake.lisp). The `try.txt` comes from the author and the `fib.lisp` comes from [Yusuke](#yusuke). Cody wrote the script and offered us some chocolate cake :-) See README.md for details on how to use the script. -## [1989/ovdluhe](1989/ovdluhe/ovdluhe.c) ([README.md](1989/ovdluhe/README.md])) +## [1989/ovdluhe](/1989/ovdluhe/ovdluhe.c) ([README.md](/1989/ovdluhe/README.md])) [Cody](#cody) fixed an infinite loop where the program would print the same thing over and over again, flooding the screen. The problem is that there was a `for` loop that by necessity had to not have an increment stage but only in the `if` path (in the loop itself) did the pointer get updated. -Cody also provided an [alternate version](1989/ovdluhe/ovdluhe.alt.c) based on the +Cody also provided an [alternate version](/1989/ovdluhe/ovdluhe.alt.c) based on the author's remarks. See the README.md for details. The fix described above was fixed in this version too, after it was discovered and fixed. -## [1989/paul](1989/paul/paul.c) ([README.md](1989/paul/README.md])) +## [1989/paul](/1989/paul/paul.c) ([README.md](/1989/paul/README.md])) [Cody](#cody) fixed a segfault under macOS that prevented it from working. The problem was that the int (from `#define f`) should be a long. This became apparent when he was using lldb and saw that the type of a pointer was too `long` :-) -Cody also provided the [alternate version](1989/paul/paul.alt.c) +Cody also provided the [alternate version](/1989/paul/paul.alt.c) which has the trace function that the author included but commented out. See the README.md for details. -## [1989/robison](1989/robison/robison.c) ([README.md](1989/robison/README.md])) +## [1989/robison](/1989/robison/robison.c) ([README.md](/1989/robison/README.md])) [Yusuke Endoh](#yusuke) fixed this to compile under modern systems. To see the changes made, try: @@ -772,7 +772,7 @@ cd 1989/robison ; make diff_orig_prog (It adds the C token pasting operator `##` instead of `/**/`.) -## [1989/tromp](1989/tromp/tromp.c) ([README.md](1989/tromp/README.md])) +## [1989/tromp](/1989/tromp/tromp.c) ([README.md](/1989/tromp/README.md])) [Cody](#cody) and [Yusuke](#yusuke) fixed this entry: Yusuke fixed this to compile with gcc and Cody fixed it for clang and made some other fixes as well. @@ -801,7 +801,7 @@ IOCCC [Tetris](https://en.wikipedia.org/wiki/Tetris) working (this of course was not his only reason :-) ) -## [1989/westley](1989/westley/westley.c) ([README.md](1989/westley/README.md])) +## [1989/westley](/1989/westley/westley.c) ([README.md](/1989/westley/README.md])) [Cody](#cody) fixed this for clang, except that two versions generated by the program cannot be compiled by clang due to inherent defects in the compiler and how the @@ -862,10 +862,10 @@ in the working on version 2 and 3 or if in the fix for clang as well as version To make use of this several scripts were added by Cody. -The [compile.sh](1989/westley/compile.sh) script that removes the generated +The [compile.sh](/1989/westley/compile.sh) script that removes the generated code, rebuilds the program and regenerates the other code and then compiles it will work for compilers like gcc and one can then use the -[try.sh](1989/westley/try.sh) script to see example input and output. +[try.sh](/1989/westley/try.sh) script to see example input and output. The `compile.sh` script allows one to specify the compiler with the `CC` environmental variable; see the README.md for details. @@ -874,9 +874,9 @@ environmental variable; see the README.md for details. # 1990 -## [1990/baruch](1990/baruch/baruch.c) ([README.md](1990/baruch/README.md])) +## [1990/baruch](/1990/baruch/baruch.c) ([README.md](/1990/baruch/README.md])) -[Cody](#cody) added an [alternate version](1990/baruch/baruch.alt.c) which allows Turbo-C +[Cody](#cody) added an [alternate version](/1990/baruch/baruch.alt.c) which allows Turbo-C and MSC to compile this code, based on the authors' remarks, except that Cody did not change the `" #Q"` string as that showed worse looking output instead of improved output though he has no way to test the compilers in @@ -892,7 +892,7 @@ the variables, adding instead `-Wno-implicit-int`. The newline added by the judges was retained. -## [1990/cmills](1990/cmills/cmills.c) ([README.md](1990/cmills/README.md])) +## [1990/cmills](/1990/cmills/cmills.c) ([README.md](/1990/cmills/README.md])) [Yusuke](#yusuke) got this to work in modern systems (it previously resulted in a bus error). @@ -900,7 +900,7 @@ error). [Cody](#cody) made this use `fgets(3)`. -## [1990/dds](1990/dds/dds.c) ([README.md](1990/dds/README.md])) +## [1990/dds](/1990/dds/dds.c) ([README.md](/1990/dds/README.md])) [Yusuke](#yusuke) and [Cody](#cody) in conjunction fixed this for modern systems (both fixed a different compiler error but more fixes were also made). @@ -912,12 +912,12 @@ operator itself. Cody fixed another compiler error by removing the erroneous prototype to `fopen()`. Cody also changed a `char *` used for file I/O to be a proper `FILE -*` and fixed a typo in [LANDER.BAS](1990/dds/LANDER.BAS). +*` and fixed a typo in [LANDER.BAS](/1990/dds/LANDER.BAS). Cody also made this use `fgets(3)`. -## [1990/dg](1990/dg/dg.c) ([README.md](1990/dg/README.md])) +## [1990/dg](/1990/dg/dg.c) ([README.md](/1990/dg/README.md])) [Cody](#cody) fixed this for modern systems. There were two problems to be resolved. @@ -938,7 +938,7 @@ The second problem was suggested by the judges at the time of judging, to do with if the C preprocessor botches single quotes in cpp expansion. -## [1990/jaw](1990/jaw/jaw.c) ([README.md](1990/jaw/README.md])) +## [1990/jaw](/1990/jaw/jaw.c) ([README.md](/1990/jaw/README.md])) [Cody](#cody) fixed the script to work properly in modern environments including writing to and extracting from `stdout` and relying on the exit code in the commands to @@ -947,7 +947,7 @@ allow for `&& ...`. He also changed the `perror(3)` call to `fprintf(3)` because in macOS when errno is 0 it shows what looks like an error. -He added the [try.sh](1990/jaw/try.sh) to run the commands that we suggested at +He added the [try.sh](/1990/jaw/try.sh) to run the commands that we suggested at the time. NOTE: as `btoa` is not common we used a ruby script from [Yusuke](#yusuke) but with a minor @@ -955,20 +955,20 @@ fix applied by Cody that made the program just show `oops` twice from invalid input but which now works. -## [1990/pjr](1990/pjr/pjr.c) ([README.md](1990/pjr/README.md])) +## [1990/pjr](/1990/pjr/pjr.c) ([README.md](/1990/pjr/README.md])) -[Cody](#cody) added the [alt code](1990/pjr/pjr.alt.c) which was suggested by the judges +[Cody](#cody) added the [alt code](/1990/pjr/pjr.alt.c) which was suggested by the judges in the case that your compiler cannot compile `X=g()...` but it actually does something else and is recommended by the author as well. -## [1990/scjones](1990/scjones/scjones.c) ([README.md](1990/scjones/README.md])) +## [1990/scjones](/1990/scjones/scjones.c) ([README.md](/1990/scjones/README.md])) [Yusuke](#yusuke) suggested `-ansi` to get the entry to compile due to trigraphs and [Cody](#cody) suggested `-trigraphs`. Both work but we used Yusuke's idea. -## [1990/tbr](1990/tbr/tbr.c) ([README.md](1990/tbr/README.md])) +## [1990/tbr](/1990/tbr/tbr.c) ([README.md](/1990/tbr/README.md])) [Cody](#cody) fixed this to work with modern compilers; `exit(3)` returns void but the function was used in a binary expression so this wouldn't even compile. @@ -982,11 +982,11 @@ Additionally, Cody fixed the shortened version provided by the author in the same way as the original entry, first the compile fix and then later on making it look more like the original by redefining `exit` and also redefining `gets()` to be `fgets()` in the same way that the original entry is. This way the [alt -version](1990/tbr/README.md#alternate-code) is equivalent in function, like the +version](/1990/tbr/README.md#alternate-code) is equivalent in function, like the author intended, but more compact. -## [1990/theorem](1990/theorem/theorem.c) ([README.md](1990/theorem/README.md])) +## [1990/theorem](/1990/theorem/theorem.c) ([README.md](/1990/theorem/README.md])) [Cody](#cody) fixed this to compile with modern systems. @@ -1024,7 +1024,7 @@ used in order to get this to work initially (prior to this output was there but incomplete). -## [1990/stig](1990/stig/stig.c) ([README.md](1990/stig/README.md)) +## [1990/stig](/1990/stig/stig.c) ([README.md](/1990/stig/README.md)) [Cody](#cody) fixed the paths in the Makefile so that this would build in Linux (it worked fine in macOS). @@ -1033,11 +1033,11 @@ He also changed the Makefile to use `bash` not `zsh` as not all systems have `zsh` and the Makefile actually sets `SHELL` to `bash`. -## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md])) +## [1990/westley](/1990/westley/westley.c) ([README.md](/1990/westley/README.md])) [Cody](#cody) fixed this for modern systems. It had `1s` in places for a short int which was changed to just `1`. Since it's instructional to see the differences he has -provided an alternate version, [westley.alt.c](1990/westley/westley.alt.c), which +provided an alternate version, [westley.alt.c](/1990/westley/westley.alt.c), which is the original code. He also changed the `argc` to be an `int`, not a `char`, even though it might @@ -1053,9 +1053,9 @@ original code. # 1991 -## [1991/ant](1991/ant/ant.c) ([README.md](1991/ant/README.md])) +## [1991/ant](/1991/ant/ant.c) ([README.md](/1991/ant/README.md])) -[Cody](#cody) added [alt code](1991/ant/ant.alt.c) that will be a bit easier to use for +[Cody](#cody) added [alt code](/1991/ant/ant.alt.c) that will be a bit easier to use for those familiar with vim in the following ways: - Use `0` to go to first column. @@ -1068,7 +1068,7 @@ those familiar with vim in the following ways: The other keys were left unchanged. -## [1991/brnstnd](1991/brnstnd/brnstnd.c) ([README.md](1991/brnstnd/README.md])) +## [1991/brnstnd](/1991/brnstnd/brnstnd.c) ([README.md](/1991/brnstnd/README.md])) [Cody](#cody) fixed this for modern systems. There were two invalid operands to binary expression (`char *` and `void` and `int` and `void`) to resolve and @@ -1081,7 +1081,7 @@ Later on, Cody added back the macro `#define D define` to make it look ever so slightly more like the original, even though it's unused. -## [1991/buzzard](1991/buzzard/buzzard.c) ([README.md](1991/buzzard/README.md])) +## [1991/buzzard](/1991/buzzard/buzzard.c) ([README.md](/1991/buzzard/README.md])) [Cody](#cody) fixed this so that the coordinates being specified would not crash the program. This happened because the function that calls `atoi(3)` took an arg @@ -1092,13 +1092,13 @@ Cody also made the file name in the code (which is the default maze file) not hard-coded but instead be `__FILE__`. Finally Cody added the [alternate -version](1991/buzzard/README.md#alternate-code) which will possibly feel more at +version](/1991/buzzard/README.md#alternate-code) which will possibly feel more at home with those familiar with vi(m) (it certainly does feel more at home with him): `k` for forward, `h` for left and `l` for right. This version also has a more useful way to exit, just entering `q` followed by enter. -## [1991/davidguy](1991/davidguy/davidguy.c) ([README.md](1991/davidguy/README.md])) +## [1991/davidguy](/1991/davidguy/davidguy.c) ([README.md](/1991/davidguy/README.md])) As some systems like macOS can be particular about not declaring functions [Cody](#cody) added to the Makefile some `-include` options. These appear to not be strictly @@ -1106,7 +1106,7 @@ necessary but it was done due to other syscalls being a problem not being declared first. -## [1991/dds](1991/dds/dds.c) ([README.md](1991/dds/README.md])) +## [1991/dds](/1991/dds/dds.c) ([README.md](/1991/dds/README.md])) [Cody](#cody) fixed a segfault that prevented this entry from working in any condition and he also made it work for clang. He also added checks for NULL `FILE *`s. @@ -1235,7 +1235,7 @@ was pondered and changed numerous times and ultimately that problem with this entry was fixed. It has not been done in all. -## [1991/fine](1991/fine/fine.c) ([README.md](1991/fine/README.md)) +## [1991/fine](/1991/fine/fine.c) ([README.md](/1991/fine/README.md)) [Cody](#cody) made it look much more like the original entry even after the fix that increased the count in characters from 80 to 106, getting it back down to just @@ -1252,13 +1252,13 @@ which also resolved the warning described above. This was by more clever use of the Makefile which now has a `-DB=(int)b` so that `B` can be used in place where `(int)b` used to be necessary. -Cody also added the [try.sh](1991/fine/try.sh) script which feeds the program +Cody also added the [try.sh](/1991/fine/try.sh) script which feeds the program some fun input for fun but mostly different output. He added a great string from Brian Westley and Cody also added several of his own (can you figure out exactly which ones? :-) ) -## [1991/rince](1991/rince/rince.c) ([README.md](1991/rince/README.md)) +## [1991/rince](/1991/rince/rince.c) ([README.md](/1991/rince/README.md)) [Cody](#cody) fixed it so that the messages that show if you won or lost will be seen after the end of the game. The reason it did not work before is curses was ended @@ -1267,13 +1267,13 @@ original entry Cody left the message before ending curses in and printed another message of the same kind after `endwin()` was called with the exception that he added a newline at the end of the screen to be more user friendly. -Cody also added [two alt versions](1991/rince/README.md#alternate-code), one to +Cody also added [two alt versions](/1991/rince/README.md#alternate-code), one to remove the maximum number of moves you may make and another to let you configure the maximum number of moves, even if that is making it harder to win. Naturally the above fix was applied to these versions too. -## [1991/westley](1991/westley/westley.c) ([README.md](1991/westley/README.md])) +## [1991/westley](/1991/westley/westley.c) ([README.md](/1991/westley/README.md])) [Cody](#cody) fixed a segfault in this program which prevented it from working. The problem was that the read-only char array `char *z[]` was being written to. The @@ -1298,7 +1298,7 @@ should have been removed. # 1992 -## [1992/adrian](1992/adrian/adrian.c) ([README.md](1992/adrian/README.md])) +## [1992/adrian](/1992/adrian/adrian.c) ([README.md](/1992/adrian/README.md])) [Cody](#cody) fixed the code so that it will try opening the file the code was compiled from (`__FILE__`), not `adgrep.c`, as the latter does not exist: `adgrep` is @@ -1313,14 +1313,14 @@ was never fixed in any of the files, not the code or the documentation, and thus was entirely incorrect code. A fun fact is that one can do: ```c -W= fopen(wc>= 2 ? V[1] : __FILE__,"rt");if(!W)exit(1); +W= fopen(wc>= 2 ? V[1] : __FILE__,"rt");if(!W)exit(/1); ``` but one _CANNOT_ do: ```c -W= fopen(wc>= 2 ? V[1] : __FILE__,"rt");if(!W)exit(1); -if (W==NULL)exit(1); +W= fopen(wc>= 2 ? V[1] : __FILE__,"rt");if(!W)exit(/1); +if (W==NULL)exit(/1); ``` because `adwc.c` will be empty! The difference is it is on a newline, the check. @@ -1368,7 +1368,7 @@ These fixes are complex changes due to the way the program and Makefile generate the additional tools. -## [1992/albert](1992/albert/albert.c) ([README.md](1992/albert/README.md])) +## [1992/albert](/1992/albert/albert.c) ([README.md](/1992/albert/README.md])) [Cody](#cody) fixed this to compile with modern systems. Note that in 1996 a bug fix was applied to the code, provided as the alt code as that version is not obfuscated. @@ -1378,7 +1378,7 @@ is not the correct header file now (at least in some systems?) and a non-void return void. -## [1992/ant](1992/ant/ant.c) ([README.md](1992/ant/README.md])) +## [1992/ant](/1992/ant/ant.c) ([README.md](/1992/ant/README.md])) [Cody](#cody) fixed the Makefile so that the program will actually work with it (or at least the rule to clobber files and link `am` to `ant`). The issue was that the @@ -1397,18 +1397,18 @@ The author stated that in some systems like DOS with Turbo C, it might be necessary to include `time.h` so Cody did this as well. -## [1992/buzzard.1](1992/buzzard.1/buzzard.1.c) ([README.md](1992/buzzard.1/README.md)) +## [1992/buzzard.1](/1992/buzzard.1/buzzard.1.c) ([README.md](/1992/buzzard.1/README.md)) -[Cody](#cody) added a check for the right number of args, exiting 1 if not enough (2) +[Cody](#cody) added a check for the right number of args, exiting 1 if not enough (/2) used. This was not originally done but at a time it was changed to be considered a bug so it was fixed at that point as it only took a few seconds and had to be verified that it was consistent with the [bugs.md](/bugs.md) file. -He also added the [try.sh](1991/buzzard.1/try.sh) script to try out some +He also added the [try.sh](/1991/buzzard.1/try.sh) script to try out some commands that we suggested and some additional ones that provide for some fun. -## [1992/gson](1992/gson/gson.c) ([README.md](1992/gson/README.md])) +## [1992/gson](/1992/gson/gson.c) ([README.md](/1992/gson/README.md])) [Cody](#cody) fixed a crash that prevented this entry from working in some cases in some systems (like macOS) by disabling the optimiser in the Makefile. @@ -1427,28 +1427,28 @@ redirecting a dictionary file as part of the command line. This also makes it possible for longer strings to be read (in case the `gets(3)` was not used in a loop). -Cody also added the [mkdict.sh](1992/gson/mkdict.sh) script that the author +Cody also added the [mkdict.sh](/1992/gson/mkdict.sh) script that the author included in their remarks. See the README.md for its purpose. It was NOT fixed for [ShellCheck](https://github.com/koalaman/shellcheck) because the author deliberately obfuscated it so **PLEASE DO NOT FIX THIS**. -## [1992/imc](1992/imc/imc.c) ([README.md](1992/imc/README.md])) +## [1992/imc](/1992/imc/imc.c) ([README.md](/1992/imc/README.md])) -The original code, [imc.orig.c](1992/imc/imc.orig.c), assumed that `exit(3)` +The original code, [imc.orig.c](/1992/imc/imc.orig.c), assumed that `exit(3)` returned a value but this will cause problems where `exit(3)` returns void. The source code was modified to avoid this problem but like [Cody](#cody) did with other fixes he made this more like the original by redefining `exit` to use the comma operator so that it could be used in binary expressions. -## [1992/kivinen](1992/kivinen/kivinen.c) ([README.md](1992/kivinen/README.md])) +## [1992/kivinen](/1992/kivinen/kivinen.c) ([README.md](/1992/kivinen/README.md])) It was observed that on modern systems this goes much too quick. [Yusuke](#yusuke) created a patch that calls `usleep(3)` but [Cody](#cody) thought the value was too slow so he made it a macro in the Makefile `Z`, defaulting at 15000. This was made an [alt -version](1992/kivinen/kivinen.alt.c) and it is recommended one use the alt +version](/1992/kivinen/kivinen.alt.c) and it is recommended one use the alt version first. See the README.md file to see how to reconfigure it. Cody also made the fixed version (the code relied on `exit(3)` returning to use @@ -1468,7 +1468,7 @@ Yusuke also noted that there is a bug in the program where right after starting it moves towards the right but if you click the mouse it goes back. -## [1992/lush](1992/lush/lush.c) ([README.md](1992/lush/README.md])) +## [1992/lush](/1992/lush/lush.c) ([README.md](/1992/lush/README.md])) [Yusuke](#yusuke) supplied a patch which makes this work with gcc. Due to how it works (see Judges' remarks in the README.md file) this will not work with clang. @@ -1482,31 +1482,31 @@ NOTE: this entry cannot work with clang due to different compiler messages. See [bugs.md](/bugs.md) for details. -## [1992/marangon](1992/marangon/marangon.c) ([README.md](1992/marangon/README.md)) +## [1992/marangon](/1992/marangon/marangon.c) ([README.md](/1992/marangon/README.md)) [Cody](#cody) made this more portable by changing the `void main()` to be `int main()`. -## [1992/nathan](1992/nathan/nathan.c) ([README.md](1992/nathan/README.md)) +## [1992/nathan](/1992/nathan/nathan.c) ([README.md](/1992/nathan/README.md)) [Cody](#cody) added the original file back as it was deemed that the export restrictions should no longer be a cause of concern for this entry. Doing this did require a -change to Cody's [2020/ferguson2](2020/ferguson2/README.md) entry as it's +change to Cody's [2020/ferguson2](/2020/ferguson2/README.md) entry as it's referenced. Cody cynically noted that if he goes quiet, for instance if he no longer participates in the IOCCC, that it must be our fault! :-) -Cody also added the [try.sh](1992/nathan/try.sh) script that runs a few commands +Cody also added the [try.sh](/1992/nathan/try.sh) script that runs a few commands that we suggested as well as one he provided. -## [1992/vern](1992/vern/vern.c) ([README.md](1992/vern/README.md])) +## [1992/vern](/1992/vern/vern.c) ([README.md](/1992/vern/README.md])) [Cody](#cody) fixed an infinite loop if one were to input numbers < `0` or > `077`. The problem was that it tried to use `scanf(3)` with the format specifier `"%o %o"` in a loop, reading again if `scanf(3)` did not return 2 (that was not a problem in -that `scanf(2)` will not return until the number of specifiers have been +that `scanf(/2)` will not return until the number of specifiers have been processed or some error occurs) or a function it called returned non-zero. Instead the fix involves the `scanf(3)` specifiers being `"%4s %4s" on two @@ -1515,7 +1515,7 @@ new char arrays (always cleared in the beginning of the loop) and then using both numbers (using `"%o %o"` does not solve the problem). -## [1992/westley](1992/westley/westley.c) ([README.md](1992/westley/README.md])) +## [1992/westley](/1992/westley/westley.c) ([README.md](/1992/westley/README.md])) [Cody](#cody) fixed this to work for clang by changing the third and fourth arg of `main()` to be `char **` inside `main()`; clang requires args 2 - 4 to be `char @@ -1536,12 +1536,12 @@ the final loop it prints another newline. This fix has another bonus in that resizing the terminal after running it should not mess up the display either, unless of course it becomes too small. -Cody added the scripts [whereami.sh](1992/westley/whereami.sh) and -[whereami.alt.sh](1992/westley/whereami.alt.sh) which correspond to the entry and +Cody added the scripts [whereami.sh](/1992/westley/whereami.sh) and +[whereami.alt.sh](/1992/westley/whereami.alt.sh) which correspond to the entry and the alt code but first check that the number of columns is at least 80 and if not it is an error. -Cody added the [try.sh](1992/westley/try.sh) script that shows the different +Cody added the [try.sh](/1992/westley/try.sh) script that shows the different cities that the author recommended one try as well as the one recommended by the judges (approximate judging location), labelling each city and printing a newline before the next city. The try.sh script uses the `whereami.sh` and @@ -1551,18 +1551,18 @@ first tries to make it executable and if it fails to do so it just uses (or `COLUMNS=80 ./whereami.sh` etc.) but this is a feature, not a bug. Cody also added an arg check because the program and the -[alternate version](1992/westley/westley.alt.c) might have crashed or +[alternate version](/1992/westley/westley.alt.c) might have crashed or [nuked](https://en.wikipedia.org/wiki/Nuclear_weapon) the [entire world](https://en.wikipedia.org/wiki/Earth) or just the [USA](https://en.wikipedia.org/wiki/United_States), respectively, without enough -args (2). And not that we need the help or anything for this :-) but we +args (/2). And not that we need the help or anything for this :-) but we encourage you to try the original without two args :-) # 1993 -## [1993/cmills](1993/cmills/cmills.c) ([README.md](1993/cmills/README.md])) +## [1993/cmills](/1993/cmills/cmills.c) ([README.md](/1993/cmills/README.md])) [Yusuke](#yusuke) suggested that with modern systems this goes too fast so he added a call to `usleep(3)` in a patch he made. [Cody](#cody) made it configurable at compilation by @@ -1570,12 +1570,12 @@ using a macro. This is in the alt version which is the recommended one to try first. -## [1993/dgibson](1993/dgibson/dgibson.c) ([README.md](1993/dgibson/README.md])) +## [1993/dgibson](/1993/dgibson/dgibson.c) ([README.md](/1993/dgibson/README.md])) [Cody](#cody) fixed the script to work which assumed that `.` is in the path. -## [1993/jonth](1993/jonth/jonth.c) ([README.md](1993/jonth/README.md])) +## [1993/jonth](/1993/jonth/jonth.c) ([README.md](/1993/jonth/README.md])) Both [Cody](#cody) and [Yusuke](#yusuke) fixed this so that it will work with modern systems. Yusuke provided some fixes of the X code and Cody fixed the C pre-processor directives @@ -1591,32 +1591,32 @@ and expect `G;` to equate to `int i, j;` (though it's now a long) and `K` to mea prepended to them. -## [1993/leo](1993/leo/leo.c) ([README.md](1993/leo/README.md])) +## [1993/leo](/1993/leo/leo.c) ([README.md](/1993/leo/README.md])) [Cody](#cody) fixed this to work with modern compilers. This involved different header files for functions. -## [1993/lmfjyh](1993/lmfjyh/lmfjyh.c) ([README.md](1993/lmfjyh/README.md])) +## [1993/lmfjyh](/1993/lmfjyh/lmfjyh.c) ([README.md](/1993/lmfjyh/README.md])) -[Cody](#cody) added an [alternate version](1993/lmfjyh/lmfjyh.alt.c) which does what the +[Cody](#cody) added an [alternate version](/1993/lmfjyh/lmfjyh.alt.c) which does what the program did with gcc < 2.3.3. See the README.md file for details and for why this was made the alternate version, not the actual entry. -## [1993/plummer](1993/plummer/plummer.c) ([README.md](1993/plummer/README.md])) +## [1993/plummer](/1993/plummer/plummer.c) ([README.md](/1993/plummer/README.md])) [Cody](#cody) added check for two args. -Cody also added an [alternate version](1993/plummer/plummer.alt.c) which uses +Cody also added an [alternate version](/1993/plummer/plummer.alt.c) which uses `usleep()` so you can see what is happening with faster systems. This version also checks for two args. See the README.md files for details. -## [1993/rince](1993/rince/rince.c) ([README.md](1993/rince/README.md])) +## [1993/rince](/1993/rince/rince.c) ([README.md](/1993/rince/README.md])) [Yusuke](#yusuke) supplied a patch to get this to work in modern systems. This fix also -applies the compatibility issue of `select(2)` described in the README.md file. +applies the compatibility issue of `select(/2)` described in the README.md file. [Cody](#cody) added a call to `endwin()` to help with terminal sanity after the program ends. @@ -1628,12 +1628,12 @@ slow down but Cody did it in such a way that makes it easy to configure at compile time. See the README.md for details. -## [1993/schnitzi](1993/schnitzi/schnitzi.c) ([README.md](1993/schnitzi/README.md])) +## [1993/schnitzi](/1993/schnitzi/schnitzi.c) ([README.md](/1993/schnitzi/README.md])) [Cody](#cody) made this use `fgets(3)` not `gets(3)`. -## [1993/vanb](1993/vanb/vanb.c) ([README.md](1993/vanb/README.md])) +## [1993/vanb](/1993/vanb/vanb.c) ([README.md](/1993/vanb/README.md])) [Cody](#cody) fixed this to work with clang. The problem was that the third arg to main() was not a `char **`. Instead `O5()` (which was `main()` via `-DO5=main`) is now @@ -1665,7 +1665,7 @@ this code. Other code is also described there. # 1994 -## [1994/dodsond2](1994/dodsond2/dodsond2.c) ([README.md](1994/dodsond2/README.md)) +## [1994/dodsond2](/1994/dodsond2/dodsond2.c) ([README.md](/1994/dodsond2/README.md)) [Cody](#cody) fixed an infinite loop that could happen when you shoot an arrow and end up having no arrows, thus making one force quit the game. The problem @@ -1696,7 +1696,7 @@ counter for how many you have found and how many you shot in addition to the two that already existed, how many you had and how many were stolen. -## [1994/horton](1994/horton/horton.c) ([README.md](1994/horton/README.md)) +## [1994/horton](/1994/horton/horton.c) ([README.md](/1994/horton/README.md)) [Cody](#cody) fixed this to check that four args were specified. With the use of the C pre-processor macro and inclusion of stdlib.h in the Makefile the layout of the @@ -1708,14 +1708,14 @@ Cody also fixed the Makefile which was causing alt code to be compiled when it shouldn't be. -## [1994/ldb](1994/ldb/ldb.c) ([README.md](1994/ldb/README.md])) +## [1994/ldb](/1994/ldb/ldb.c) ([README.md](/1994/ldb/README.md])) [Cody](#cody) fixed this so it would compile and work with modern compilers. The problem was that `srand()` returns void but it was used in a `||` expression. Thus the comma operator was needed. Cody also fixed it for clang under Linux which objected to incompatible pointer -type (because `time(2)` takes a `time_t *` which in some systems is a `long *` +type (because `time(/2)` takes a `time_t *` which in some systems is a `long *` but what was being passed to it is an `int`). Cody also changed the entry to use `fgets(3)` instead of `gets(3)`. This one has @@ -1731,12 +1731,12 @@ program chooses that line it might print the first 231 characters or it might print (up to) the next 231 characters and so on. -## [1994/schnitzi](1994/schnitzi/schnitzi.c) ([README.md](1994/schnitzi/README.md])) +## [1994/schnitzi](/1994/schnitzi/schnitzi.c) ([README.md](/1994/schnitzi/README.md])) [Cody](#cody) added two alt versions, [one which uses -`fgets()`](1994/schnitzi/schnitzi.alt.c) but when fed its own source code cannot +`fgets()`](/1994/schnitzi/schnitzi.alt.c) but when fed its own source code cannot generate code that compile and another [one with a bigger buffer -size](1994/schnitzi/schnitzi.alt2.c) which, when fed its own source code, will +size](/1994/schnitzi/schnitzi.alt2.c) which, when fed its own source code, will generate compilable code but not with the same buffer size but rather the original buffer size. Cody explains this in the at [1994/schnitzi in bugs.md](/bugs.md#1994-schnitzi). @@ -1749,7 +1749,7 @@ details. Later on, if nobody takes up the task, Cody might resume it, but for now there is more important work to do so that the next contest can run. -## [1994/shapiro](1994/shapiro/shapiro.c) ([README.md](1994/shapiro/README.md])) +## [1994/shapiro](/1994/shapiro/shapiro.c) ([README.md](/1994/shapiro/README.md])) [Cody](#cody) fixed a bug on systems where `EOF != -1`. The problem is that `getc()` and the related functions do not return `-1` on EOF or error but rather `EOF`. @@ -1761,7 +1761,7 @@ For an interesting problem that occurred here and what was done to solve it, check the [bugs.md](bugs.md) file. -## [1994/tvr](1994/tvr/tvr.c) ([README.md](1994/tvr/README.md])) +## [1994/tvr](/1994/tvr/tvr.c) ([README.md](/1994/tvr/README.md])) [Cody](#cody) made this use `fgets(3)` instead of `gets(3)`. In this case the newline had to be terminated but it was a pretty straightforward fix. `gets()` was defined @@ -1771,17 +1771,17 @@ more like the original entry this was done in the Makefile. Note that the alt code does not use `fgets(3)` but rather `gets(3)`. -## [1994/weisberg](1994/weisberg/weisberg.c) ([README.md](1994/weisberg/README.md])) +## [1994/weisberg](/1994/weisberg/weisberg.c) ([README.md](/1994/weisberg/README.md])) [Cody](#cody) changed the Makefile to make this program more user friendly and easier to use with other tools as well by making the program output not a space after each number but rather a newline. -## [1994/westley](1994/westley/westley.c) ([README.md](1994/westley/README.md])) +## [1994/westley](/1994/westley/westley.c) ([README.md](/1994/westley/README.md])) [Cody](#cody) converted the spoiler compiler options (provided by the author) to be -compiler commands and added a script [spoiler.sh](1994/westley/spoiler.sh) to +compiler commands and added a script [spoiler.sh](/1994/westley/spoiler.sh) to automate the spoiler commands to make it easier to see the game in action from start to finish. @@ -1789,12 +1789,12 @@ start to finish. # 1995 -## [1995/cdua](1995/cdua/cdua.c) ([README.md](1995/cdua/README.md])) +## [1995/cdua](/1995/cdua/cdua.c) ([README.md](/1995/cdua/README.md])) [Cody](#cody) fixed this so that it would work with macOS. Once it could compile it additionally segfaulted under macOS which he also fixed. -Cody also provided the [Alternate code](1995/cdua/cdua.alt.c) for fun :-) ) (in +Cody also provided the [Alternate code](/1995/cdua/cdua.alt.c) for fun :-) ) (in particular to make it easier to see the program do what it does in systems that are too fast ... if there is such a thing anyway :-) ). See the README.md for details on this. @@ -1807,27 +1807,27 @@ an error but it's entirely possible that they will eventually make the defect function as the error message claims. -## [1995/dodsond1](1995/dodsond1/dodsond1.c) ([README.md](1995/dodsond1/README.md])) +## [1995/dodsond1](/1995/dodsond1/dodsond1.c) ([README.md](/1995/dodsond1/README.md])) -[Cody](#cody) added the [try.sh](1995/dodsond1/try.sh) script that uses the text file he +[Cody](#cody) added the [try.sh](/1995/dodsond1/try.sh) script that uses the text file he provided which is input we suggested one try with the entry. -## [1995/esde](1995/esde/esde.c) ([README.md](1995/esde/README.md])) +## [1995/esde](/1995/esde/esde.c) ([README.md](/1995/esde/README.md])) -[Cody](#cody) added the [try.sh](1995/esde/try.sh) script. +[Cody](#cody) added the [try.sh](/1995/esde/try.sh) script. -## [1995/garry](1995/garry/garry.c) ([README.md](1995/garry/README.md])) +## [1995/garry](/1995/garry/garry.c) ([README.md](/1995/garry/README.md])) [Cody](#cody) fixed the alt code so that it will compile with modern compilers. The problem was a missing `int` for the `f` variable. He felt it was even more important that it works because the layout does indeed look to him like a rat is dropping core :-), something that the judges suggested. -Cody also renamed `garry.test.sh` to [try.sh](1995/garrytry.sh) and improved it +Cody also renamed `garry.test.sh` to [try.sh](/1995/garrytry.sh) and improved it to to make sure the program is compiled before trying to use it and he also -added the [try.alt.sh](1995/garry/try.alt.sh) script to use the alt version, +added the [try.alt.sh](/1995/garry/try.alt.sh) script to use the alt version, though the alt version is not as important as alt code in other entries. The reason the alt script was added rather than using an environmental variable @@ -1836,13 +1836,13 @@ to specify which one to use is to make it easier on the user as typing running `./try.alt.sh`. -## [1995/leo](1995/leo/leo.c) ([README.md](1995/leo/README.md])) +## [1995/leo](/1995/leo/leo.c) ([README.md](/1995/leo/README.md])) At our change in how to deal with spoilers, [Cody](#cody) uudecoded the spoiler provided -by the author, putting it in [spoiler1.md](1995/leo/spoiler1.md). +by the author, putting it in [spoiler1.md](/1995/leo/spoiler1.md). -## [1995/makarios](1995/makarios/makarios.c) ([README.md](1995/makarios/README.md)) +## [1995/makarios](/1995/makarios/makarios.c) ([README.md](/1995/makarios/README.md)) [Cody](#cody) fixed this so that it will compile with versions of clang that has a defect which only allows `main()` to have 0, 2 or 3 args. This is done by a new @@ -1850,9 +1850,9 @@ function (`pain()` as it's annoying that clang is this way :-) ) that `main()` calls which has the four args. -## [1995/vanschnitz](1995/vanschnitz/vanschnitz.c) ([README.md](1995/vanschnitz/README.md)) +## [1995/vanschnitz](/1995/vanschnitz/vanschnitz.c) ([README.md](/1995/vanschnitz/README.md)) -[Cody](#cody) added the authors' [spoiler as a C file](1995/vanschnitz/spoiler.c) as in +[Cody](#cody) added the authors' [spoiler as a C file](/1995/vanschnitz/spoiler.c) as in 2023 we have decided that in most cases all the code should be available for the wider audience, without having to extract it. The exception is when the files are created by the entry or the entry decrypts the text or whatever else. @@ -1861,21 +1861,21 @@ are created by the entry or the entry decrypts the text or whatever else. # 1996 -## [1996/august](1996/august/august.c) ([README.md](1996/august/README.md])) +## [1996/august](/1996/august/august.c) ([README.md](/1996/august/README.md])) [Cody](#cody) fixed a segfault in this program that prevented it from working right and also fixed an infinite loop in the try commands. The problem with the infinite loop is that the file `august.oc` had to have lines starting with `#` removed -and it was not being done. After this is done with say `sed(1)` (like `sed -i'' +and it was not being done. After this is done with say `sed(/1)` (like `sed -i'' '/^#/d' august.oc` which has been added to both the remarks and the try.sh script as described below) the code can proceed. This problem existed in macOS. -Cody also added the [try.sh](1996/august/try.sh) script that runs all the +Cody also added the [try.sh](/1996/august/try.sh) script that runs all the commands given in the try section to simplify it as there are quite a lot of commands. -## [1996/dalbec](1996/dalbec/dalbec.c) ([README.md](1996/dalbec/README.md])) +## [1996/dalbec](/1996/dalbec/dalbec.c) ([README.md](/1996/dalbec/README.md])) [Cody](#cody) proposed a fix for this to compile with clang and Landon implemented it after some discussion (though Cody changed the function name). The reason Cody @@ -1892,9 +1892,9 @@ numbers on the same line. This was not put in an alternate version but perhaps it should be. -## [1996/eldby](1996/eldby/eldby.c) ([README.md](1996/eldby/README.md])) +## [1996/eldby](/1996/eldby/eldby.c) ([README.md](/1996/eldby/README.md])) -[Cody](#cody) provided an [alternate version](1996/eldby/eldby.alt.c) which uses +[Cody](#cody) provided an [alternate version](/1996/eldby/eldby.alt.c) which uses `usleep()` in between writing the output to make it easier to see what is going on with faster systems and importantly also for those who are sensitive to text flashing by rapidly (it affects him too but he also thinks it moves too fast @@ -1902,13 +1902,13 @@ nowadays anyway). We recommend that you try the alternate version first due to these reasons. -## [1996/gandalf](1996/gandalf/gandalf.c) ([README.md](1996/gandalf/README.md])) +## [1996/gandalf](/1996/gandalf/gandalf.c) ([README.md](/1996/gandalf/README.md])) [Cody](#cody) fixed this to compile and work with modern systems. As he loved the references in the code that could not compile he just commented out as little as possible to get this to compile. -Cody also added the rather useful [try.sh](1996/gandalf/try.sh) script to +Cody also added the rather useful [try.sh](/1996/gandalf/try.sh) script to really demonstrate the different ways of running the program ends up showing either different output or the same output that we briefly pointed out. @@ -1916,12 +1916,12 @@ BTW: it is perilous to try the patience of [Gandalf](https://www.glyphweb.com/arda/g/gandalf.html). Go ahead, try it! :-) -## [1996/huffman](1996/huffman/huffman.c) ([README.md](1996/huffman/README.md])) +## [1996/huffman](/1996/huffman/huffman.c) ([README.md](/1996/huffman/README.md])) -[Cody](#cody) added the [try.sh](1996/huffman/try.sh) script. +[Cody](#cody) added the [try.sh](/1996/huffman/try.sh) script. -## [1996/jonth](1996/jonth/jonth.c) ([README.md](1996/jonth/README.md])) +## [1996/jonth](/1996/jonth/jonth.c) ([README.md](/1996/jonth/README.md])) [Cody](#cody) fixed this to not segfault under macOS. The problem was that the function pointer `w`, which points to `XCreateWindow()`, did not specify the parameters of @@ -1930,7 +1930,7 @@ the function in the pointer assignment. NOTE: if there is no X server running this program will still crash. -## [1996/schweikh1](1996/schweikh1/schweikh1.c) ([README.md](1996/schweikh1/README.md])) +## [1996/schweikh1](/1996/schweikh1/schweikh1.c) ([README.md](/1996/schweikh1/README.md])) The author stated that `-I/usr/include` is needed by gcc in Solaris because `errno.h` has two identical extern declarations of `errno`. That leads to an @@ -1942,15 +1942,15 @@ the Makefile despite the fact that very few probably use Solaris nowadays. -## [1996/schweikh2](1996/schweikh2/schweikh2.c) ([README.md](1996/schweikh2/README.md])) +## [1996/schweikh2](/1996/schweikh2/schweikh2.c) ([README.md](/1996/schweikh2/README.md])) -[Cody](#cody) added the [try.sh](1996/schweikh2/try.sh) script with a few commands to try +[Cody](#cody) added the [try.sh](/1996/schweikh2/try.sh) script with a few commands to try along with a shorter version of something the author suggested one try (it is suggested that one try the longer version too but it will run in an infinite loop so having it in a script is less desired). -## [1996/westley](1996/westley/westley.c) ([README.md](1996/westley/README.md])) +## [1996/westley](/1996/westley/westley.c) ([README.md](/1996/westley/README.md])) [Cody](#cody) fixed a segfault in this entry as well as it displaying environmental variables. Although the scripts showed correct output, it somewhat lessened the @@ -1959,12 +1959,12 @@ interspersed with the output of the program. With the fix they no longer have this problem. If `argc < 5` (`argv[4]` is referenced) it will not do anything and it will not segfault either - this was caused by the body of the for() loop which is now empty (it doesn't appear to be needed at all at least modernly). -Note that you should check the [westley.alt.c](1996/westley/westley.alt.c) file +Note that you should check the [westley.alt.c](/1996/westley/westley.alt.c) file when reading the author's comments. To see how to use the original, see the README.md file. -Cody also added the two scripts, [try.sh](1996/westley/try.sh) and -[try.alt.sh](1996/westley/try.alt.sh) to show automate showing the different +Cody also added the two scripts, [try.sh](/1996/westley/try.sh) and +[try.alt.sh](/1996/westley/try.alt.sh) to show automate showing the different clocks, both with the fixed version and the original (alt) version. Also, to fix any potential problem with displaying in GitHub the scripts @@ -1977,17 +1977,17 @@ Later Cody made the entry look more like the original, removing the `argc` in # 1998 -## [1998/banks](1998/banks/banks.c) ([README.md](1998/banks/README.md])) +## [1998/banks](/1998/banks/banks.c) ([README.md](/1998/banks/README.md])) [Cody](#cody) set up the Makefile to have an alt build (using the same code) for those who do not have a page up or page down key and added the -[keysym.h](1998/banks/keysym.h) header file as a reference for other keys one +[keysym.h](/1998/banks/keysym.h) header file as a reference for other keys one can use if they wish to modify the controls. One can certainly do this even if they do have page up and page down but this gives a default for those who don't have them like with Macs. -## [1998/bas1](1998/bas1/bas1.c) ([README.md](1998/bas1/README.md])) +## [1998/bas1](/1998/bas1/bas1.c) ([README.md](/1998/bas1/README.md])) [Cody](#cody), out of an abundance of caution, added a second arg to `main()` as some versions of clang whine about the number of args on top of what type they are @@ -1997,19 +1997,19 @@ quite possible they will 'fix' this defect it would be better to have this not be a problem at such a time. -## [1998/bas2](1998/bas2/bas2.c) ([README.md](1998/bas2/README.md])) +## [1998/bas2](/1998/bas2/bas2.c) ([README.md](/1998/bas2/README.md])) -[Cody](#cody) added the [try.sh](1998/bas2/try.sh) script which runs some default actions +[Cody](#cody) added the [try.sh](/1998/bas2/try.sh) script which runs some default actions as well as allowing one to pass in different file names or strings. -## [1998/chaos](1998/chaos/chaos.c) ([README.md](1998/chaos/README.md])) +## [1998/chaos](/1998/chaos/chaos.c) ([README.md](/1998/chaos/README.md])) [Cody](#cody) added a call to `endwin()` to restore terminal sanity (echo etc.) when exiting the program (in both versions). -## [1998/df](1998/df/df.c) ([README.md](1998/df/README.md])) +## [1998/df](/1998/df/df.c) ([README.md](/1998/df/README.md])) [Cody](#cody) changed a `int *` used for `fopen(3)` to be a `FILE *` to be more correct and prevent any possible problems in some systems (which has happened). @@ -2020,33 +2020,33 @@ and by changing the typedef `lint` (to `int` - see the code for why this has to be done in modern systems) to be `_int`. -## [1998/dlowe](1998/dlowe/dlowe.c) ([README.md](1998/dlowe/README.md])) +## [1998/dlowe](/1998/dlowe/dlowe.c) ([README.md](/1998/dlowe/README.md])) [Cody](#cody) made the program more portable by changing the void return type of `main()` to be `int` (in both versions). -Cody added the scripts [try.sh](1998/dlowe/try.sh), -[pootify.sh](1998/dlowe/pootify.sh) and -[pootify.cgi.sh](1998/dlowe/pootify.cgi.sh) for a fun example use of the +Cody added the scripts [try.sh](/1998/dlowe/try.sh), +[pootify.sh](/1998/dlowe/pootify.sh) and +[pootify.cgi.sh](/1998/dlowe/pootify.cgi.sh) for a fun example use of the program, a local pootifier of web pages and a CGI pootifier. It should be noted that the CGI version might have an issue with modern systems; see [historical -remarks](1998/dlowe/README.md#historical-remarks) for more details on the +remarks](/1998/dlowe/README.md#historical-remarks) for more details on the pootify scripts. -## [1998/dloweneil](1998/dloweneil/dloweneil.c) ([README.md](1998/dloweneil/README.md])) +## [1998/dloweneil](/1998/dloweneil/dloweneil.c) ([README.md](/1998/dloweneil/README.md])) -[Cody](#cody) added [alt code](1998/dloweneil/dloweneil.alt.c) which has vi(m) movement +[Cody](#cody) added [alt code](/1998/dloweneil/dloweneil.alt.c) which has vi(m) movement (in addition to the other keys except for dropping it's not `d` but `j` or space) keys as well as allowing one to quit the game. -## [1998/dorssel](1998/dorssel/dorssel.c) ([README.md](1998/dorssel/README.md])) +## [1998/dorssel](/1998/dorssel/dorssel.c) ([README.md](/1998/dorssel/README.md])) -[Cody](#cody) added the [try.sh](1998/dorssel/try.sh) script. +[Cody](#cody) added the [try.sh](/1998/dorssel/try.sh) script. -## [1998/fanf](1998/fanf/fanf.c) ([README.md](1998/fanf/README.md)) +## [1998/fanf](/1998/fanf/fanf.c) ([README.md](/1998/fanf/README.md)) [Cody](#cody) fixed this to compile. The problem was the intermediate steps to get to the final code that is compiled. The code is now what it essentially becomes when @@ -2060,11 +2060,11 @@ possible though that this will change so it is fixed in case this happens. As it is mostly just through the C pre-processor Cody added a new macro to do translate to the rest of `main()`'s args. -Cody also added the [try.sh](1998/fanf/try.sh) script to show the output of some +Cody also added the [try.sh](/1998/fanf/try.sh) script to show the output of some of the expressions that we selected. -## [1998/schnitzi](1998/schnitzi/schnitzi.c) ([README.md](1998/schnitzi/README.md])) +## [1998/schnitzi](/1998/schnitzi/schnitzi.c) ([README.md](/1998/schnitzi/README.md])) [Cody](#cody) fixed invalid data types which prevented this entry from working, causing a segfault. This showed itself in two parts which required two fixes, one for @@ -2082,14 +2082,14 @@ doesn't crash. At this point since the author stated it has no `while`, doing: ```c -((V[1]&&((atoi(V[1])>0&&atoi(V[1])<27))||(exit(1),1))); +((V[1]&&((atoi(V[1])>0&&atoi(V[1])<27))||(exit(/1),1))); ``` -Cody also added the [try.sh](1998/schnitzi/try.sh) script to help users try the +Cody also added the [try.sh](/1998/schnitzi/try.sh) script to help users try the commands that we recommended as well as some added by him. -## [1998/schweikh1](1998/schweikh1/schweikh1.c) ([README.md](1998/schweikh1/README.md])) +## [1998/schweikh1](/1998/schweikh1/schweikh1.c) ([README.md](/1998/schweikh1/README.md])) [Cody](#cody) fixed this for modern systems (it did not work at all) and added an alternate version that works with macOS. Cody also made it ever so slightly more @@ -2098,7 +2098,7 @@ this not only lets it work with systems without `gcc` (though in macOS it does exist but is actually `clang`) as `cc` always should. Getting this entry to work was quite complicated but is also very interesting. -To see how the macOS fixes works, see the [macos.md](1998/schweikh1/macos.md) +To see how the macOS fixes works, see the [macos.md](/1998/schweikh1/macos.md) file but do note that this includes spoilers for both versions! The fixes to get it to work at all are described next. @@ -2144,10 +2144,10 @@ MACRO value` it will work, assuming that compiler can run, of course. Cody also added the perl script that the author provided that they used to compute the character count in the code according to the contest rules of 1998 -in the file [charcount.pl](1998/schweikh1/charcount.pl). +in the file [charcount.pl](/1998/schweikh1/charcount.pl). -## [1998/schweikh2](1998/schweikh2/schweikh2.c) ([README.md](1998/schweikh2/README.md])) +## [1998/schweikh2](/1998/schweikh2/schweikh2.c) ([README.md](/1998/schweikh2/README.md])) [Cody](#cody) fixed the code to not trigger an internal compiler error in gcc: @@ -2158,9 +2158,9 @@ in the file [charcount.pl](1998/schweikh1/charcount.pl). :12:19: internal compiler error: invalid built-in macro "__FILE__" ``` -The string `"01\015"` had to be changed to `ONE(O(1,1,2,6,0,6))`. For an +The string `"01\015"` had to be changed to `ONE(O(/1,1,2,6,0,6))`. For an interesting historical explanation and further details and fun, see the -[historical remarks](1998/schweikh2/README.md#historical-remarks) in the +[historical remarks](/1998/schweikh2/README.md#historical-remarks) in the README.md. Cody also added an `int` after `register` in `main()` in case clang decides to @@ -2168,9 +2168,9 @@ have a problem with that in the future which is not entirely out of the question. -## [1998/schweikh3](1998/schweikh3/schweikh3.c) ([README.md](1998/schweikh3/README.md])) +## [1998/schweikh3](/1998/schweikh3/schweikh3.c) ([README.md](/1998/schweikh3/README.md])) -[Cody](#cody) added the [alternate code](1998/schweikh3/README.md#alternate-code) which allows one +[Cody](#cody) added the [alternate code](/1998/schweikh3/README.md#alternate-code) which allows one to reconfigure the size constant in the rare case that the author wrote about occurs. @@ -2179,7 +2179,7 @@ of clang say that `main()` can only have 0, 2 or 3 args. These versions accept 1 arg but it is entirely possible that they fix this so this should prevent it from breaking if that happens. -Cody added the [try.sh](1998/schweikh3/try.sh) script to make it easier to try +Cody added the [try.sh](/1998/schweikh3/try.sh) script to make it easier to try the commands that we suggested. One command was not added, that of the to use command. @@ -2203,7 +2203,7 @@ There actually is a web page for the tool and this was added to the author information for the entry. It has not been added to any JSON file. -## [1998/tomtorfs](1998/tomtorfs/tomtorfs.c) ([README.md](1998/tomtorfs/README.md])) +## [1998/tomtorfs](/1998/tomtorfs/tomtorfs.c) ([README.md](/1998/tomtorfs/README.md])) [Cody](#cody) fixed the assumption that `EOF` is `-1` (the author noted that it assumes it is `-1` and it's indeed a valid concern as the standard only guarantees that @@ -2214,64 +2214,64 @@ the `EXIT_FAILURE` change was done by redefining `exit(3)` to be `exit(a) return EXIT_FAILURE` and `1` was passed to it (`return` was used because the original program had `return 1`). -Cody also added the [try.sh](1998/tomtorfs/try.sh) script to try out a few +Cody also added the [try.sh](/1998/tomtorfs/try.sh) script to try out a few commands that we recommended. # 2000 -## [2000/anderson](2000/anderson/anderson.c) ([README.md](2000/anderson/README.md])) +## [2000/anderson](/2000/anderson/anderson.c) ([README.md](/2000/anderson/README.md])) [Cody](#cody) changed this entry to use `fgets(3)` instead of `gets(3)`. This involved changing the `K` arg to `gets(3)` to `&K` in `fgets(3)`. -Cody also added the [try.sh](2000/anderson/try.sh) script. +Cody also added the [try.sh](/2000/anderson/try.sh) script. -## [2000/bmeyer](2000/bmeyer/bmeyer.c) ([README.md](2000/bmeyer/README.md])) +## [2000/bmeyer](/2000/bmeyer/bmeyer.c) ([README.md](/2000/bmeyer/README.md])) -[Cody](#cody) added the [try.sh](2000/bmeyer/try.sh) script with some improvements to the +[Cody](#cody) added the [try.sh](/2000/bmeyer/try.sh) script with some improvements to the commands we recommended like not assuming the number of columns one has in their terminal. -## [2000/briddlebane](2000/briddlebane/briddlebane.c) ([README.md](2000/briddlebane/README.md])) +## [2000/briddlebane](/2000/briddlebane/briddlebane.c) ([README.md](/2000/briddlebane/README.md])) [Cody](#cody) fixed this to compile in systems that require one to explicitly link in `libm`. -## [2000/dhyang](2000/dhyang/dhyang.c) ([README.md](2000/dhyang/README.md])) +## [2000/dhyang](/2000/dhyang/dhyang.c) ([README.md](/2000/dhyang/README.md])) [Cody](#cody) made this more portable by changing the `void main` to `int main`. -He also added the [try.sh](2000/dhyang/try.sh) script. +He also added the [try.sh](/2000/dhyang/try.sh) script. -## [2000/dlowe](2000/dlowe/dlowe.c) ([README.md](2000/dlowe/README.md])) +## [2000/dlowe](/2000/dlowe/dlowe.c) ([README.md](/2000/dlowe/README.md])) [Cody](#cody) fixed this to compile with more recent perl versions; the symbol that's now `PL_na` was once `na`. He notes that this entry crashes under macOS but it works under Linux after this change. -Cody also added the [try.sh](2000/dlowe/try.sh) script. +Cody also added the [try.sh](/2000/dlowe/try.sh) script. -## [2000/jarijyrki](2000/jarijyrki/jarijyrki.c) ([README.md](2000/jarijyrki/README.md])) +## [2000/jarijyrki](/2000/jarijyrki/jarijyrki.c) ([README.md](/2000/jarijyrki/README.md])) [Cody](#cody) made it easier to compile this in some cases by adding `X11/` to the includes of `Xlib.h` and `keysym.h`. -## [2000/natori](2000/natori/natori.c) ([README.md](2000/natori/README.md])) +## [2000/natori](/2000/natori/natori.c) ([README.md](/2000/natori/README.md])) [Cody](#cody) fixed this for modern compilers. Depending on the compiler it would either segfault when run or not compile at all (gcc and clang respectively). Cody also provided alternate code that supports the southern hemisphere. -Cody also provided the [try.sh](2000/natori/try.sh) script that shows the Moon +Cody also provided the [try.sh](/2000/natori/try.sh) script that shows the Moon phase in artistic ways. Later on Cody restored the `#include`s in the source code which had been changed @@ -2281,19 +2281,19 @@ itself a one-line like the code is in the original entry. Now it looks much more like the original entry but with the two fixes. -## [2000/primenum](2000/primenum/primenum.c) ([README.md](2000/primenum/README.md])) +## [2000/primenum](/2000/primenum/primenum.c) ([README.md](/2000/primenum/README.md])) [Cody](#cody) made this more portable by changing the `void main` to `int main`. -Cody also added the [try.sh](2000/primenum/try.sh) script. +Cody also added the [try.sh](/2000/primenum/try.sh) script. -## [2000/rince](2000/rince/rince.c) ([README.md](2000/rince/README.md])) +## [2000/rince](/2000/rince/rince.c) ([README.md](/2000/rince/README.md])) -[Cody](#cody) added the [try.sh](2000/rince/try.sh) script. +[Cody](#cody) added the [try.sh](/2000/rince/try.sh) script. -## [2000/robison](2000/robison/robison.c) ([README.md](2000/robison/README.md])) +## [2000/robison](/2000/robison/robison.c) ([README.md](/2000/robison/README.md])) [Cody](#cody) fixed an infinite loop that occurred if invalid input was entered, flooding the screen with: @@ -2307,7 +2307,7 @@ on it to assign to the `int`s, much like with `1987/lievaart`. The strings are `char[5]` and the `%` specifier is `%4s` which is enough for the game. -## [2000/thadgavin](2000/thadgavin/thadgavin.c) ([README.md](2000/thadgavin/README.md])) +## [2000/thadgavin](/2000/thadgavin/thadgavin.c) ([README.md](/2000/thadgavin/README.md])) [Cody](#cody) fixed the code and added an appropriate make rule so that the [SDL](https://www.libsdl.org) version works independent from the curses version @@ -2350,11 +2350,11 @@ the curses and the SDL versions as Cody does not have a DOS system to test the other version in. -## [2000/tomx](2000/tomx/tomx.c) ([README.md](2000/tomx/README.md])) +## [2000/tomx](/2000/tomx/tomx.c) ([README.md](/2000/tomx/README.md])) -[Cody](#cody) added the [alt code](2000/tomx/README.md#alternate-code) based on the +[Cody](#cody) added the [alt code](/2000/tomx/README.md#alternate-code) based on the author's remarks with a fix for modern systems and he also added the two -scripts, [try.sh](2000/tomx/try.sh) and [try.alt.sh](2000/tomx/try.alt.sh) for +scripts, [try.sh](/2000/tomx/try.sh) and [try.alt.sh](/2000/tomx/try.alt.sh) for the main code and the alt code respectively. And although the scripts do `chmod +x` on the source code (see the README.md for @@ -2364,7 +2364,7 @@ details) the source code is now executable by default. # 2001 -## [2001/anonymous](2001/anonymous/anonymous.c) ([README.md](2001/anonymous/README.md])) +## [2001/anonymous](/2001/anonymous/anonymous.c) ([README.md](/2001/anonymous/README.md])) [Cody](#cody) fixed both the supplementary program and the program itself (both of which segfaulted and once that was fixed only the binary was modified; it was not run @@ -2445,12 +2445,12 @@ Cody also added a [program](anonymous.bed.c) like [anonymous.ten.c](anonymous.te [Ten Green Bottles](https://en.wikipedia.org/wiki/Ten_Green_Bottles) but which sings [Ten in the Bed](https://allnurseryrhymes.com/ten-in-the-bed/) instead. -As well he added the [try.sh](2001/anonymous/try.sh) so that one can +As well he added the [try.sh](/2001/anonymous/try.sh) so that one can attempt to use the program as it was designed but if compiling as 32-bit fails it will at least run the supplementary program as a 64-bit program directly. -## [2001/bellard](2001/bellard/bellard.c) ([README.md](2001/bellard/README.md])) +## [2001/bellard](/2001/bellard/bellard.c) ([README.md](/2001/bellard/README.md])) [Cody](#cody) fixed this to compile with clang but according to the author this will not work without i386 Linux. It generates i386 32-bit code (not bytecode) but @@ -2466,7 +2466,7 @@ case of `main()` this was not possible. compilers besides what Cody did. Cody entirely fixed the [supplementary -bellard.otccex.c](2001/bellard/bellard.otccex.c) so it does not segfault and +bellard.otccex.c](/2001/bellard/bellard.otccex.c) so it does not segfault and works as well (it did not work at all). The main problem was that some ints were being used as pointers. This includes, for example, an int used as a `char *`, an int used as a function pointer and an int to access `argv` as well as there @@ -2496,7 +2496,7 @@ compiler that does not support this would not work. Thus we use the modification by Yusuke. -## [2001/cheong](2001/cheong/cheong.c) ([README.md](2001/cheong/README.md])) +## [2001/cheong](/2001/cheong/cheong.c) ([README.md](/2001/cheong/README.md])) [Cody](#cody) fixed this to work with clang by adding another function that is allowed to have a third arg as an int, not a `char **`. He chose `pain()` because it's a four @@ -2504,12 +2504,12 @@ letter word that would match the format and because it's pain that clang forces this. :-) This fix makes a point of the author's notes on portability no longer valid, BTW. -Cody also added the [try.sh](2001/cheong/try.sh) script. +Cody also added the [try.sh](/2001/cheong/try.sh) script. He also fixed it to check the number of args. -## [2001/coupard](2001/coupard/coupard.c) ([README.md](2001/coupard/README.md])) +## [2001/coupard](/2001/coupard/coupard.c) ([README.md](/2001/coupard/README.md])) [Cody](#cody) added a value to `return` in `main()` to make it more portable. @@ -2531,11 +2531,11 @@ This was not really worth a thanks per se but it was originally done by adding later on to make it more like the original. Yusuke provided a proper command line for macOS (to do with sound; see his -[/2013/endoh3/README.md](2013/endoh3/README.md) entry where he also refers to +[/2013/endoh3/README.md](/2013/endoh3/README.md) entry where he also refers to sound devices in macOS). -## [2001/ctk](2001/ctk/ctk.c) ([README.md](2001/ctk/README.md])) +## [2001/ctk](/2001/ctk/ctk.c) ([README.md](/2001/ctk/README.md])) The ANSI escape codes were no longer valid but [Yusuke](#yusuke) provided a patch to fix the ANSI escape codes. This works with both Linux and macOS. @@ -2545,11 +2545,11 @@ etc.) after exiting even if you don't press 'q', if you crash or if you kill the program prematurely. This was done by adding an explicit call to `e()` at the end of `main()`. -Cody also added the [alt code](2001/ctk/README.md#alternate-code) that adds +Cody also added the [alt code](/2001/ctk/README.md#alternate-code) that adds vi(m) movement keys. -## [2001/dgbeards](2001/dgbeards/dgbeards.c) ([README.md](2001/dgbeards/README.md])) +## [2001/dgbeards](/2001/dgbeards/dgbeards.c) ([README.md](/2001/dgbeards/README.md])) The author provided two changes: one to speed it up and one to make it not crash on losing. [Cody](#cody) provided an alternate version which does the former but he felt @@ -2560,17 +2560,17 @@ He also points out that there is a way to get the computer to automatically lose very quickly. Do you know what it is? -## [2001/herrmann1](2001/herrmann1/herrmann1.c) ([README.md](2001/herrmann1/README.md])) +## [2001/herrmann1](/2001/herrmann1/herrmann1.c) ([README.md](/2001/herrmann1/README.md])) [Cody](#cody) fixed this so that the when compiling the code the program is not executed itself by itself which just showed the usage string and exited. The [script -herrmann1.sh](2001/herrmann1/herrmann1.sh) is used to compile the program but +herrmann1.sh](/2001/herrmann1/herrmann1.sh) is used to compile the program but it's also how you invoke the program. -Cody provided the file [plus1.turing](2001/herrmann1/plus1.turing) based on the +Cody provided the file [plus1.turing](/2001/herrmann1/plus1.turing) based on the author's remarks. -He also fixed the [script herrmann1.sh](2001/herrmann1/herrmann1.sh) for +He also fixed the [script herrmann1.sh](/2001/herrmann1/herrmann1.sh) for shellcheck. In particular there were quite a few: @@ -2582,7 +2582,7 @@ SC2248 (style): Prefer double quoting even when variables don't contain special errors/warnings. -## [2001/herrmann2](2001/herrmann2/herrmann2.c) ([README.md](2001/herrmann2/README.md])) +## [2001/herrmann2](/2001/herrmann2/herrmann2.c) ([README.md](/2001/herrmann2/README.md])) [Cody](#cody) fixed this to work with both 64-bit and 32-bit compilers by changing most of the `int`s (all but that in `main(int ...)`) to `long`s. He also fixed it to @@ -2590,20 +2590,20 @@ compile with clang by changing the args of main to be `int` and `char **`, respectively, and changing specific references to the `argv` arg, casting to `long` (was `int` but the 64-bit fix requires `long`) which was its old type. -Cody also added the [try.sh](2001/herrmann2/try.sh) script which might be more +Cody also added the [try.sh](/2001/herrmann2/try.sh) script which might be more useful than any other place as the command to try is quite long with C code. For some reason the original code was missing (presumingly because it had been added to `.gitignore` by accident) but Cody restored it from the archive. -## [2001/kev](2001/kev/kev.c) ([README.md](2001/kev/README.md])) +## [2001/kev](/2001/kev/kev.c) ([README.md](/2001/kev/README.md])) [Cody](#cody) slowed down the ball just a tad (it was already a `-D` macro that was used in the code) as it went too fast for the speed at which the paddles move even when holding down the movement keys (but see below). -Cody also provided an [alternate version](2001/kev/kev.alt.c) which lets you use +Cody also provided an [alternate version](/2001/kev/kev.alt.c) which lets you use the arrow keys on your keyboard instead of the more awkward '`,`' and '`.`'. He updated both versions to have `#ifndef..#endif` pairs for the macros so one @@ -2613,21 +2613,21 @@ line as 50 is what it used to be set to. This way it's more to the original but without having to sacrifice playability by running `make`. -## [2001/ollinger](2001/ollinger/ollinger.c) ([README.md](2001/ollinger/README.md)) +## [2001/ollinger](/2001/ollinger/ollinger.c) ([README.md](/2001/ollinger/README.md)) [Cody](#cody) fixed to not crash if not enough args, exiting 1 instead. -## [2001/schweikh](2001/schweikh/schweikh.c) ([README.md](2001/schweikh/README.md])) +## [2001/schweikh](/2001/schweikh/schweikh.c) ([README.md](/2001/schweikh/README.md])) [Cody](#cody) fixed this to not crash if not enough args as this was not documented by the author. The other problems are documented so were not fixed. See README.md for details. -Cody also added the [try.sh](2001/schweikh/try.sh) script. +Cody also added the [try.sh](/2001/schweikh/try.sh) script. -## [2001/westley](2001/westley/westley.c) ([README.md](2001/westley/README.md])) +## [2001/westley](/2001/westley/westley.c) ([README.md](/2001/westley/README.md])) [Cody](#cody) added the script [try.sh](try.sh) to automate a heap of commands that we, the IOCCC judges, suggested, as well as some additional ones that he @@ -2638,15 +2638,15 @@ described in the README.md, based on the author's remarks. # 2004 -## [2004/arachnid](2004/arachnid/arachnid.c) ([README.md](2004/arachnid/README.md])) +## [2004/arachnid](/2004/arachnid/arachnid.c) ([README.md](/2004/arachnid/README.md])) -[Cody](#cody) added an [alternate version](2004/arachnid/README.md#alternate-code) which +[Cody](#cody) added an [alternate version](/2004/arachnid/README.md#alternate-code) which allows those like himself used to `h`, `j`, `k` and `l` movement keys to not get lost. Non rogue players, vi users and Dvorak typists are invited to get lost (or use the original version)! :-) -## [2004/burley](2004/burley/burley.c) ([README.md](2004/burley/README.md])) +## [2004/burley](/2004/burley/burley.c) ([README.md](/2004/burley/README.md])) [Cody](#cody) fixed this to compile with clang and also fixed it to work. @@ -2675,36 +2675,36 @@ Finally the optimiser cannot be enabled so the compiler flags were changed for this. -## [2004/gavare](2004/gavare/gavare.c) ([README.md](2004/gavare/README.md])) +## [2004/gavare](/2004/gavare/gavare.c) ([README.md](/2004/gavare/README.md])) [Cody](#cody) added three different [alternate -versions](2004/gavare/README.md#alternate-code): +versions](/2004/gavare/README.md#alternate-code): -- [gavare.alt.c](2004/gavare/gavare.alt.c) allows you to change the image size +- [gavare.alt.c](/2004/gavare/gavare.alt.c) allows you to change the image size and anti-alias setting at compile time. -- [gavare.alt2.c](2004/gavare/gavare.alt2.c) is like -[gavare.alt.c](2004/gavare/gavare.alt.c) but it should work for Windows as well +- [gavare.alt2.c](/2004/gavare/gavare.alt2.c) is like +[gavare.alt.c](/2004/gavare/gavare.alt.c) but it should work for Windows as well (it sets binary mode on `stdout`). -- [gavare.r3.c](2004/gavare/gavare.r3.c) is the author's unobfuscated version +- [gavare.r3.c](/2004/gavare/gavare.r3.c) is the author's unobfuscated version that was used during development, found on their [website about the entry](https://gavare.se/ioccc/ioccc_gavare.c.html). -## [2004/gavin](2004/gavin/gavin.c) ([README.md](2004/gavin/README.md])) +## [2004/gavin](/2004/gavin/gavin.c) ([README.md](/2004/gavin/README.md])) [Yusuke](#yusuke) provided the `kernel` and `fs.tar` files which can be used if you cannot normally use this entry. Instead of generating the files just use the files -provided, found under the [img/](2004/gavin/img/) directory. Note that the +provided, found under the [img/](/2004/gavin/img/) directory. Note that the `img/fs.tar` extracts into `fs/` so you will have to fix the tarball; this is done this way to prevent extraction from the entry directory overwriting the files and causing `make clobber` to wipe some of them out. -Cody provided the [alt code](2004/gavin/README.md#alternate-code) for those who +Cody provided the [alt code](/2004/gavin/README.md#alternate-code) for those who want to use QEMU. The most important part of this is the macro `K` has to be defined as `1`, not `0`. -## [2004/jdalbec](2004/jdalbec/jdalbec.c) ([README.md](2004/jdalbec/README.md)) +## [2004/jdalbec](/2004/jdalbec/jdalbec.c) ([README.md](/2004/jdalbec/README.md)) [Cody](#cody) fixed this to compile with gcc (it worked with clang). The problem was the cpp being unable to parse the generated code (see the README.md for details) and @@ -2730,16 +2730,16 @@ jdalbec.c:65:5: error: expected ';' before 'B' and various other problems. -Cody also added [alt code](2004/jdalbec/README.md#alternate-code) which allows +Cody also added [alt code](/2004/jdalbec/README.md#alternate-code) which allows one to control how many numbers after the `:` to print before printing a newline, so that one can see the output a bit better (though for lines that have a lot of numbers this will be harder to see). -Finally Cody added [try.sh](2004/jdalbec/try.sh) and -[try.alt.sh](2004/jdalbec/try.alt.sh) to demonstrate both versions. +Finally Cody added [try.sh](/2004/jdalbec/try.sh) and +[try.alt.sh](/2004/jdalbec/try.alt.sh) to demonstrate both versions. -## [2004/kopczynski](2004/kopczynski/kopczynski.c) ([README.md](2004/kopczynski/README.md])) +## [2004/kopczynski](/2004/kopczynski/kopczynski.c) ([README.md](/2004/kopczynski/README.md])) [Cody](#cody) reported that this entry cannot be optimised by the compiler as otherwise it will not work. @@ -2748,19 +2748,19 @@ Cody, out of an abundance of caution for clang, added a second arg to `main()` as some versions complain about the number of args and although they accept 1 it is entirely possible it will eventually be that they don't. -Cody also added the [try.sh](2004/kopczynski/try.sh) script and various data +Cody also added the [try.sh](/2004/kopczynski/try.sh) script and various data files: [kopczynski-a](kopczynski-a) to demonstrate what happens when art more like a letter is fed to the program and the `kopczynski*-rev` files which are -the data files reversed with `rev(1)`. One had to be modified additionally to +the data files reversed with `rev(/1)`. One had to be modified additionally to get it to work, that being `kopczynski-10-rev`. -## [2004/newbern](2004/newbern/newbern.c) ([README.md](2004/newbern/README.md])) +## [2004/newbern](/2004/newbern/newbern.c) ([README.md](/2004/newbern/README.md])) [Cody](#cody) and Landon individually fixed this to work with clang. -## [2004/schnitzi](2004/schnitzi/schnitzi.c) ([README.md](2004/schnitzi/README.md])) +## [2004/schnitzi](/2004/schnitzi/schnitzi.c) ([README.md](/2004/schnitzi/README.md])) [Cody](#cody) made this use `fgets(3)`. @@ -2769,12 +2769,12 @@ fast in modern systems, especially the scrolling text of [schnitzi.inp1](schnitzi.inp1). -## [2004/sds](2004/sds/sds.c) ([README.md](2004/sds/README.md)) +## [2004/sds](/2004/sds/sds.c) ([README.md](/2004/sds/README.md)) -[Cody](#cody) added the [try.sh](2004/sds/try.sh) script. +[Cody](#cody) added the [try.sh](/2004/sds/try.sh) script. -## [2004/vik2](2004/vik2/vik2.c) ([README.md](2004/vik2/README.md)) +## [2004/vik2](/2004/vik2/vik2.c) ([README.md](/2004/vik2/README.md)) [Cody](#cody) fixed this to compile in Linux. Although it compiled cleanly in macOS (and BSD?) the code failed to compile at all in Linux due to: @@ -2820,63 +2820,63 @@ make: *** [Makefile:133: vik2] Error 1 Unfortunately the fix required heavy modification to the original file (see below) and also inclusion of what used to be generated by the -[Makefile](2004/vik2/Makefile) but now it at least works for both Linux and +[Makefile](/2004/vik2/Makefile) but now it at least works for both Linux and macOS. As for the fix itself it required changing the C pre-processor macros that resulted in macros themselves like `#ifdef`, `#else` etc. to be `#ifdef`, -`#else` etc. and also the inclusion of the file [vik2_1.c](2004/vik2/vik2_1.c) +`#else` etc. and also the inclusion of the file [vik2_1.c](/2004/vik2/vik2_1.c) (which actually includes itself, once directly and now by `__FILE__`) which used to be generated by the Makefile via `cc -E`. Cody also made it so that the `FNAME` is (for the entry file itself and `vik2_1.c`: it shouldn't be done for -[vik2.possible.cat.death.c](2004/vik2/vik2.possible.cat.death.c)!) `__FILE__` +[vik2.possible.cat.death.c](/2004/vik2/vik2.possible.cat.death.c)!) `__FILE__` just to make it a bit easier to compile. # 2005 -## [2005/aidan](2005/aidan/aidan.c) ([README.md](2005/aidan/README.md])) +## [2005/aidan](/2005/aidan/aidan.c) ([README.md](/2005/aidan/README.md])) [Cody](#cody) fixed the test script, described by the author in their remarks, to refer to the proper compiled program (it's hardcoded). This had never been done and it broke the script. -He also added the [alt code](2005/aidan/README.md#alternate-code) based on the +He also added the [alt code](/2005/aidan/README.md#alternate-code) based on the author's remarks which is a different approach than the one used and which 'is slower (particularly in worst-case or nearly so scenarios), inelegant, and not a good starting place for sudoku generation.' -The [try.sh](2005/aidan/try.sh) and [try.alt.sh](2005/aidan/try.alt.sh) +The [try.sh](/2005/aidan/try.sh) and [try.alt.sh](/2005/aidan/try.alt.sh) correspond to the entry and alt code respectively. Cody added the `make test` and `make test-n0` rules for easier use of the test suite. -## [2005/anon](2005/anon/anon.c) ([README.md](2005/anon/README.md])) +## [2005/anon](/2005/anon/anon.c) ([README.md](/2005/anon/README.md])) [Cody](#cody) fixed a problem where in some systems (like macOS) the `stty sane` would not work and end up causing a bus error. Instead of `stty sane` it uses `stty echo` which is what it was trying to accomplish. -The author noted that one can define `NO_STTY` to not use `stty(1)` at all +The author noted that one can define `NO_STTY` to not use `stty(/1)` at all (either to prevent having to hit enter or to turn echo off/on) which is explained in the README.md. -Cody added the [alt code](2005/anon/README.md#alternate-code) with vi(m) like +Cody added the [alt code](/2005/anon/README.md#alternate-code) with vi(m) like movements. -## [2005/boutines](2005/boutines/boutines.c) ([README.md](2005/boutines/README.md])) +## [2005/boutines](/2005/boutines/boutines.c) ([README.md](/2005/boutines/README.md])) -[Cody](#cody) added the [input.txt](2005/boutines/input.txt) data file based on suggested +[Cody](#cody) added the [input.txt](/2005/boutines/input.txt) data file based on suggested input from the author, adapting it to a command to try out. -## [2005/giljade](2005/giljade/giljade.c) ([README.md](2005/giljade/README.md])) +## [2005/giljade](/2005/giljade/giljade.c) ([README.md](/2005/giljade/README.md])) After Landon fixed the entry to compile with clang Cody noticed this does not work at all in modern systems (see below). He fixed this to work and then he @@ -2932,7 +2932,7 @@ or as a diff: +;;char*A=0,*_,*R,*Q, D[9999],*r,l[9999],T=42, M,V=32;int *E,k[9999],B[1 <<+21],*N=B+ ``` -Cody also added the [try.sh](2005/giljade/try.sh) script which also lets one see +Cody also added the [try.sh](/2005/giljade/try.sh) script which also lets one see the beauty of the entry without having to use vi(m), should they be afraid of getting stuck in it (and for ease of use). :-) @@ -2941,22 +2941,22 @@ Finally, to improve upon the test-suite provided by the program, Cody added the temporary file the compilation including the 'Line' lines. After that is done it uses `grep -c` on the file to show that there are indeed as many versions the program generates as the author states, 180. If it does not find 180 it is an -error; otherwise it is success. It uses [test.sh](2005/giljade/test.sh). +error; otherwise it is success. It uses [test.sh](/2005/giljade/test.sh). -## [2005/jetro](2005/jetro/jetro.c) ([README.md](2005/jetro/README.md)) +## [2005/jetro](/2005/jetro/jetro.c) ([README.md](/2005/jetro/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) for systems like Linux that seem to not do it implicitly (like macOS does). -## [2005/klausler](2005/klausler/klausler.c) ([README.md](2005/klausler/README.md)) +## [2005/klausler](/2005/klausler/klausler.c) ([README.md](/2005/klausler/README.md)) -[Cody](#cody) added the [try.sh](2005/klausler/try.sh) script. +[Cody](#cody) added the [try.sh](/2005/klausler/try.sh) script. -## [2005/mikeash](2005/mikeash/mikeash.c) ([README.md](2005/mikeash/README.md)) +## [2005/mikeash](/2005/mikeash/mikeash.c) ([README.md](/2005/mikeash/README.md)) [Cody](#cody) fixed this to work in Linux. The problem was an unknown escape sequence, `\N`, which caused a funny compiler error: @@ -2985,10 +2985,10 @@ what is supposed to happen. It is not known, however, if having to change the `\N` to `\n` ended up breaking any LISP. The other examples given by the author also show correct output though. -Cody also added the [try.sh](2005/mikeash/try.sh) script. +Cody also added the [try.sh](/2005/mikeash/try.sh) script. -## [2005/mynx](2005/mynx/mynx.c) ([README.md](2005/mynx/README.md])) +## [2005/mynx](/2005/mynx/mynx.c) ([README.md](/2005/mynx/README.md])) [Cody](#cody) fixed this so that the [configure](source/configure) script (which is not needed but part of the entry) would work with compilers that have by default @@ -3000,15 +3000,15 @@ might be some command line that will let it work that way or perhaps someone wants to add the necessary code. -## [2005/persano](2005/persano/persano.c) ([README.md](2005/persano/README.md])) +## [2005/persano](/2005/persano/persano.c) ([README.md](/2005/persano/README.md])) [Cody](#cody) added the (untested) [alternate -code](2005/persano/README.md#alternate-code) which should work for Windows as it +code](/2005/persano/README.md#alternate-code) which should work for Windows as it sets binary mode on `stdout`. It is untested as Cody has no Windows system to test it on. -## [2005/sykes](2005/sykes/sykes.c) ([README.md](2005/sykes/README.md])) +## [2005/sykes](/2005/sykes/sykes.c) ([README.md](/2005/sykes/README.md])) [Cody](#cody) added the saved (with the `SAVE` command) BASIC program `PET` which was: @@ -3036,10 +3036,10 @@ BY STEPHEN SYKES! to both save and test run it. -Cody added the [try.sh](2005/sykes/try.sh) script which runs in a loop with a +Cody added the [try.sh](/2005/sykes/try.sh) script which runs in a loop with a menu of things one might wish to try, asking if they wish to continue when done. -Cody added the script [test.sh](2005/sykes/test.sh) and the make rule `test` to +Cody added the script [test.sh](/2005/sykes/test.sh) and the make rule `test` to run the test suite. The program will enter an infinite loop after it runs so you have to hit ctrl-c to end it which the script tells you. @@ -3047,14 +3047,14 @@ The scripts note every time that one will have to send ctrl-c or whatever their interrupt is set to in order to exit the program. -## [2005/timwi](2005/timwi/timwi.c) ([README.md](2005/timwi/README.md])) +## [2005/timwi](/2005/timwi/timwi.c) ([README.md](/2005/timwi/README.md])) -[Cody](#cody) added [try.sh](2005/timwi/try.sh). It only has one command as he doesn't +[Cody](#cody) added [try.sh](/2005/timwi/try.sh). It only has one command as he doesn't want to knacker his brain any more than it might or might not already be :-) and he doesn't want to damage anyone else's brain either. :-) -## [2005/toledo](2005/toledo/toledo.c) ([README.md](2005/toledo/README.md)) +## [2005/toledo](/2005/toledo/toledo.c) ([README.md](/2005/toledo/README.md)) [Cody](#cody) fixed this to compile with some versions of clang which have an additional defect where `main()` can only have 0, 2 or 3 args (it was 4). It now calls @@ -3063,7 +3063,7 @@ another function that takes 4 args and which is what used to be `main()`. The alternate versions were also fixed. -## [2005/vince](2005/vince/vince.c) ([README.md](2005/vince/README.md)) +## [2005/vince](/2005/vince/vince.c) ([README.md](/2005/vince/README.md)) [Cody](#cody) fixed this in the case that the program is compiled or linked/copies to another file name: the code constructed the source code file name in a clever @@ -3079,31 +3079,31 @@ if one runs it from another directory, specifying the directory, it'll not catch # 2006 -## [2006/birken](2006/birken/birken.c) ([README.md](2006/birken/README.md])) +## [2006/birken](/2006/birken/birken.c) ([README.md](/2006/birken/README.md])) [Cody](#cody) fixed a segfault in macOS with this entry. The problem was a missing `+1` for strlen() with malloc(). This prevented it from working. -Cody also added the [try.sh](2006/birken/try.sh) script. +Cody also added the [try.sh](/2006/birken/try.sh) script. -## [2006/borsanyi](2006/borsanyi/borsanyi.c) ([README.md](2006/borsanyi/README.md])) +## [2006/borsanyi](/2006/borsanyi/borsanyi.c) ([README.md](/2006/borsanyi/README.md])) [Cody](#cody) fixed the Makefile under some systems where the `lpthread` was not implicitly linked in. -## [2006/hamre](2006/hamre/hamre.c) ([README.md](2006/hamre/README.md)) +## [2006/hamre](/2006/hamre/hamre.c) ([README.md](/2006/hamre/README.md)) [Cody](#cody) fixed this so that it will not crash without an arg after it was suggested this should be fixed. -Cody also added the [try.sh](2006/hamre/try.sh) script. +Cody also added the [try.sh](/2006/hamre/try.sh) script. -## [2006/monge](2006/monge/monge.c) ([README.md](2006/monge/README.md])) +## [2006/monge](/2006/monge/monge.c) ([README.md](/2006/monge/README.md])) -[Cody](#cody) added the [alternate code](2006/monge/README.md#alternate-code) that lets +[Cody](#cody) added the [alternate code](/2006/monge/README.md#alternate-code) that lets one resize the image and redefine the number of iterations. Cody also fixed the Makefile to use `sdl-config` (which is what the author @@ -3118,19 +3118,19 @@ feature but one which we will accept fixes to. See [2006/monge in bugs.md](/bugs.md#2006-monge). -## [2006/night](2006/night/night.c) ([README.md](2006/night/README.md])) +## [2006/night](/2006/night/night.c) ([README.md](/2006/night/README.md])) As [Cody](#cody) is a lost :-) `vim` user he took the author's remarks to add support -back for arrow keys in the [alternate version](2006/night/night.alt.c). +back for arrow keys in the [alternate version](/2006/night/night.alt.c). -## [2006/sloane](2006/sloane/sloane.c) ([README.md](2006/sloane/README.md])) +## [2006/sloane](/2006/sloane/sloane.c) ([README.md](/2006/sloane/README.md])) [Cody](#cody) fixed this entry to work with clang which has a defect with the args to `main()`: it requires specific types: `int` and `char **` for the first and latter args. -Cody also provided the [alternate version](2006/sloane/sloane.alt.c), which +Cody also provided the [alternate version](/2006/sloane/sloane.alt.c), which allows one to see what is going on in modern systems, and which we recommend one use _first_. @@ -3152,39 +3152,39 @@ Since the author suggested that the lack of certain `#include`s might break the program in some systems he also added `-include ...` to the Makefile as well. -## [2006/stewart](2006/stewart/stewart.c) ([README.md](2006/stewart/README.md])) +## [2006/stewart](/2006/stewart/stewart.c) ([README.md](/2006/stewart/README.md])) [Cody](#cody) fixed it so that if the file cannot be opened it exits rather than trying to read from the file. -## [2006/sykes1](2006/sykes1/sykes1.c) ([README.md](2006/sykes1/README.md])) +## [2006/sykes1](/2006/sykes1/sykes1.c) ([README.md](/2006/sykes1/README.md])) -[Cody](#cody) provided the [alt code](2006/sykes1/README.md#alternate-code) based on the -author's remarks and the [try.sh](2006/sykes1/try.sh) script. +[Cody](#cody) provided the [alt code](/2006/sykes1/README.md#alternate-code) based on the +author's remarks and the [try.sh](/2006/sykes1/try.sh) script. -Cody also provided the [bedlam-cubes.pdf](2006/sykes1/bedlam-cubes.pdf) file, +Cody also provided the [bedlam-cubes.pdf](/2006/sykes1/bedlam-cubes.pdf) file, obtained from the Internet Wayback Machine, as the file was no longer available. The video was also no longer available but Cody found an alternative and added it to the repo as well. -## [2006/sykes2](2006/sykes2/sykes2.c) ([README.md](2006/sykes2/README.md])) +## [2006/sykes2](/2006/sykes2/sykes2.c) ([README.md](/2006/sykes2/README.md])) [Cody](#cody), out of an abundance of caution for `clang`'s defects, made `main()` have to args instead of 1 as some versions report that `main()` must have 0, 2 or 3 args, even though at least one of those versions allows 1 arg only. -Cody also added the [try.sh](2006/sykes2/try.sh) script for easier use of the +Cody also added the [try.sh](/2006/sykes2/try.sh) script for easier use of the entry to show the clock update in real time. -## [2006/toledo1](2006/toledo1/toledo1.c) ([README.md](2006/toledo1/README.md])) +## [2006/toledo1](/2006/toledo1/toledo1.c) ([README.md](/2006/toledo1/README.md])) -[Cody](#cody) added the [try.sh](2006/toledo1/try.sh) script. +[Cody](#cody) added the [try.sh](/2006/toledo1/try.sh) script. -## [2006/toledo2](2006/toledo2/toledo2.c) ([README.md](2006/toledo2/README.md])) +## [2006/toledo2](/2006/toledo2/toledo2.c) ([README.md](/2006/toledo2/README.md])) [Cody](#cody) fixed a segfault in this program which was making it fail to work under macOS - it did not seem to be a problem under Linux, at least not fedora. The @@ -3196,7 +3196,7 @@ port this to systems that have the non-standard `kbhit()` and `getch()` (not the one from curses) which is typically (always?) in `conio.h`. -## [2006/toledo3](2006/toledo3/toledo3.c) ([README.md](2006/toledo3/README.md])) +## [2006/toledo3](/2006/toledo3/toledo3.c) ([README.md](/2006/toledo3/README.md])) [Cody](#cody) fixed a crash and a display problem in this entry so that it now works in modern (64-bit) systems. The crash appears to only occur in macOS but the fix @@ -3205,49 +3205,49 @@ so some `int`s were changed to `long`s. The display problem might or might not have been a problem in Linux with the old `int`s but this is no longer known. Cody also added the code that _should_ work for Windows, -[toledo3.alt.c](2006/toledo3/toledo3.alt.c), based on the author's remarks. +[toledo3.alt.c](/2006/toledo3/toledo3.alt.c), based on the author's remarks. We're not able to test this. # 2011 -## [2011/akari](2011/akari/akari.c) ([README.md](2011/akari/README.md])) +## [2011/akari](/2011/akari/akari.c) ([README.md](/2011/akari/README.md])) -[Cody](#cody) added the [try.sh](2011/akari/try.sh) script. +[Cody](#cody) added the [try.sh](/2011/akari/try.sh) script. -## [2011/blakely](2011/blakely/blakely.c) ([README.md](2011/blakely/README.md])) +## [2011/blakely](/2011/blakely/blakely.c) ([README.md](/2011/blakely/README.md])) -[Cody](#cody) added the [try.sh](2011/blakely/try.sh) script. +[Cody](#cody) added the [try.sh](/2011/blakely/try.sh) script. -## [2011/borsanyi](2011/borsanyi/borsanyi.c) ([README.md](2011/borsanyi/README.md])) +## [2011/borsanyi](/2011/borsanyi/borsanyi.c) ([README.md](/2011/borsanyi/README.md])) [Cody](#cody), out of an abundance of caution, added a second arg to `main()` as some versions of clang complain about not only the type of each arg to `main()` but the number of args as well. -Cody also added the [try.sh](2011/borsanyi/try.sh) script. +Cody also added the [try.sh](/2011/borsanyi/try.sh) script. -## [2011/dlowe](2011/dlowe/dlowe.c) ([README.md](2011/dlowe/README.md])) +## [2011/dlowe](/2011/dlowe/dlowe.c) ([README.md](/2011/dlowe/README.md])) -[Cody](#cody) added the [try.sh](2011/dlowe/try.sh) script. +[Cody](#cody) added the [try.sh](/2011/dlowe/try.sh) script. -## [2011/eastman](2011/eastman/eastman.c) ([README.md](2011/eastman/README.md])) +## [2011/eastman](/2011/eastman/eastman.c) ([README.md](/2011/eastman/README.md])) -[Cody](#cody) added the video file [boing-ball.mp4](2011/eastman) which is the demo the +[Cody](#cody) added the video file [boing-ball.mp4](/2011/eastman) which is the demo the author referred to. -## [2011/fredriksson](2011/fredriksson/fredriksson.c) ([README.md](2011/fredriksson/README.md])) +## [2011/fredriksson](/2011/fredriksson/fredriksson.c) ([README.md](/2011/fredriksson/README.md])) -[Cody](#cody) added the [try.sh](2011/fredriksson/try.sh) script. +[Cody](#cody) added the [try.sh](/2011/fredriksson/try.sh) script. -## [2011/goren](2011/goren/goren.c) ([README.md](2011/goren/README.md])) +## [2011/goren](/2011/goren/goren.c) ([README.md](/2011/goren/README.md])) [Cody](#cody) fixed this for macOS. Before the fix it segfaulted. It worked fine under Linux. After fixing it it was noticed that the author stated it does not work @@ -3255,37 +3255,37 @@ for 64-bit so it was then tested as a 32-bit binary (Linux) and 64-bit binary (Linux, macOS) and both work. It was fixed by changing some `int`s to `long`s and now it does work with 64-bit systems as well as 32-bit systems. -Cody also added the [try.sh](2011/goren/try.sh) script. +Cody also added the [try.sh](/2011/goren/try.sh) script. Cody added the following words of wisdom: '"this" is not a pipe but "!" is'. -## [2011/hamaji](2011/hamaji/hamaji.c) ([README.md](2011/hamaji/README.md])) +## [2011/hamaji](/2011/hamaji/hamaji.c) ([README.md](/2011/hamaji/README.md])) -[Cody](#cody) added the [try.sh](2011/hamaji/try.sh) script and the `.nono` files -[conway-game-of-life.nono](2011/hamaji/conway-game-of-life.nono), -[multi-solutions.nono](2011/hamaji/multi-solutions.nono), -[no-solution.nono](2011/hamaji/no-solution.nono), -[plus.nono](2011/hamaji/plus.nono) and [smiley.nono](2011/hamaji/smiley.nono). +[Cody](#cody) added the [try.sh](/2011/hamaji/try.sh) script and the `.nono` files +[conway-game-of-life.nono](/2011/hamaji/conway-game-of-life.nono), +[multi-solutions.nono](/2011/hamaji/multi-solutions.nono), +[no-solution.nono](/2011/hamaji/no-solution.nono), +[plus.nono](/2011/hamaji/plus.nono) and [smiley.nono](/2011/hamaji/smiley.nono). The latter two `.nono` files were taken from and the others were from the authors' remarks. -## [2011/hou](2011/hou/hou.c) ([README.md](2011/hou/README.md])) +## [2011/hou](/2011/hou/hou.c) ([README.md](/2011/hou/README.md])) -[Cody](#cody) added the [try.sh](2011/hou/try.sh) script. +[Cody](#cody) added the [try.sh](/2011/hou/try.sh) script. -## [2011/konno](2011/konno/konno.c) ([README.md](2011/konno/README.md])) +## [2011/konno](/2011/konno/konno.c) ([README.md](/2011/konno/README.md])) [Cody](#cody) fixed the program to not crash if no arg was specified as this was not a documented feature. -Cody also added the [try.sh](2011/konno/try.sh) script. +Cody also added the [try.sh](/2011/konno/try.sh) script. -## [2011/richards](2011/richards/richards.c) ([README.md](2011/richards/README.md])) +## [2011/richards](/2011/richards/richards.c) ([README.md](/2011/richards/README.md])) [Cody](#cody) fixed a minor problem that showed up in both Linux and macOS. He notes however that as of this time this entry does not work properly with macOS at @@ -3294,58 +3294,58 @@ an inherent problem in macOS to do with executing code in in memory/JIT and in particular with the silicon chip. See [bugs.md](/bugs.md) for more details and a document from Apple about how it might be fixed if anyone is brave enough to try. If they do they might want to look also at -[richards.alt.c](2011/richards/richards.alt.c), for whatever it might or might +[richards.alt.c](/2011/richards/richards.alt.c), for whatever it might or might not be worth. -## [2011/toledo](2011/toledo/toledo.c) ([README.md](2011/toledo/README.md])) +## [2011/toledo](/2011/toledo/toledo.c) ([README.md](/2011/toledo/README.md])) -[Cody](#cody) added two [alternate versions](2011/toledo/README.md#alternate-code): one that +[Cody](#cody) added two [alternate versions](/2011/toledo/README.md#alternate-code): one that lets one reconfigure the controls and also the size of the game and another version that should work in Windows, based on the author's remarks and support file, `layer.c`. -## [2011/vik](2011/vik/vik.c) ([README.md](2011/vik/README.md])) +## [2011/vik](/2011/vik/vik.c) ([README.md](/2011/vik/README.md])) -[Cody](#cody) added an [alternate version](2011/vik/README.md#alternate-code) for Windows +[Cody](#cody) added an [alternate version](/2011/vik/README.md#alternate-code) for Windows based on the author's comments (along with looking up the function for the right header files). To build try the alt rule of the Makefile. -## [2011/zucker](2011/zucker/zucker.c) ([README.md](2011/zucker/README.md])) +## [2011/zucker](/2011/zucker/zucker.c) ([README.md](/2011/zucker/README.md])) -[Cody](#cody) added [alt code](2011/zucker/README.md#alternate-code) that should work on +[Cody](#cody) added [alt code](/2011/zucker/README.md#alternate-code) that should work on Windows, based on the author's remarks that if the system distinguishes binary and text then `stdout` needs to be set to binary mode. Cody also added the PDF file -[sphere-tracing.pdf](2011/zucker/sphere-tracing.pdf) in case the link eventually +[sphere-tracing.pdf](/2011/zucker/sphere-tracing.pdf) in case the link eventually dies. # 2012 -## [2012/blakely](2012/blakely/blakely.c) ([README.md](2012/blakely/README.md)) +## [2012/blakely](/2012/blakely/blakely.c) ([README.md](/2012/blakely/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) as not all systems do this implicitly (Linux doesn't seem to but macOS does). -Cody also added the [try.sh](2012/blakely/try.sh) script. +Cody also added the [try.sh](/2012/blakely/try.sh) script. -## [2012/deckmyn](2012/deckmyn/deckmyn.c) ([README.md](2012/deckmyn/README.md])) +## [2012/deckmyn](/2012/deckmyn/deckmyn.c) ([README.md](/2012/deckmyn/README.md])) -[Cody](#cody) added the [try.sh](2012/deckmyn/try.sh) script. +[Cody](#cody) added the [try.sh](/2012/deckmyn/try.sh) script. -## [2012/endoh1](2012/endoh1/endoh1.c) ([README.md](2012/endoh1/README.md)) +## [2012/endoh1](/2012/endoh1/endoh1.c) ([README.md](/2012/endoh1/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) as not all systems do this implicitly (Linux doesn't seem to but macOS does). -Cody also added two [alt versions](2012/endoh1/README.md#alternate-code) that +Cody also added two [alt versions](/2012/endoh1/README.md#alternate-code) that let one control how fast the fluid moves (how long to sleep in between writes) and also the gravity factor, the pressure factor and the viscosity factor as well as an alarm that lets one run it in a loop without having to hit @@ -3353,28 +3353,28 @@ ctrl-c/intr in between (the alarm can be disabled, however). The two different versions is because there are two versions: the original and the colour version added by the author, [Yusuke](#yusuke), at the request of the judges. -Cody also added the [try.alt.sh](2012/endoh1/try.alt.sh) script compiles the alt +Cody also added the [try.alt.sh](/2012/endoh1/try.alt.sh) script compiles the alt code in two ways, one with setting the gravity factor to `I` and another with the default, and which is run on the source file and each of the text files supplied by the author. This code has an alarm set at 10 seconds so that one need not hit ctrl-c/intr in between .. say to make it more fluid :-) -The [endoh1.alt2.c](2012/endoh1/endoh1.alt.c) was provided by Yusuke as a +The [endoh1.alt2.c](/2012/endoh1/endoh1.alt.c) was provided by Yusuke as a de-obfuscated version. -## [2012/endoh2](2012/endoh2/endoh2.c) ([README.md](2012/endoh2/README.md)) +## [2012/endoh2](/2012/endoh2/endoh2.c) ([README.md](/2012/endoh2/README.md)) -[Cody](#cody) added the [try.sh](2012/endoh2/try.sh) script that runs +[Cody](#cody) added the [try.sh](/2012/endoh2/try.sh) script that runs everything, filtered through less. Cody also fixed a typo in the ruby script -[find-font-table.rb](2012/endoh2/find-font-table.rb). +[find-font-table.rb](/2012/endoh2/find-font-table.rb). -## [2012/grothe](2012/grothe/grothe.c) ([README.md](2012/grothe/README.md)) +## [2012/grothe](/2012/grothe/grothe.c) ([README.md](/2012/grothe/README.md)) -[Cody](#cody) added the [try.sh](2012/grothe/try.sh) script. +[Cody](#cody) added the [try.sh](/2012/grothe/try.sh) script. Cody also changed `argv` to be not `const char **` but `char **`, mostly out of an abundance of caution in case clang, which already imposes restrictions on the @@ -3384,21 +3384,21 @@ restrict them. Cody also restored the original code from the archive. -## [2012/hamano](2012/hamano/hamano.c) ([README.md](2012/hamano/README.md])) +## [2012/hamano](/2012/hamano/hamano.c) ([README.md](/2012/hamano/README.md])) -[Cody](#cody) added the [try.sh](2012/hamano/try.sh) script. +[Cody](#cody) added the [try.sh](/2012/hamano/try.sh) script. -## [2012/hou](2012/hou/hou.c) ([README.md](2012/hou/README.md])) +## [2012/hou](/2012/hou/hou.c) ([README.md](/2012/hou/README.md])) -[Cody](#cody) added the [try.sh](2012/hou/try.sh) script and restored the original [hint -markdown file](2012/hou/hint.md) as the changes made when converting to a GitHub +[Cody](#cody) added the [try.sh](/2012/hou/try.sh) script and restored the original [hint +markdown file](/2012/hou/hint.md) as the changes made when converting to a GitHub README.md made the generated html not look correct; it did not have a title, a stylesheet etc. due to the fact that there is no `#` header (which specified title and stylesheet) and other formatting changes. -## [2012/kang](2012/kang/kang.c) ([README.md](2012/kang/README.md])) +## [2012/kang](/2012/kang/kang.c) ([README.md](/2012/kang/README.md])) [Cody](#cody) added alt code that fixes a problem where in German 'v' sounds like 'f' which the program has as 'f': with the original version it would translate @@ -3412,9 +3412,9 @@ about it. Using both, however, allows one to experience different capabilities and also enjoy or appreciate the entry even more, given how simple the difference is. -Cody also added five scripts: [en.sh](2012/kang/en.sh), -[de.sh](2012/kang/de.sh), [en.alt.sh](2012/kang/en.alt.sh) and -[de.alt.sh](2012/de.alt.sh) which count from 0 through 13 in English and German +Cody also added five scripts: [en.sh](/2012/kang/en.sh), +[de.sh](/2012/kang/de.sh), [en.alt.sh](/2012/kang/en.alt.sh) and +[de.alt.sh](/2012/de.alt.sh) which count from 0 through 13 in English and German using the original entry and the alt version respectively. In the German scripts it uses the umlaut and also does it without the umlaut @@ -3422,36 +3422,36 @@ In the German scripts it uses the umlaut and also does it without the umlaut either version but the `.alt.sh` versions default to the `alt` version whereas the other defaults to the submitted entry. See the README.md for details. -The fifth script, [try.sh](2012/kang/try.sh), runs a sequence of commands to +The fifth script, [try.sh](/2012/kang/try.sh), runs a sequence of commands to show different languages and numbers. -## [2012/konno](2012/konno/konno.c) ([README.md](2012/konno/README.md])) +## [2012/konno](/2012/konno/konno.c) ([README.md](/2012/konno/README.md])) -[Cody](#cody) added the [try.sh](2012/konno/try.sh) script. +[Cody](#cody) added the [try.sh](/2012/konno/try.sh) script. -## [2012/omoikane](2012/omoikane/omoikane.c) ([README.md](2012/omoikane/README.md])) +## [2012/omoikane](/2012/omoikane/omoikane.c) ([README.md](/2012/omoikane/README.md])) -[Cody](#cody) added the [try.sh](2012/omoikane/try.sh) script. +[Cody](#cody) added the [try.sh](/2012/omoikane/try.sh) script. -Cody also added the [alternate code](2012/omoikane/README.md#alternate-code) +Cody also added the [alternate code](/2012/omoikane/README.md#alternate-code) which will, if no arg is specified, read in the program itself, rather than `/dev/urandom`. This is mostly useful for those without a `/dev/urandom` device file (the default for the entry). The second alternate version is like the first except that it also sets binary mode on `stdin` and `stdout` which should theoretically make it work in Windows. -Cody also added the [try.alt.sh](2012/omoikane/try.alt.sh) script that is like +Cody also added the [try.alt.sh](/2012/omoikane/try.alt.sh) script that is like the `try.sh` script but which uses the (first version of the) alt code instead. -## [2012/tromp](2012/tromp/tromp.c) ([README.md](2012/tromp/README.md)) +## [2012/tromp](/2012/tromp/tromp.c) ([README.md](/2012/tromp/README.md)) -[Cody](#cody) added the [try.sh](2012/tromp/try.sh) script. +[Cody](#cody) added the [try.sh](/2012/tromp/try.sh) script. -## [2012/vik](2012/vik/vik.c) ([README.md](2012/vik/README.md])) +## [2012/vik](/2012/vik/vik.c) ([README.md](/2012/vik/README.md])) Based on the author's description it should be able to get this entry to work for Windows. With his instructions Cody added the alternate version that does @@ -3460,12 +3460,12 @@ this for the few who might use Windows. We're not sure whether we want to thank Cody or not for this :-) and he's not sure if he wants to be thanked either :-) but we appreciate it nonetheless. -Cody also added the [try.sh](2012/vik/try.sh) script. +Cody also added the [try.sh](/2012/vik/try.sh) script. -## [2012/zeitak](2012/zeitak/zeitak.c) ([README.md](2012/zeitak/README.md])) +## [2012/zeitak](/2012/zeitak/zeitak.c) ([README.md](/2012/zeitak/README.md])) -[Cody](#cody) added the `make test` rule and the [test.sh](2012/zeitak/test.sh) along +[Cody](#cody) added the `make test` rule and the [test.sh](/2012/zeitak/test.sh) along with a number of files that will be correctly be flagged as incorrect (including a text file to show that it's not that it parses C but rather just matching pairs though that should be obvious) and also some that are correct including @@ -3475,7 +3475,7 @@ pairs though that should be obvious) and also some that are correct including # 2013 -## [2013/birken](2013/birken/birken.c) ([README.md](2013/birken/README.md])) +## [2013/birken](/2013/birken/birken.c) ([README.md](/2013/birken/README.md])) [Cody](#cody) changed the `return 0;` at the end of the program to be `return system("reset");` (via redefining `exit(3)` so that the column ending would be @@ -3487,22 +3487,22 @@ Cody also added the alt version that lets one control how fast the painting is done, based on the author's recommendations, except that Cody made it configurable at compile time. -Cody also added the [try.sh](2013/birken/try.sh) script for the entry and the -[try.alt.sh](2013/birken/try.alt.sh) script for the alt code. +Cody also added the [try.sh](/2013/birken/try.sh) script for the entry and the +[try.alt.sh](/2013/birken/try.alt.sh) script for the alt code. -## [2013/cable1](2013/cable1/cable1.c) ([README.md](2013/cable1/README.md])) +## [2013/cable1](/2013/cable1/cable1.c) ([README.md](/2013/cable1/README.md])) -[Cody](#cody) added the [try.sh](2013/cable1/try.sh) script which also has an +[Cody](#cody) added the [try.sh](/2013/cable1/try.sh) script which also has an joke Easter egg in it based on the judges' remarks. -## [2013/cable2](2013/cable2/cable2.c) ([README.md](2013/cable2/README.md])) +## [2013/cable2](/2013/cable2/cable2.c) ([README.md](/2013/cable2/README.md])) -[Cody](#cody) added the [try.sh](2013/cable2/try.sh) script. +[Cody](#cody) added the [try.sh](/2013/cable2/try.sh) script. -## [2013/cable3](2013/cable3/cable3.c) ([README.md](2013/cable3/README.md])) +## [2013/cable3](/2013/cable3/cable3.c) ([README.md](/2013/cable3/README.md])) [Cody](#cody) fixed this to compile with modern systems. The problems were that `localtime()` is used differently and `time.h` being included (with @@ -3524,26 +3524,26 @@ been compiled by running `make clobber all || exit 1` and he also made it pass `shellcheck` (using `[[ .. ]]` over `[ .. ]`). As well, based on the author's remarks, Cody added the [alternate -code](2013/cable3/cable3.alt.c) which should be compilable for Windows/MS Visual +code](/2013/cable3/cable3.alt.c) which should be compilable for Windows/MS Visual Studio. This is done by in the compile line undefining `KB` (`-UKB`) and then in the source code defining `KB` to what the author suggested, `(kb=H(8),kbhit())&&(r[1190]=getch(),H(7))`. It need hardly be mentioned that this will not link in Unix systems (including macOS). -Finally Cody provided the [bios.asm](2013/cable3/bios.asm) that the author +Finally Cody provided the [bios.asm](/2013/cable3/bios.asm) that the author referred to, found at the [GitHub repo for the entry](https://github.com/adriancable/8086tiny/tree/master), and the 'ready-made 40MB hard disk image containing a whole bunch of software' in `hd.img` that the author linked to at `https://bitly.com/1bU8URK`. -## [2013/dlowe](2013/dlowe/dlowe.c) ([README.md](2013/dlowe/README.md)) +## [2013/dlowe](/2013/dlowe/dlowe.c) ([README.md](/2013/dlowe/README.md)) [Cody](#cody) added the source code that we suggested one should compile and run with -different compilers as [fun.c](2013/dlowe/fun.c). He modified the Makefile so +different compilers as [fun.c](/2013/dlowe/fun.c). He modified the Makefile so that running `make all` will compile it, saving you the effort. -He also provided the script [slflen.sh](2013/dlowe/slflen.sh) which is based on +He also provided the script [slflen.sh](/2013/dlowe/slflen.sh) which is based on the author's remarks, fixing it for shellcheck and improving upon it (show what files will be processed). This script shows the sparkline of the file lengths (as in `wc -c`). The fixes (but not the improvements) were added to the author's @@ -3555,19 +3555,19 @@ clobber` will delete both and running `make clobber all` will ensure that the symlink is created. The `slflen.sh` script also explicitly makes sure to create the symlink as it uses it, even though it runs `make clobber all`. -Cody also added the [try.sh](2013/dlowe/try.sh) script to more easily try the +Cody also added the [try.sh](/2013/dlowe/try.sh) script to more easily try the program. -He also added the [diff.sh](2013/dlowe/diff.sh) script which is based on some +He also added the [diff.sh](/2013/dlowe/diff.sh) script which is based on some commands to try that he suggested to see how different lengths look. -## [2013/endoh1](2013/endoh1/endoh1.c) ([README.md](2013/endoh1/README.md)) +## [2013/endoh1](/2013/endoh1/endoh1.c) ([README.md](/2013/endoh1/README.md)) -[Cody](#cody) added the [try.sh](2013/endoh1/try.sh) script. +[Cody](#cody) added the [try.sh](/2013/endoh1/try.sh) script. -## [2013/endoh2](2013/endoh2/endoh2.c) ([README.md](2013/endoh2/README.md)) +## [2013/endoh2](/2013/endoh2/endoh2.c) ([README.md](/2013/endoh2/README.md)) [Cody](#cody) fixed the Makefile `check` rule so that it `checks` :-) that both [Ruby](https://www.ruby-lang.org) and [ImageMagick](https://imagemagick.org) are @@ -3589,16 +3589,16 @@ not found. The entry can still be enjoyed if you do not have these tools, however. -## [2013/endoh4](2013/endoh4/endoh4.c) ([README.md](2013/endoh4/README.md)) +## [2013/endoh4](/2013/endoh4/endoh4.c) ([README.md](/2013/endoh4/README.md)) -[Cody](#cody) added the [try.sh](2013/endoh4/try.sh) script which temporarily +[Cody](#cody) added the [try.sh](/2013/endoh4/try.sh) script which temporarily turns off the cursor as suggested by the author, with the addition that if no -file is specified it will feed the source code [endoh4.c](2013/endoh4/endoh4.c) +file is specified it will feed the source code [endoh4.c](/2013/endoh4/endoh4.c) to the program rather than the file specified. It does not try and detect if the file exists or can be read as that will be handled by the shell/program. -## [2013/hou](2013/hou/hou.c) ([README.md](2013/hou/README.md)) +## [2013/hou](/2013/hou/hou.c) ([README.md](/2013/hou/README.md)) [Cody](#cody) fixed the Makefile so that this would work properly. Before this the use of the program just did what the judges' remarks said as far as how it @@ -3627,52 +3627,52 @@ The `LDFLAGS` were updated to have `-lm` as the author suggested it uses the does not). Further, after the file `2013/hou/doc/example.markdown` was moved to -[2013/hou/doc/example.md](2013/hou/doc/example.md) to match the rest of the repo +[2013/hou/doc/example.md](/2013/hou/doc/example.md) to match the rest of the repo this broke `make` which Cody also fixed. -## [2013/mills](2013/mills/mills.c) ([README.md)[2013/mills/README.md)) +## [2013/mills](/2013/mills/mills.c) ([README.md)[2013/mills/README.md)) [Cody](#cody) fixed this so that the server would not refuse the connection -after the first call to `close(2)`. The problem was that because the backlog to -`listen(2)` was 1 once the connection closed the server was essentially 'dead'. +after the first call to `close(/2)`. The problem was that because the backlog to +`listen(/2)` was 1 once the connection closed the server was essentially 'dead'. The backlog was changed to 10 and this solves the problem. It is not known if this was specific to macOS but it was not specific to a browser as Safari and Firefox both had the problem. -## [2013/misaka](2013/misaka/misaka.c) ([README.md)[2013/misaka/README.md)) +## [2013/misaka](/2013/misaka/misaka.c) ([README.md)[2013/misaka/README.md)) -[Cody](#cody) added the [try.sh](2013/misaka/try.sh) script. +[Cody](#cody) added the [try.sh](/2013/misaka/try.sh) script. -## [2013/morgan1](2013/morgan1/morgan1.c) ([README.md](2013/morgan1/README.md)) +## [2013/morgan1](/2013/morgan1/morgan1.c) ([README.md](/2013/morgan1/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) as not all systems do this implicitly (Linux doesn't seem to but macOS does). -## [2013/robison](2013/robison/robison.c) ([README.md](2013/robison/README.md)) +## [2013/robison](/2013/robison/robison.c) ([README.md](/2013/robison/README.md)) -[Cody](#cody) added the [try.sh](2013/robison/try.sh) script. +[Cody](#cody) added the [try.sh](/2013/robison/try.sh) script. # 2014 -## [2014/birken](2014/birken/prog.c) ([README.md](2014/birken/README.md)) +## [2014/birken](/2014/birken/prog.c) ([README.md](/2014/birken/README.md)) [Cody](#cody) provided the [alternate -code](2014/birken/README.md#alternate-code) that lets one redefine the port to +code](/2014/birken/README.md#alternate-code) that lets one redefine the port to bind to in case there is a firewall issue or there is some other reason to not have the default port. Remember that ports < 1024 are privileged. It also lets you redefine the timing constant `STARDATE` (see the author's remarks for more details). -## [2014/deak](2014/deak/prog.c) ([README.md](2014/deak/README.md)) +## [2014/deak](/2014/deak/prog.c) ([README.md](/2014/deak/README.md)) -[Cody](#cody) added [alt code](2014/deak/README.md#alternate-code) that lets one +[Cody](#cody) added [alt code](/2014/deak/README.md#alternate-code) that lets one reconfigure the coordinates but instead of being a modified version of the entry it is the version the author provided which would be what the program would look like if, as the author put it: @@ -3688,9 +3688,9 @@ that was fixed and it also has `#include ` for `putchar(3)`. The `#ifndef..#define..#endif` was not part of the original alt code, of course. -## [2014/endoh1](2014/endoh1/prog.c) ([README.md](2014/endoh1/README.md])) +## [2014/endoh1](/2014/endoh1/prog.c) ([README.md](/2014/endoh1/README.md])) -[Cody](#cody) added the [rake.sh](2014/endoh1/rake.sh) script and `make rake` +[Cody](#cody) added the [rake.sh](/2014/endoh1/rake.sh) script and `make rake` rule that runs the script. This script will check that `rake` is installed and if it is not it will report this and then check that `gem` is installed. It checks that `gem` is installed in this case because `gem` is how you install @@ -3700,54 +3700,54 @@ then it tells you to install a specific gem and then to try again. Finally if `rake` succeeds it will verify that `prog` is executable and if it is it will run it. -Cody also added the [try.sh](2014/endoh1/try.sh) script. +Cody also added the [try.sh](/2014/endoh1/try.sh) script. **_Barely_** worth noting but done nonetheless, Cody renamed the `read_me.md` -file to [spoilers.md](2014/endoh1/spoilers.md) to be clearer in its purpose as +file to [spoilers.md](/2014/endoh1/spoilers.md) to be clearer in its purpose as it is a file with spoilers (and too close to README.md?). -## [2014/endoh2](2014/endoh2/prog.c) ([README.md](2014/endoh2/README.md])) +## [2014/endoh2](/2014/endoh2/prog.c) ([README.md](/2014/endoh2/README.md])) -[Cody](#cody) added the [try.sh](2014/endoh2/try.sh) script. +[Cody](#cody) added the [try.sh](/2014/endoh2/try.sh) script. -## [2014/maffiodo1](2014/maffiodo1/prog.c) ([README.md](2014/maffiodo1/README.md])) +## [2014/maffiodo1](/2014/maffiodo1/prog.c) ([README.md](/2014/maffiodo1/README.md])) [Cody](#cody) fixed the build for this entry: it does not require [SDL2](https://www.libsdl.org) but SDL1 so there were linking errors. -Cody also added the [mario.sh](2014/maffiodo1/mario.sh) and -[giana.sh](2014/maffiodo1/giana.sh) scripts which play, respectively, [Super +Cody also added the [mario.sh](/2014/maffiodo1/mario.sh) and +[giana.sh](/2014/maffiodo1/giana.sh) scripts which play, respectively, [Super Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.) and one of [The Great Giana Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters), but which let one configure the width and height of the game. -## [2014/maffiodo2](2014/maffiodo2/prog.c) ([README.md](2014/maffiodo2/README.md])) +## [2014/maffiodo2](/2014/maffiodo2/prog.c) ([README.md](/2014/maffiodo2/README.md])) -[Cody](#cody) added the [try.sh](2014/maffiodo2/try.sh) script and the -[alternate code](2014/maffiodo2/README.md#alternate-code) provided by the +[Cody](#cody) added the [try.sh](/2014/maffiodo2/try.sh) script and the +[alternate code](/2014/maffiodo2/README.md#alternate-code) provided by the author. -## [2014/morgan](2014/morgan/prog.c) ([README.md](2014/morgan/README.md)) +## [2014/morgan](/2014/morgan/prog.c) ([README.md](/2014/morgan/README.md)) -[Cody](#cody) added the [try.sh](2014/morgan/try.sh) script. +[Cody](#cody) added the [try.sh](/2014/morgan/try.sh) script. -## [2014/sinon](2014/sinon/prog.c) ([README.md](2014/sinon/README.md)) +## [2014/sinon](/2014/sinon/prog.c) ([README.md](/2014/sinon/README.md)) [Cody](#cody) fixed the code so that the game can play automatically like it once did. The problem is that it expects a certain file name which was `sinon.c`. The code now refers to `prog.c`. -Cody also added the [try.sh](2014/sinon/try.sh) script which is an improvement +Cody also added the [try.sh](/2014/sinon/try.sh) script which is an improvement over what was once suggested in that when it's over it will ask you if you wish to try again, say because of a jam (see the README.md file for details). -## [2014/skeggs](2014/skeggs/prog.c) ([README.md](2014/skeggs/README.md)) +## [2014/skeggs](/2014/skeggs/prog.c) ([README.md](/2014/skeggs/README.md)) [Cody](#cody) fixed the Makefile to compile this entry in modern systems. The problem was that the `CDEFINE` variable in the Makefile was missing `'`s: the `#define CC` @@ -3765,7 +3765,7 @@ the README.md file for details) so Cody made sure that `make clobber` (via `make clean`) removes those files and so that they are ignored by `.gitignore`. -## [2014/vik](2014/vik/prog.c) ([README.md](2014/vik/README.md)) +## [2014/vik](/2014/vik/prog.c) ([README.md](/2014/vik/README.md)) [Cody](#cody) added an alternate version that is based on the author's remarks that will theoretically work for Microsoft Windows compilers (if anything works in Windows @@ -3773,9 +3773,9 @@ theoretically work for Microsoft Windows compilers (if anything works in Windows that would break it we do not know. -## [2014/wiedijk](2014/wiedijk/prog.c) ([README.md](2014/wiedijk/README.md)) +## [2014/wiedijk](/2014/wiedijk/prog.c) ([README.md](/2014/wiedijk/README.md)) -[Cody](#cody) added the [try.sh](2014/wiedijk/try.sh) script which is based on +[Cody](#cody) added the [try.sh](/2014/wiedijk/try.sh) script which is based on the command to try in the 'try' section but improved so one can more easily specify what ident tool they want to use and also change which sed to use, should they want to. It also checks that both of these two tools exist and are @@ -3786,12 +3786,9 @@ output. # 2015 -## [2015/duble](2015/duble/prog.c) ([README.md](2015/duble/README.md])) +## [2015/endoh3](/2015/endoh3/prog.c) ([README.md](/2015/endoh3/README.md])) -[Cody](#cody) added the [try.sh](2015/duble/try.sh) script. - - -## [2015/endoh3](2015/endoh3/prog.c) ([README.md](2015/endoh3/README.md])) +[Cody](#cody) added the [try.sh](/2015/duble/try.sh) script. [Cody](#cody) fixed this to compile with Linux which was having a problem with duplicate symbols of `main()`. The fix is through the compiler option `-fcommon` which @@ -3802,7 +3799,7 @@ Future](https://en.wikipedia.org/wiki/Back_to_the_Future) using this entry by simply typing `make back_to` or `make mullender`. -## [2015/hou](2015/hou/prog.c) ([README.md](2015/hou/README.md)) +## [2015/hou](/2015/hou/prog.c) ([README.md](/2015/hou/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) for systems that do not do this (Linux doesn't seem to but macOS does). @@ -3812,18 +3809,18 @@ the directory, to make it so one need not download it, and which the README.md file now links to. -## [2015/howe](2015/howe/prog.c) ([README.md](2015/howe/README.md)) +## [2015/howe](/2015/howe/prog.c) ([README.md](/2015/howe/README.md)) -[Cody](#cody) added the [try.sh](2015/howe/try.sh) script, downloaded the War -and Peace text file, fixed the [avgtime.sh](2015/howe/avgtime.sh) script (it -resulted in standard input errors in piping to `bc(1)`) and added the -[cc.1](2015/howe/cc.1) man page as not all systems have it (in fact it's -`gcc(1)` from Rocky Linux). +[Cody](#cody) added the [try.sh](/2015/howe/try.sh) script, downloaded the War +and Peace text file, fixed the [avgtime.sh](/2015/howe/avgtime.sh) script (it +resulted in standard input errors in piping to `bc(/1)`) and added the +[cc.1](/2015/howe/cc.1) man page as not all systems have it (in fact it's +`gcc(/1)` from Rocky Linux). -## [2015/mills1](2015/mills1/prog.c) ([README.md](2015/mills1/README.md)) +## [2015/mills1](/2015/mills1/prog.c) ([README.md](/2015/mills1/README.md)) -[Cody](#cody) added the [try.sh](2015/mills1/try.sh) script which changes the +[Cody](#cody) added the [try.sh](/2015/mills1/try.sh) script which changes the parameters to what we had in the judges' remarks to make it easier (he only died when he tried to mark a reminder complete on the other side of the screen at the same time and he almost survived that, scoring at that point over 90 - but this @@ -3831,17 +3828,17 @@ also involves good eye-hand coordination and playing games like this in the past). -## [2015/mills2](2015/mills2/prog.c) ([README.md](2015/mills2/README.md)) +## [2015/mills2](/2015/mills2/prog.c) ([README.md](/2015/mills2/README.md)) -[Cody](#cody) added the [try.sh](2015/mills2/try.sh) script. +[Cody](#cody) added the [try.sh](/2015/mills2/try.sh) script. -## [2015/muth](2015/muth/prog.c) ([README.md](2015/muth/README.md)) +## [2015/muth](/2015/muth/prog.c) ([README.md](/2015/muth/README.md)) -[Cody](#cody) added the [try.sh](2015/muth/try.sh) script. +[Cody](#cody) added the [try.sh](/2015/muth/try.sh) script. -## [2015/yang](2015/yang/prog.c) ([README.md](2015/yang/README.md])) +## [2015/yang](/2015/yang/prog.c) ([README.md](/2015/yang/README.md])) [Cody](#cody) fixed an unfortunate typo in the Makefile that was preventing some of the files from compiling properly, trying instead to compile already compiled code. @@ -3849,22 +3846,22 @@ files from compiling properly, trying instead to compile already compiled code. He also added explicit linking of libm (`-lm`) for systems that do not do this (Linux seems to not but macOS does). -He also added the [try.sh](2015/yang/try.sh) script. +He also added the [try.sh](/2015/yang/try.sh) script. # 2018 -## [2018/bellard](2018/bellard/prog.c) ([README.md](2018/bellard/README.md)) +## [2018/bellard](/2018/bellard/prog.c) ([README.md](/2018/bellard/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) for systems that do not do this (Linux doesn't seem to but macOS does). -## [2018/ferguson](2018/ferguson/prog.c) ([README.md](2018/ferguson/README.md)) +## [2018/ferguson](/2018/ferguson/prog.c) ([README.md](/2018/ferguson/README.md)) [Cody](#cody), with irony well intended :-), fixed the [test.sh -script](2018/ferguson/test.sh) for portability, shellcheck, making it executable +script](/2018/ferguson/test.sh) for portability, shellcheck, making it executable and other things, fixed dead links in the man page, updated the test-strings.txt file and other things as well. @@ -3873,7 +3870,7 @@ that's probably true: let's just say that for the IOCCC I'm (Cody) a weasel! :-) (but isn't that kind of the point ? :-) ) -## [2018/hou](2018/hou/prog.c) ([README.md](2018/hou/README.md)) +## [2018/hou](/2018/hou/prog.c) ([README.md](/2018/hou/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) for systems that do not do this (Linux doesn't seem to but macOS does). @@ -3882,13 +3879,13 @@ that's probably true: let's just say that for the IOCCC I'm (Cody) a weasel! :-) # 2019 -## [2019/burton](2019/burton/prog.c) ([README.md](2019/burton/README.md])) +## [2019/burton](/2019/burton/prog.c) ([README.md](/2019/burton/README.md])) [Cody](#cody) fixed the Makefile which had a bad character, a '%' instead of a '$' which caused a rule to fail. -## [2019/ciura](2019/ciura/prog.c) ([README.md](2019/ciura/README.md])) +## [2019/ciura](/2019/ciura/prog.c) ([README.md](/2019/ciura/README.md])) [Cody](#cody) fixed invalid bytes error in `tr` in the scripts. He notes that at least on his systems (macOS and fedora Linux) the alternative languages do not work. @@ -3896,7 +3893,7 @@ Perhaps that is the wrong locale or it's unable to come up with perfect pangrams but one will not get errors now (it did not work before the fixes either). -## [2019/diels-grabsch1](2019/diels-grabsch1/prog.c) ([README.md](2019/diels-grabsch1/README.md])) +## [2019/diels-grabsch1](/2019/diels-grabsch1/prog.c) ([README.md](/2019/diels-grabsch1/README.md])) [Cody](#cody) made the author's statement that the entry compiles cleanly true by fixing `warning: a function declaration without a prototype is deprecated in all @@ -3904,7 +3901,7 @@ versions of C ` (in main()). Not strictly necessary but if he's making fixes he might as well. -## [2019/diels-grabsch2](2019/diels-grabsch2/prog.c) ([README.md](2019/diels-grabsch2/README.md])) +## [2019/diels-grabsch2](/2019/diels-grabsch2/prog.c) ([README.md](/2019/diels-grabsch2/README.md])) [Cody](#cody) made the author's statement that the entry compiles cleanly true by fixing `warning: a function declaration without a prototype is deprecated in all @@ -3912,7 +3909,7 @@ versions of C` (in main()). Not strictly necessary but if he's making fixes he might as well. -## [2019/dogon](2019/dogon/prog.c) ([README.md](2019/dogon/README.md)) +## [2019/dogon](/2019/dogon/prog.c) ([README.md](/2019/dogon/README.md)) [Cody](#cody) added explicit linking of libm (`-lm`) for systems that do not do this (Linux does not seem to but macOS does). @@ -3920,7 +3917,7 @@ might as well. He also fixed the Makefile so that it compiles with clang in Linux. -## [2019/endoh](2019/endoh/prog.c) ([README.md](2019/endoh/README.md])) +## [2019/endoh](/2019/endoh/prog.c) ([README.md](/2019/endoh/README.md])) As this is a backtrace quine having the optimiser enabled is not a good idea so [Cody](#cody) disabled it. For this same reason he also added the `-g` flag to the @@ -3928,12 +3925,12 @@ compilation as debugging symbols might just be useful for an entry that's supposed to segfault :-) -## [2019/poikola](2019/poikola/prog.c) ([README.md[(2019/poikola/README.md)) +## [2019/poikola](/2019/poikola/prog.c) ([README.md[(/2019/poikola/README.md)) [Cody](#cody) added a missing rule to the Makefile. -## [2019/karns](2019/karns/prog.c) ([README.md](2019/karns/README.md])) +## [2019/karns](/2019/karns/prog.c) ([README.md](/2019/karns/README.md])) [Cody](#cody) reported that with `-O` level > 0 this program segfaults (sometimes?). He's not sure why as it worked fine before on the same systems tested but `-O0` @@ -3941,22 +3938,22 @@ appears to fix the problem in both macOS and Linux. Perhaps this is the problem that the author reported where it sometimes segfaults but Cody did not try debugging it since it works with `-O0`. -He also added the script [try.sh](2019/karns/try.sh) to showcase the entry a +He also added the script [try.sh](/2019/karns/try.sh) to showcase the entry a bit more easily. # 2020 -## [2020/endoh2](2020/endoh2/prog.c) ([README.md](2020/endoh2/README.md)) +## [2020/endoh2](/2020/endoh2/prog.c) ([README.md](/2020/endoh2/README.md)) [Cody](#cody) copied the files from the spoiler.zip file that was password protected with a password that was no longer known from his preview of 2020. -## [2020/endoh3](2020/endoh3/prog.c) ([README.md](2020/endoh3/README.md)) +## [2020/endoh3](/2020/endoh3/prog.c) ([README.md](/2020/endoh3/README.md)) -[Cody](#cody) fixed the script [run_clock.sh](2020/endoh3/run_clock.sh) which gave a +[Cody](#cody) fixed the script [run_clock.sh](/2020/endoh3/run_clock.sh) which gave a funny error when running it: ```sh @@ -3978,7 +3975,7 @@ quick. Cody also reported (during the preview period of 2020) for some systems (at some point?) like macOS the use of `make clock` would not work due possibly to a -timing issue so [Yusuke](#yusuke) changed it to compile the [clock.c](2020/endoh3/clock.c) +timing issue so [Yusuke](#yusuke) changed it to compile the [clock.c](/2020/endoh3/clock.c) file directly (this might have been fixed in the Makefile later on but it doesn't hurt to keep it in and this way it isn't a problem in any system). How Cody remembers this minor detail more than three years ago is something that @@ -3987,26 +3984,26 @@ something of his even a millimetre from where it was he knows it so he might be called unusual (and he argues, with pride, eccentric :-) ) :-) -## [2020/ferguson2](2020/ferguson1/prog.c) ([README.md](2020/ferguson1/README.md)) +## [2020/ferguson2](/2020/ferguson1/prog.c) ([README.md](/2020/ferguson1/README.md)) [Cody](#cody), with intentional irony here :-), fixed formatting, links and typos in various files. -He improved the [termcaps.c test utility](2020/ferguson1/termcaps.c), bug fixed -[play.sh](2020/ferguson1/play.sh), fixed other scripts and the Makefile, changed +He improved the [termcaps.c test utility](/2020/ferguson1/termcaps.c), bug fixed +[play.sh](/2020/ferguson1/play.sh), fixed other scripts and the Makefile, changed some files to be markdown (and fixed problems that he caused in doing so :-) ), fixed typos and formatting and he also fixed some issues that occurred when files were renamed to `.md` from `.markdown`. Most importantly he also added some corrections to the vital [Double -layered chocolate fudge cake recipe](2020/ferguson1/chocolate-cake.md) :-) +layered chocolate fudge cake recipe](/2020/ferguson1/chocolate-cake.md) :-) Yes the irony here is as rich as the chocolate cake: the question is do you know how rich it is? If not and you like chocolate I (that is Cody :-) ) highly recommend you give it a go! :-) -## [2020/ferguson2](2020/ferguson2/prog.c) ([README.md](2020/ferguson2/README.md)) +## [2020/ferguson2](/2020/ferguson2/prog.c) ([README.md](/2020/ferguson2/README.md)) [Cody](#cody), with intentional irony here :-), fixed formatting, links and typos in various files. @@ -4015,11 +4012,11 @@ He also fixed some issues that occurred when files were renamed to `.md` from `.markdown`. Most importantly he also added some corrections to the vital [Double -layered chocolate fudge cake recipe](2020/ferguson2/chocolate-cake.md), +layered chocolate fudge cake recipe](/2020/ferguson2/chocolate-cake.md), enciphered though it is :-) -## [2020/kurdyukov2](2020/kurdyukov2/prog.c) ([README.md](2020/kurdyukov2/README.md)) +## [2020/kurdyukov2](/2020/kurdyukov2/prog.c) ([README.md](/2020/kurdyukov2/README.md)) [Cody](#cody) added `-L`/`-I` paths to the Makefile to let this compile more easily if the user has installed the appropriate library with @@ -4027,9 +4024,9 @@ the user has installed the appropriate library with `/opt/local`). -## [2020/tsoj](2020/tsoj/prog.c) ([README.md](2020/tsoj/README.md)) +## [2020/tsoj](/2020/tsoj/prog.c) ([README.md](/2020/tsoj/README.md)) -[Cody](#cody) added [alternate code](2020/tsoj/README.md#alternate-code) that will feel +[Cody](#cody) added [alternate code](/2020/tsoj/README.md#alternate-code) that will feel more at home for vi users. One might still end up cursing (see the README.md file) but probably a lot less :-) @@ -4071,7 +4068,7 @@ There were some other fixes as well including mass typo fixes in the Makefiles worth noting in this case). Other times it was enabling or disabling the optimiser to fix an entry, sometimes causing other problems that also had to be fixed, a good example being [1986/marshall](#1986marshall-readmemd) (see the -[compilers.md](1986/marshall/compilers.md) for the amusing details and all that +[compilers.md](/1986/marshall/compilers.md) for the amusing details and all that had to be done to fix it). There was a 'problem' where `${MAKE}` was `$(MAKE)`: this doesn't break anything @@ -4122,21 +4119,21 @@ We call out the extensive contributions of [Cody Boone Ferguson](https://www.ioccc.org/winners.html#Cody_Boone_Ferguson) who is responsible for most of the improvements and fixes including many **EXTREMELY HARD bug fixes** like -[1988/phillipps](/thanks-for-fixes.md#1988phillipps-readmemd), -[1992/vern](/thanks-for-fixes.md#1992vern-readmemd), -[2001/anonymous](/thanks-for-fixes.md#2001anonymous-readmemd), -[2004/burley](/thanks-for-fixes.md#2004burley-readmemd) and -[2005/giljade](/thanks-for-fixes.md#2005giljade-readmemd), making entries like -[1985/sicherman](/thanks-for-fixes.md#1985sicherman-readmemd) and -[1986/wall](/thanks-for-fixes.md#1986wall-readmemd) not need `-traditional-cpp` +[1988/phillipps](/thanks-for-help.md#1988_phillipps), +[1992/vern](/thanks-for-help.md#1992_vern), +[2001/anonymous](/thanks-for-help.md#2001_anonymous), +[2004/burley](/thanks-for-help.md#2004_burley) and +[2005/giljade](/thanks-for-help.md#2005_giljade), making entries like +[1985/sicherman](/thanks-for-help.md#1985_sicherman) and +[1986/wall](/thanks-for-help.md#1986_wall) not need `-traditional-cpp` (all **EXTREMELY HARD**), fixing entries to work with clang (some being **EXTREMELY HARD** like -[1991/dds](/thanks-for-fixes.md#1991dds-readmemd)) or as much as possible (like -[1989/westley](/thanks-for-fixes.md#1989westley-readmemd), a true masterpiece +[1991/dds](/thanks-for-help.md#1991_dds) or as much as possible (like +[1989/westley](/thanks-for-help.md#1989_westley), a true masterpiece that is **INCREDIBLY HARD, _MUCH, MUCH MORE SO_ than any other fix!**), porting entries to macOS (some being **EXTREMELY HARD** like -[1998/schweikh1](/thanks-for-fixes.md#1998schweikh1-readmemd)), fixing code like -[2001/herrmann2](/thanks-for-fixes.md#2001herrmann2-readmemd) to work in both +[1998/schweikh1](/thanks-for-help.md#1998_schweikh1), fixing code like +[2001/herrmann2](/thanks-for-help.md#2001_herrmann2) to work in both 32-bit/64-bit which *can be* **EXTREMELY HARD**, providing alternate code where useful/necessary, fixing possible/removing dead links, typo/consistency fixes, improving **ALL _Makefiles_** and writing @@ -4151,10 +4148,10 @@ IOCCC winners and fixing almost all past entries for modern systems! [Yusuke Endoh](https://www.ioccc.org/winners.html#Yusuke_Endoh) supplied a number of important bug fixes to a number of past IOCCC winners. Some of those fixes were **EXTREMELY TECHNICALLY CHALLENGING** such as -[1989/robison](/thanks-for-fixes.md#1989robison-readmemd), -[1990/cmills](https://github.com/ioccc-src/temp-test-ioccc/blob/master/thanks-for-fixes.md#1990cmills-readmemd), -[1992/lush](/thanks-for-fixes.md#1992lush-readmemd) and -[2001/ctk](/thanks-for-fixes.md#2001ctk-readmemd). **THANK YOU VERY MUCH** for +[1989/robison](/thanks-for-help.md#1989_robison), +[1990/cmills](/thanks-for-help.md#1990_cmills), +[1992/lush](/thanks-for-help.md#1992_lush) and +[2001/ctk](/thanks-for-help.md#2001_ctk). **THANK YOU VERY MUCH** for your help! diff --git a/winners.html b/winners.html index 4bcdd6d7d..ca1d725a0 100644 --- a/winners.html +++ b/winners.html @@ -13,18 +13,22 @@ Contest

-The judges | IOCCC home page | -FAQ | -How to enter | -Contacting the IOCCC +Winning entries | +People who have won +

+IOCCC News | +How to enter the IOCCC | +FAQ

Known Bugs & (Mis)features | -Thanks for the fixes +Fixing IOCCC winners | +Fixing the web site | +Fixing winner info | +Thanks for the help

-IOCCC news | -People who have won | -Winning entries +The judges | +Contacting the IOCCC

[ diff --git a/years.html b/years.html index 07c83e454..0715ca21f 100644 --- a/years.html +++ b/years.html @@ -16,18 +16,22 @@ Contest


-The judges | IOCCC home page | -FAQ | -How to enter | -Contacting the IOCCC +Winning entries | +People who have won +

+IOCCC News | +How to enter the IOCCC | +FAQ

Known Bugs & (Mis)features | -Thanks for the fixes +Fixing IOCCC winners | +Fixing the web site | +Fixing winner info | +Thanks for the help

-IOCCC news | -People who have won | -Winning entries +The judges | +Contacting the IOCCC
[ 2020 | 2019 | 2018 | 2015 | 2014 | 2013 | 2012 | 2011 | 2006 | 2005 | 2004 | 2001 | 2000 | 1998 | 1996 | 1995 | 1994 | 1993 | 1992 | 1991 | 1990 | 1989 | 1988 | 1987 | 1986 | 1985 | 1984 | ALL ]
From b2442cac8c09425a0e46151ef1625c3d9117696b Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Thu, 7 Dec 2023 17:52:42 -0800 Subject: [PATCH 27/27] fix make clobber for 2015/howe --- 2015/howe/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2015/howe/Makefile b/2015/howe/Makefile index 6693bd75a..ca8e9a94a 100644 --- a/2015/howe/Makefile +++ b/2015/howe/Makefile @@ -213,7 +213,7 @@ clean: clobber: clean ${RM} -f ${TARGET} ${ALT_TARGET} ${RM} -rf *.dSYM - ${RM} -f curds.tmp nuked.tmp war-and-peace.txt whey.tmp makeholes + ${RM} -f curds.tmp nuked.tmp whey.tmp makeholes @-if [ -e sandwich ]; then \ ${RM} -f sandwich; \ echo 'ate sandwich'; \