diff --git a/1985/lycklama/.gitignore b/1985/lycklama/.gitignore index 57b8242ed..2bc187781 100644 --- a/1985/lycklama/.gitignore +++ b/1985/lycklama/.gitignore @@ -1 +1,2 @@ lycklama +lycklama.alt diff --git a/1985/lycklama/Makefile b/1985/lycklama/Makefile index de594d275..408c5e08c 100644 --- a/1985/lycklama/Makefile +++ b/1985/lycklama/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=0 +CDEFINE= -DZ=500 # Include files that are needed to compile # diff --git a/1985/lycklama/README.md b/1985/lycklama/README.md index 6a1f47686..42ccb7f61 100644 --- a/1985/lycklama/README.md +++ b/1985/lycklama/README.md @@ -8,19 +8,14 @@ Ed Lycklama make all ``` - -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: +If you have an old enough compiler you can try: ```sh -make CDEFINE+="-DZ=700" clobber all +make lycklama.orig ``` -Thank you Yusuke! + + ## To run: @@ -28,6 +23,10 @@ Thank you Yusuke! ./lycklama < some_file ``` +There is an alternate version which slows down the output for a more fun display +with modern systems. For this reason we encourage you to try that version +as well. See Alternate code section below. + ## Try: ```sh @@ -40,20 +39,29 @@ Thank you Yusuke! ./lycklama < Makefile -make CDEFINE+="-DZ=700" clobber all && ./lycklama < lycklama.c ``` + ### Alternative code: -If you have an older compiler that lets you define some object to `#define` and -then use it in place of `#define` you can run: +This alternate version slows down the output which will provide more fun +output. The default time passed to `usleep(3)` is `500` but you can reconfigure +it like: + ```sh -make alt +make CDEFINE+="-DZ=700" clobber alt ``` -Use `./lylycklama.alt` as you would `./lycklama` above. +Use `./lycklama.alt` as you would `./lycklama` above. +#### Try: + +```sh +./lycklama.alt < lycklama.alt.c +./lycklama.alt < lycklama.orig.c +./lycklama.alt < Makefile +``` ## Judges' remarks: diff --git a/1985/lycklama/lycklama.alt.c b/1985/lycklama/lycklama.alt.c index d7a3776fd..72a594f36 100644 --- a/1985/lycklama/lycklama.alt.c +++ b/1985/lycklama/lycklama.alt.c @@ -1,16 +1,16 @@ #define o define -#o ___o write -#o ooo (unsigned) -#o o_o_ 1 -#o _o_ char -#o _oo goto -#o _oo_ read -#o o_o for -#o o_ main -#o o__ if -#o oo_ 0 -#o _o(_,__,___)(void)___o(_,__,ooo(___)) -#o __o (o_o_<<((o_o_<<(o_o_<