diff --git a/1984/mullender/.gitignore b/1984/mullender/.gitignore index 2ac371f2a..a179ef9ac 100644 --- a/1984/mullender/.gitignore +++ b/1984/mullender/.gitignore @@ -8,6 +8,5 @@ indent.c indent.o mullender mullender.alt -mullender.alt2 mullender.orig prog.orig diff --git a/1984/mullender/Makefile b/1984/mullender/Makefile index d7ed0b158..3ac7d5d80 100644 --- a/1984/mullender/Makefile +++ b/1984/mullender/Makefile @@ -112,8 +112,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}.alt.o ${PROG}.alt2.o -ALT_TARGET= ${PROG}.alt ${PROG}.alt2 +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt ################# diff --git a/1984/mullender/README.md b/1984/mullender/README.md index 06542c3bb..8b7513dea 100644 --- a/1984/mullender/README.md +++ b/1984/mullender/README.md @@ -26,16 +26,18 @@ For more detailed information see [1984 mullender in bugs.md](/bugs.md#1984-mull ```sh ./mullender.alt [microseconds] - -./mullender.alt2 [microseconds] # starts over after it times out ``` -The default microseconds is 10000 and it is also the lowest it can be as any -lower doesn't work very well. This feature is so you can experiment with -different speeds in between writes. It can be useful if your CPU is too slow or -too fast (:-) ). +Hit ctrl-c/intr to exit the program. -The author stated that the original version also had a delay. +The default microseconds is 190000 as this is approximately how long it slept in +the original entry but it can be no lower than 5000 as any lower doesn't work +very well. This feature is so you can experiment with different speeds in +between writes. It can be useful if your CPU is too fast :-) + +The author stated that the original version also had a delay but the difference +is it required one to hit enter for it to print another line; the alt code will +start over once it times out or if one hits a key. Note that the microseconds is argc and it uses `atoi()` which does NOT check for overflow! @@ -49,15 +51,11 @@ which is probably not as uncommon as you think :-). ```sh ./mullender.alt -./mullender.alt 5000 +./mullender.alt 5000 # wait for 5000 microseconds and see what happens -./mullender.alt 500 +./mullender.alt 20000 # wait for 20000 microseconds and see what happens -./mullender.alt 20000 - -./mullender.alt 100000 - -./mullender.alt2 500 # wait for 500 microseconds and see what happens +./mullender.alt 100000 # wait for 100000 microseconds and see what happens ``` What happens if you hit enter after it reaches the end of the line? Why? What diff --git a/1984/mullender/mullender.alt.c b/1984/mullender/mullender.alt.c index b9dce50b1..4054309c2 100644 --- a/1984/mullender/mullender.alt.c +++ b/1984/mullender/mullender.alt.c @@ -1 +1 @@ -main(i,v)char**v;{i=v[1]?atoi(v[1]):10000;i=i<500?500:i;do write(1," :-)\b\b\b\b",9),usleep(i);while(--i);write(1,"\n",1);} +main(i,v)char**v;{j:i=v[1]?atoi(v[1]):190000;i=i<5000?5000:i;do write(1," :-)\b\b\b\b",9),usleep(i);while(--i);write(1,"\n",1);goto j;} diff --git a/1984/mullender/mullender.alt2.c b/1984/mullender/mullender.alt2.c deleted file mode 100644 index e6d26d829..000000000 --- a/1984/mullender/mullender.alt2.c +++ /dev/null @@ -1 +0,0 @@ -main(i,v)char**v;{j:i=v[1]?atoi(v[1]):10000;i=i<500?500:i;do write(1," :-)\b\b\b\b",9),usleep(i);while(--i);write(1,"\n",1);goto j;} diff --git a/thanks-for-help.md b/thanks-for-help.md index 3e5b6a6f2..1cf1a7eec 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -130,15 +130,15 @@ This was fixed on 30 October 2023 after the bug status was changed from INABIAF ## [1984/mullender](/1984/mullender/mullender.c) ([README.md](/1984/mullender/README.md])) -[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 -starts over after it times out. +[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. It moves at approximately the same speed as the original +did. We also refer you to the [FAQ](faq.md) as there are some winning entries +that also let one enjoy it (which through trial and error was how the right +speed was discovered) - with more to them of course! The difference between the +original is that it will start over after it times out but that might not happen +with the original (might need you to press a key though this is not known for +sure). 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