Merge pull request #226 from xexyl/1984-mullender-alt

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-03-31 07:20:40 -07:00
commit e4d89c29de
4 files changed
+50 -10

No files matched your search

+1 -1
View File
@@ -137,7 +137,7 @@ alt: data ${ALT_TARGET}
@${TRUE}
${ALT_TARGET}: ${PROG}.alt.c
${CC} -include stdio.h -include unistd.h ${CFLAGS} $< -o $@ ${LIBS}
${CC} -include stdio.h -include unistd.h -include stdlib.h ${CFLAGS} $< -o $@ ${LIBS}
# data files
#
+32 -5
View File
@@ -20,20 +20,45 @@ Robbert van Renesse
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) added the alternative
code which lets you run this on other systems. He notes though that this was
only a slight fix to the change in the [faq](/faq.md). Thank you Cody for your
assistance!
only a slight fix and enhancement to the change in the [faq](/faq.md). Thank you
Cody for your assistance!
To build:
### To build:
make alt
Use `./mullender.alt` as you would `./mullender` above.
### To run:
./mullender.alt [microseconds]
The default microseconds is 10000. This ability is so you can experiment with
different speeds in between writes. It can be useful if your CPU is too slow or
too fast.
BTW: is there such a thing as too fast a CPU ? :-) actually yes for certain code
which is probably not as uncommon as you think :-) ).
Note that it is an int and it uses `atoi()` which does NOT check for
overflow! In fact it's argc itself.
### Try:
./mullender.alt
./mullender.alt 5000
./mullender.alt 500
./mullender.alt 20000
What happens if you hit enter after it writes a line of output?
## Judges' comments:
Without question, this C program is the one of the most obfuscated
C program that has ever been received! Like all great contest
entries, they result in a change of rules for the following year.
@@ -55,6 +80,8 @@ makes direct calls to the write() Unix system call to produce a
message on the screen. Can you guess what is printed? We knew you
couldn't! :-)
BTW: this remains my (Landon Curt Noll's) all time favorite entries!
## Author's comments:
These comments, found at
+1 -1
View File
@@ -1 +1 @@
main(){int i=10000;do write(1," :-)\b\b\b\b",9),usleep(i);while(--i);}
main(i,v)char**v;{i=v[1]?atoi(v[1]):10000;do write(1," :-)\b\b\b\b",9),usleep(i);while(--i);}
+16 -3
View File
@@ -41,9 +41,13 @@ can enjoy this entry. Try:
```sh
make alt
./mullender.alt
./mullender.alt [microseconds]
```
The microseconds defaults to 10000.
Thank you Cody!
See also [Yusuke Endoh](/winners.html#Yusuke_Endoh)'s entry
[2015/endoh3](/2015/endoh3/README.md) entry which lets one compile it and run
it.
@@ -353,15 +357,24 @@ try the alternative code added by [Cody Boone Ferguson](/winners.html#Cody_Boone
```sh
make alt
./mullender.alt
./mullender.alt [microseconds]
```
where microseconds is the number of microseconds to sleep between writes.
Default 10000. This is useful to see different speeds as well as if your CPU is
too slow or too fast for the entry. See the
[README.md](/1984/mullender/README.md) for more details.
Thank you Cody for your help!
BTW: in this case it's a slight adjustment to our original suggested code:
BTW: in this case it's a slight fix and improvement to our original suggested
code:
main(){int i=512;do write(1," :-)\b\b\b\b",9),usleep(i);while(--i);}
BTW: is there such a thing as too fast a CPU ? :-) actually yes for certain code
which is probably not as uncommon as you think :-) ).
break;
- case [1991/davidguy](years.html#1991_davidguy): disable access