fix .gitignore, Makefile and README.md for /2019/dogon

This commit is contained in:
Landon Curt Noll committed 2023-03-25 02:28:06 -07:00
1 parent 9799758c7d
commit fe10437f5c
3 files changed
+178 -362

No files matched your search

+30 -23
View File
@@ -1,35 +1,34 @@
# Best use of space and time
Gil Dogon
Gil Dogon
# To build:
## Judges' comments:
```sh
make
```
## To build:
### To run:
make all
### To use:
./prog < pattern.mc
NOTE: this entry will likely segfault under macOS if you even get it to compile.
```sh
./prog < pattern.mc
```
### Try:
./prog < glider.mc
```sh
./prog < glider.mc
./prog < infinite_5x5.mc
./prog < infinite_5x5.mc
./prog < mosquito5.mc
# Press the minus key a few times until you see white specks,
# then press space, and the ] key a few times.
./prog < mosquito5.mc
# Press the minus key a few times until you see white specks,
# then press space, and the ] key a few times.
./prog < message.mc
./prog < message.mc
```
### Selected Judges Remarks:
## Judges' comments:
[1991/davidguy](http://ioccc.org/years.html#1991_davidguy),
[2011/blakely](http://ioccc.org/years.html#2011_blakely),...
@@ -52,10 +51,13 @@ We truly have not much more to add, except two things:
In the interest of saving lives, this entry was not fuzzed.
## Author's comments:
### What is it?
Just run with no arguments on an X11-compatible system using one of the supplied input .mc files as standard input. Press '-' several time to zoom out if neccessary, then press space. For acceleration press ']' several times. Thats rather quick dont you think?
### Historical Timeline.
* 3.5 Billion years ago: Microrganism life appears on earth
* 3000 BC: Ankh symbol is used in Egyptian hyroglyphs to represent life.
* 1940s: John Von Neumann and Stanislav Ulam are interested in artificial life eventually kick starting research on Cellular Automata.
@@ -68,6 +70,7 @@ Just run with no arguments on an X11-compatible system using one of the supplied
Which brings us to the present moment in time.
### Full documentation and keys UI.
Yes, this program is Conway's game of life graphic simulator implementing Bill Gosper's hash life algorithm. The entry's UI is rather terse and somewhat obfuscated, as it should be. Also, when you accidentally, or not, press any of the keys not specified bellow, some stuff will happen or not, there is no guarantee whatsoever.
The program should be used as follows:
@@ -85,8 +88,8 @@ Notice that when going backward in time we ignore current timestep setting and j
There is a minimal text printout by the program, so you can know what Generation your are in(G:), Internal memory allocated till now (M:), and then which Level is the current macrocell (L) and which zoom Scale you are watching (S).
### Portability issues.
This entry is quite portable hopefully on most modern platforms. It assumes X Window support of course. More than 2GBytes memory is recommended. Configuration through makefile is provided for the display windows size and for the memory usage. The makefile provided configuration (Z=0x20000000) will need a system with 4GB DRAM to run nicely. There are several other salient assumptions though:
* The entry assumes sizeof(long)=8. However it actually almost avoids using any pointers which are 64 bits this days, in order to save space. On machines with sizeof(long)=4 try adding #define long long long ...
@@ -95,6 +98,7 @@ This entry is quite portable hopefully on most modern platforms. It assumes X Wi
* The entry heavily relies on bit complement arithmetic (you dont say!).
### Limitations.
Foremost the entry is very strict, unsafe and picky regarding its input. Anything straying from the standard Golly macrocell legal format will result in undefined behavior, meaning mostly a very defined core dump. Since aforementioned core is rather large by default (about 4Gb) it is highly recommended to 'set limit coredumpsize 0' in the shell before playing with fire ...
This entry needs quite a lot of memory to be effective, but by modern standards that is not too much. It does not do any garbage collection, so sooner or later memory will run out, resulting, surprise, surprise, in a core dump. On the plus side, this enables the nice time reversal feature... Anyway the amount of memory used can be controlled by the Makefile -DZ=... argument. With the default Z, the program will support in total about 240 million 64bit longs for the internal memory, which should be sufficient for about 100 million nodes+leafs, as each node is 3 longs and each leaf is 2.
@@ -107,6 +111,7 @@ In case cell memory did not run out, or your pattern did not grow too big, and y
If all of the above did not happen and result in the expected core dump, you will encounter the final limitation, which is the absence of an escape key. Just close the window or use ^C to exit ....
### Warnings.
Oh don't get me started on the torrent of litanies gcc emits when used with -Wall ! Does it think I have not memorized by heart C's precious operator precedence table (or at least have a cheatsheet nearby) that it dares suggest extra parentheses that would take the program over the limit ? And what if I do not use a variable here or there, do I have to pay extra tax for every orphaned variable?
There is the reasonable warning about some longs printed as ints but its OK too, trust me.
@@ -114,14 +119,17 @@ There is the reasonable warning about some longs printed as ints but its OK too,
Then there's the warning about 'gets' being unsafe, which is indeed the only one that appears by default in some versions of gcc linker. Yes Virginia, I know it is unsafe, and I would not recommend anyone using this entry as part of a web daemon, or a spaceship, no, Seriously Dont do that!
### Obfuscations.
Well almost none of the obfuscations are done on purpose, but mostly out of necessity, so all identifiers possible to be one character, are, and they are mercilessly reused. In the main There's even a nice little identifier first used as a global and then reused (shadowed) in the *same* scope, and this did not produce even a lile squeak of a warning from the compiler! Macro compression is raher sparingly used, however Magic numbers abound everywhere, and bit twiddling is magical too. Do you know for example why we have unsigned F=-1 ? (No warning there of course :) Hint:Later in the program you have F/=17. Did that make any sense? Further hint: print the resulting F in hexadecimal...
And yes, the layout hint involves a mix of the most trendy typographical character juxtaposed against a very ancient one, Not to mention the program includes some famous name dropping and documents itself as usual.
### Further spoilers, engineering, and obfuscation galore.
Those wait for you, curious and interpid reader, in the attached apohlife.c file, Which is a partially obfuscated version of the program I wrote with a lot of helpful annotations and comments for myself and posterity, revealing some of the magic under the hood. This program is also a somewhat improved version which uses ldexps in the draw routine and has bigger constants, so it can zoom up to level 1024 if memory allows, and it tries its best to avoid dumping core on the poor user when its memory runs out, rather it enters freeze mode where you can still travel in calculated frozen space-time. Well, its no nice and tame, it even has an escape key, usage message, and to top it all it even avoids gets!
### Special thanks.
To Tom Rockiki, the original co-writer of Golly, a personal friend and hashlife master, who reviewed some earlier versions of the entry and freely shared some of his vast knowledge regarding GOL programming and hashlife. As a free bonus, Tom has allowed me to show his code which is probably the most efficient yet most obfuscated way of calculating the GOL function on a 64 bits 8*8 leaf:
````c
@@ -129,11 +137,10 @@ unsigned long life8x8(long a) { unsigned long aw = a << 1, ae = a >> 1, s0 = aw
````
This uses only 19 bitwise operations and six shifts to calculate the inner 6x6 next generation bits of the input 8x8 !
--------------------------------------------------------------------------------
<!--
## Copyright:
(c) Copyright 1984-2019, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
[judges]: http://www.ioccc.org/judges.html
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
-->