Fixes in 2001/cheong (URL, format, other things)
Format fix 2001/cheong/README.md. Roll back one of the fixes. INABIAF :-) The only fix necessary is letting it work with clang. The feature is in bugs.md (will likely crash without an arg). Update dead link in README.md, winners.html and winners.csv. He has his own domain now (was at university). I was able to verify it's his website even though he didn't mention the IOCCC because he also referred to the university he went to which we knew. No longer refer to the university in the README.md file either.
This commit is contained in:
1 parent
85842bfc7c
commit
de0ad77672
5 files changed
+40
-22
No files matched your search
+30
-19
@@ -1,10 +1,8 @@
|
|||||||
# Best short program
|
# Best short program
|
||||||
|
|
||||||
Raymond Cheong
|
Raymond Cheong
|
||||||
Johns Hopkins University
|
US
|
||||||
USA
|
<http://www.raymondcheong.com/index.html>
|
||||||
|
|
||||||
http://www.bme.jhu.edu/~rcheong/
|
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
@@ -15,9 +13,9 @@ make
|
|||||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to work with
|
[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,
|
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
|
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
|
match the format and because it's pain that clang forces this. :-) This fix
|
||||||
a segfault in the case that no arg is specified. Thank you Cody for your
|
makes a point of the author's notes on portability no longer valid, btw. Thank
|
||||||
assistance!
|
you Cody for your assistance!
|
||||||
|
|
||||||
|
|
||||||
## To run:
|
## To run:
|
||||||
@@ -26,6 +24,11 @@ assistance!
|
|||||||
./cheong digits
|
./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:
|
## Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -34,6 +37,8 @@ assistance!
|
|||||||
./cheong 05305265226926441255040573044986873789
|
./cheong 05305265226926441255040573044986873789
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Judges' remarks:
|
||||||
|
|
||||||
Be sure to give an even number of digits in the argument. Add a
|
Be sure to give an even number of digits in the argument. Add a
|
||||||
leading 0 if needed.
|
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:
|
Strict compiling gives just one unavoidable warning:
|
||||||
|
|
||||||
> gcc -ansi -Wall cheong.c
|
```sh
|
||||||
cheong.c:3: warning: third argument of `main' should probably be `char **'
|
gcc -ansi -Wall cheong.c
|
||||||
|
cheong.c:3: warning: third argument of `main' should probably be `char **'
|
||||||
|
```
|
||||||
|
|
||||||
### Obfuscation
|
### Obfuscation
|
||||||
|
|
||||||
The main obfuscation is the algorithm used to calculate square roots,
|
The main obfuscation is the algorithm used to calculate square roots,
|
||||||
sometimes known as the longhand method. The basic algorithm is itself
|
sometimes known as the longhand method. The basic algorithm is itself
|
||||||
obfuscated in that it only uses subtraction to calculate square roots.
|
obfuscated in that it only uses subtraction to calculate square roots.
|
||||||
(For a detailed explanation, check Google or see Jack Crenshaw's article
|
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
|
at
|
||||||
more obscured version which includes the following:
|
<https://web.archive.org/web/20011215124349/http://www.embedded.com/98/9802fe2.htm>.
|
||||||
|
|
||||||
|
This program uses an even more obscured version which includes the following:
|
||||||
|
|
||||||
- A single string is used to store two numbers of different lengths
|
- 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
|
- 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
|
- Subtraction is done addition style, i.e. `4 - 8` equals `6` carry a `-1`
|
||||||
- Recursive calls to main()
|
- Recursive calls to `main()`
|
||||||
|
|
||||||
|
#### Minor obfuscations:
|
||||||
|
|
||||||
Minor obfuscations:
|
|
||||||
- Self documenting whitespace in rectangular code block, for fun and glory (view
|
- Self documenting whitespace in rectangular code block, for fun and glory (view
|
||||||
with fixed-width font)
|
with fixed-width font)
|
||||||
- Integer constants adjusted to less meaningful values, just for added confusion
|
- Integer constants adjusted to less meaningful values, just for added confusion
|
||||||
- Hard-to-read, meaningless variable names to spite the reader
|
- Hard-to-read, meaningless variable names to spite the reader
|
||||||
|
|
||||||
Challenges for the masses:
|
#### 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?
|
- 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?
|
- How does the program terminate?
|
||||||
- Is the programmer sane? ;-)
|
- Is the programmer sane? ;-)
|
||||||
|
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ c=o+ (D[I]+82)%10-(I>l/2)*
|
|||||||
:!(o=pain(c/10,O,I-1))*((c+999
|
:!(o=pain(c/10,O,I-1))*((c+999
|
||||||
)%10-(D[I]+92)%10);}return o;}
|
)%10-(D[I]+92)%10);}return o;}
|
||||||
int main(int o,char **O) {
|
int main(int o,char **O) {
|
||||||
return O[1]?pain(o, O, l):1; }
|
return pain(o, O, l); }
|
||||||
@@ -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
|
a certain gcc version is necessary but it might be helpful to download and
|
||||||
compile that version to test it.
|
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
|
# 2002
|
||||||
|
|
||||||
There was no IOCCC in 2002.
|
There was no IOCCC in 2002.
|
||||||
|
|||||||
+1
-1
@@ -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);
|
Pierre-Philippe Coupard,Pierre-Philippe_Coupard,null,null,pierre@lineo.com,null,null);
|
||||||
Qiming HOU,Qiming_HOU,null,null,hqm03ster@gmail.com,null,null);
|
Qiming HOU,Qiming_HOU,null,null,hqm03ster@gmail.com,null,null);
|
||||||
Raphael Meyer,Raphael_Meyer,null,null,null,US,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);
|
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);
|
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);
|
Roemer B. Lievaart,Roemer_B._Lievaart,http://huizen.dds.nl/~lievaart,null,roemer.lievaart@xs4all.nl,null,null);
|
||||||
|
|||||||
|
Can't render this file because it contains an unexpected character in line 23 and column 6.
|
+1
-1
@@ -278,7 +278,7 @@ Contest </I></FONT></CENTER><BR>
|
|||||||
<LI TYPE=square>Best of show - abuse of libc (<A HREF="years.html#2020_carlini">2020 carlini</A>)
|
<LI TYPE=square>Best of show - abuse of libc (<A HREF="years.html#2020_carlini">2020 carlini</A>)
|
||||||
</UL><BR>
|
</UL><BR>
|
||||||
|
|
||||||
<LI TYPE=none><A NAME="Raymond_Cheong"></A><B><a href="mailto:rcheong@jhu.edu">Raymond Cheong</a></B> -- <A HREF="//www.bme.jhu.edu/~rcheong/">//www.bme.jhu.edu/~rcheong/</a>
|
<LI TYPE=none><A NAME="Raymond_Cheong"></A><B><a href="mailto:rcheong@jhu.edu">Raymond Cheong</a></B> -- <A HREF="http://www.raymondcheong.com/index.html">http://www.raymondcheong.com/index.html</a>
|
||||||
<UL>
|
<UL>
|
||||||
<LI TYPE=square>Best Abuse of CPP (<A HREF="years.html#2000_primenum">2000 primenum</A>)
|
<LI TYPE=square>Best Abuse of CPP (<A HREF="years.html#2000_primenum">2000 primenum</A>)
|
||||||
<LI TYPE=square>Best short program (<A HREF="years.html#2001_cheong">2001 cheong</A>)
|
<LI TYPE=square>Best short program (<A HREF="years.html#2001_cheong">2001 cheong</A>)
|
||||||
|
|||||||
Reference in new issue
Block a user