Merge pull request #1073 from xexyl/1985-lycklama-alt
This commit is contained in:
2 files changed
+51
-34
No files matched your search
+48
-29
@@ -1,14 +1,15 @@
|
||||
# Strangest appearing program
|
||||
# Strangest appearing program
|
||||
|
||||
Ed Lycklama
|
||||
Ed Lycklama<br>
|
||||
|
||||
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make all
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
If you have an old enough compiler you can try:
|
||||
|
||||
```sh
|
||||
@@ -19,49 +20,67 @@ make lycklama.orig
|
||||
## To run:
|
||||
|
||||
```sh
|
||||
./lycklama < some_file
|
||||
./lycklama.alt < 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.
|
||||
|
||||
To see why we recommend the alternate version instead of the original version,
|
||||
see below and the [original code](#original-code) section.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./lycklama < lycklama.c
|
||||
|
||||
# notice the difference between the above and this one:
|
||||
./lycklama < lycklama.alt.c
|
||||
# also try:
|
||||
./lycklama < lycklama.orig.c
|
||||
|
||||
./lycklama < README.md
|
||||
|
||||
./lycklama < Makefile
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Alternative code:
|
||||
|
||||
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:
|
||||
This alternate version, which we recommend you you try first, prior to the
|
||||
original, so that you can see what it does in modern systems, slows down the
|
||||
output which will provide more fun output. It is slowed down by the `usleep(3)`
|
||||
library call with a configurable time to sleep. The default is 500 but you can
|
||||
reconfigure it like:
|
||||
|
||||
|
||||
```sh
|
||||
make CDEFINE+="-DZ=700" clobber alt
|
||||
```
|
||||
|
||||
#### Try:
|
||||
which would set it at 700. Then, whether you use the default value or not, try:
|
||||
|
||||
```sh
|
||||
./lycklama.alt < lycklama.c
|
||||
|
||||
# notice the difference between the above and this one:
|
||||
./lycklama.alt < lycklama.alt.c
|
||||
|
||||
# also try:
|
||||
./lycklama.alt < lycklama.orig.c
|
||||
|
||||
./lycklama.alt < README.md
|
||||
|
||||
./lycklama.alt < Makefile
|
||||
|
||||
```
|
||||
|
||||
### Original code:
|
||||
|
||||
As explained above, because modern systems run this entry way too fast to fully
|
||||
appreciate what it does, we encourage you to first try the alternate version.
|
||||
After this, however, you might wish to try the original version, fixed for
|
||||
modern systems. To do this:
|
||||
|
||||
```sh
|
||||
make all
|
||||
```
|
||||
|
||||
#### To use:
|
||||
|
||||
|
||||
```sh
|
||||
./lycklama < some_file
|
||||
```
|
||||
|
||||
#### Try:
|
||||
|
||||
```sh
|
||||
./lycklama < lycklama.c
|
||||
./lycklama < lycklama.alt.c
|
||||
./lycklama < lycklama.orig.c
|
||||
./lycklama < Makefile
|
||||
```
|
||||
|
||||
|
||||
|
||||
+3
-5
@@ -170,9 +170,7 @@ gave to have fun with finding primes that might seem unusual in a way.
|
||||
Cody fixed this to compile with modern compilers. In the past one could get away
|
||||
with defining some macro to `#define` and then use `#foo` to have the same
|
||||
effect as using `#define` but this does not work in modern systems so Cody
|
||||
changed the `#o` lines to `#define`. The
|
||||
[lycklama.alt.c](1985/lycklama/lycklama.alt.c) is the original source
|
||||
code as it provides some fun input for the entry.
|
||||
changed the `#o` lines to `#define`. Also `unistd.h` had to be `#include`d.
|
||||
|
||||
Yusuke provided some useful information that amounts to an alternate version
|
||||
that Cody added. See the README.md for details.
|
||||
@@ -346,7 +344,7 @@ README.md file for more details.
|
||||
## [1988/phillipps](1988/phillipps/phillipps.c) ([README.md](1988/phillipps/README.md]))
|
||||
|
||||
Cody fixed this for modern systems. It did not compile with clang because it
|
||||
requires the second and third args to `main()` to be `char **` but even before
|
||||
requires the second and third args of `main()` to be `char **` but even before
|
||||
that with gcc it printed random characters. After fixing it for clang by
|
||||
changing `main()` to call the new function `pain()` (chosen because it's a pain
|
||||
that clang requires these args to be `char **` :-) ) with the correct args it
|
||||
@@ -376,7 +374,7 @@ thank him for this ghastly point! :-)
|
||||
## [1988/westley](1988/westley/westley.c) ([README.md](1988/westley/README.md]))
|
||||
|
||||
The [original version](1988/westley/westley.alt.c), provided as alternate code,
|
||||
was fixed by Misha Dynin, based on the judges' remarks so that this would work
|
||||
was fixed by Misha Dynin, based on the judges' remarks, so that this would work
|
||||
with modern C compilers. We encourage you to try the alternate version to see
|
||||
what happens with current compilers! See the README.md files for details.
|
||||
|
||||
|
||||
Reference in new issue
Block a user