diff --git a/2001/cheong/README.md b/2001/cheong/README.md index 1a7cfaa49..f21626ebe 100644 --- a/2001/cheong/README.md +++ b/2001/cheong/README.md @@ -1,10 +1,8 @@ # Best short program - Raymond Cheong - Johns Hopkins University - USA - - http://www.bme.jhu.edu/~rcheong/ +Raymond Cheong +US + ## To build: @@ -15,9 +13,9 @@ make [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) 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 letter word that would -match the format and because it's pain that clang forces this. :-) He also fixed -a segfault in the case that no arg is specified. Thank you Cody for your -assistance! +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. Thank +you Cody for your assistance! ## To run: @@ -26,6 +24,11 @@ assistance! ./cheong digits ``` +### INABIAF - it's not a bug it's a feature! :-) + +This program will very likely crash or do something different without an arg. + + ## Try: ```sh @@ -34,6 +37,8 @@ assistance! ./cheong 05305265226926441255040573044986873789 ``` +## Judges' remarks: + Be sure to give an even number of digits in the argument. Add a leading 0 if needed. @@ -64,32 +69,38 @@ This program runs normally on any ANSI C compiler and is ASCII dependent. Strict compiling gives just one unavoidable warning: - > gcc -ansi -Wall cheong.c - cheong.c:3: warning: third argument of `main' should probably be `char **' +```sh +gcc -ansi -Wall cheong.c +cheong.c:3: warning: third argument of `main' should probably be `char **' +``` ### Obfuscation The main obfuscation is the algorithm used to calculate square roots, sometimes known as the longhand method. The basic algorithm is itself obfuscated in that it only uses subtraction to calculate square roots. -(For a detailed explanation, check Google or see Jack Crenshaw's article -at http://www.embedded.com/98/9802fe2.htm) This program uses an even -more obscured version which includes the following: +For a detailed explanation, check Google or see Jack Crenshaw's article +at +. + +This program uses an even more obscured version which includes the following: - A single string is used to store two numbers of different lengths - Operations are done in a weird hybrid of base 10 and base 20 -- Subtraction is done addition style, i.e. 4 minus 8 equals 6 carry a -1 -- Recursive calls to main() +- Subtraction is done addition style, i.e. `4 - 8` equals `6` carry a `-1` +- Recursive calls to `main()` + +#### Minor obfuscations: -Minor obfuscations: - Self documenting whitespace in rectangular code block, for fun and glory (view with fixed-width font) - Integer constants adjusted to less meaningful values, just for added confusion - Hard-to-read, meaningless variable names to spite the reader -Challenges for the masses: -- What are the meanings [sic, plural] of the variable o? -- Why is (c+999)%10-(D[I]+92)%10 not equivalent to (c-D[I]+7)%10? +#### Challenges for the masses: + +- What are the meanings [sic, plural] of the variable `o`? +- Why is `(c+999)%10-(D[I]+92)%10` not equivalent to `(c-D[I]+7)%10`? - How does the program terminate? - Is the programmer sane? ;-) diff --git a/2001/cheong/cheong.c b/2001/cheong/cheong.c index dbd583fe6..97fef5f18 100644 --- a/2001/cheong/cheong.c +++ b/2001/cheong/cheong.c @@ -11,4 +11,4 @@ c=o+ (D[I]+82)%10-(I>l/2)* :!(o=pain(c/10,O,I-1))*((c+999 )%10-(D[I]+92)%10);}return o;} int main(int o,char **O) { -return O[1]?pain(o, O, l):1; } +return pain(o, O, l); } diff --git a/bugs.md b/bugs.md index 82a6c2fa6..b54593530 100644 --- a/bugs.md +++ b/bugs.md @@ -1087,6 +1087,13 @@ The author said that they compiled it with [gcc version a certain gcc version is necessary but it might be helpful to download and compile that version to test it. + +## [2001/cheong](2001/cheong/cheong.c) ([README.md](2001/cheong/README.md)) +## STATUS: INABIAF - please **DO NOT** fix + +This program will very likely crash or do something different without an arg. + + # 2002 There was no IOCCC in 2002. diff --git a/tmp/winners.csv b/tmp/winners.csv index c2a0ff300..a8e9f731d 100644 --- a/tmp/winners.csv +++ b/tmp/winners.csv @@ -153,7 +153,7 @@ Philip Blakely,Philip_Blakely,null,null,pmblakely@gmail.com,Cambridge, UK Pierre-Philippe Coupard,Pierre-Philippe_Coupard,null,null,pierre@lineo.com,null,null); Qiming HOU,Qiming_HOU,null,null,hqm03ster@gmail.com,null,null); Raphael Meyer,Raphael_Meyer,null,null,null,US,null); -Raymond Cheong,Raymond_Cheong,//www.bme.jhu.edu/~rcheong/,null,rcheong@jhu.edu,null,null); +Raymond Cheong,Raymond_Cheong,http://www.raymondcheong.com/index.html,rcheong@jhu.edu,null,null); Robbert van Renesse,Robbert_van_Renesse,http://www.cs.cornell.edu/home/rvr,null,rvr@cs.cornell.edu,null,null); Robert Heckendorn,Robert_Heckendorn,http://www.cs.colostate.edu/~heckendo/main.html,null,null,null,null); Roemer B. Lievaart,Roemer_B._Lievaart,http://huizen.dds.nl/~lievaart,null,roemer.lievaart@xs4all.nl,null,null); diff --git a/winners.html b/winners.html index 04aef6139..7d26669a9 100644 --- a/winners.html +++ b/winners.html @@ -278,7 +278,7 @@ Contest
  • Best of show - abuse of libc (2020 carlini)
    -
  • Raymond Cheong -- //www.bme.jhu.edu/~rcheong/ +
  • Raymond Cheong -- http://www.raymondcheong.com/index.html