Add optional usleep() to 1985/lycklama

With a tip from Yusuke Endoh I noticed that if you slow down the call to
write() you see some fun output. Now to make it as close to possible as
the original (there already is alt code! - mostly for fun display) I
don't call usleep() unless the macro Z is not 0. This way someone can
do:

    make CDEFINE+="-DZ=1000" clobber all

for example but if they just do make clobber all it won't be slow at all
or it'll be as slow as it takes the CPU to run it.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-27 06:15:55 -07:00
1 parent 4d1c601010
commit 6aa1141e29
3 files changed
+16 -3

No files matched your search

+1 -1
View File
@@ -58,7 +58,7 @@ ARCH=
# Defines that are needed to compile
#
CDEFINE=
CDEFINE= -DZ=0
# Include files that are needed to compile
#
+14 -1
View File
@@ -13,7 +13,20 @@ make all
modern compilers. In the past 'define' in `#define` could even be defined but to
get this to work on modern systems Cody changed the `#o` lines to `#define`. The
`lycklama.alt.c` is the original source code as it provides some fun input for
the entry.
the entry. Thank you Cody! With a tip from [Yusuke
Endoh](/winners.html#Yusuke_Endoh) it was indirectly noticed that if one slows
down the call to `write()` one can see some fun output that's not visible with
modern systems so Cody added a call to `usleep()`. The default time is `0`
which disables it (in order to make it as close to original as possible; an alt
version already exists mostly for fun output). In order to change the speed (try
500 or 700) do:
```sh
make CDEFINE+="-DZ=700" clobber all
```
Thank you Yusuke!
## Try:
+1 -1
View File
@@ -9,7 +9,7 @@
#define o_ main
#define o__ if
#define oo_ 0
#define _o(_,__,___)(void)___o(_,__,ooo(___))
#define _o(_,__,___)(void)___o(_,__,ooo(___),Z&&usleep(Z))
#define __o (o_o_<<((o_o_<<(o_o_<<o_o_))+(o_o_<<o_o_)))+(o_o_<<(o_o_<<(o_o_<<o_o_)))
o_(){_o_ _=oo_,__,___,____[__o];_oo ______;_____:___=__o-o_o_; _______:
_o(o_o_,____,__=(_-o_o_<___?_-o_o_:___));o_o(;__;_o(o_o_,"\b",o_o_),__--);