Labels: text | screenshot | font | document OCR: Life is a sort of game, played with little one-cell beasties on a rectangular grid which live and die according to some specific rules : The number of neighbours of each cell is counted. Every cell one place to the left, right, up and down is a neighbour, so are the cells that are next to the four corners of the cell. 0 If an existing cell has 2 or 3 neighbours, it will survive. 0 If an empty space has exactly 3 neighbours, there will grow Every other cell will die, and every other empty place will a cell. remain empty. Blitter based life simulation from Tomas Rockicki Revision History : And again. Speeds up assembly another 15%. Try life -r25 -t -h64 -v50 xmp/r for kicks. (Add -a if you have a 68020 or 68030.) And another version. Adds torus option to assembly version. Fixes couple of minor things. Yet another version. This one adds the `-a' option which means use the processor instead of the blitter for the LIFE calculations. Makes things run faster on 68020 and 68030 Amigas. This is a new version of my ancient LIFE program, significantly hacked and added to. It is by no means in a final state, but it since no one else has presented a nice LIFE environment, it will have to do. Some example input files have been provided as well, in a new (not another!) macro language that I hacked together one day many days ago. It requires operation from the CLI. First, let's run it. Simply change directories to the life directory on the disk, and type, for instance, life xmp/r That's all there is to it! Hit Q, ESC, X, or ^C to exit. Some other sample command lines are: life -h xmp/acorn life -o -t -p2 xmp/bomb ; be patient! life -r100 -h xmp/bcity ; be patient! The rest of this documentation has three parts: an explanation of the command line arguments, an explanation of the keyboard command keys during the run of the program, and an explanation of the macro language. This is the usage line of the program. Note that all parameters must not be separated from their option letter by a space; use -h352 instead of -h 352. life [-h[n]] [-r[n]] [-pn] [-o] [-t] [-v[n]] [-s] [infile] -h This option sets hires mode. The optional parameter sets the horizontal resolution to something other than 640; it must be a multiple of 16. Actually, if the parameter is less than 400, low res is assumed . Set a cell randomly every generation. If a parameter is supplied, it indicates how long to delay in generations before setting each cell; - r10 sets a random cell every 10 generations. Set the number of bitplanes to use. Orify; this option allows cells to leave 'tracks', so you can trace the glider guns and the like. You *must* use at least -p2 with this option. Wrap the screen as in a torus. Fu Set the vertical resolution. If the supplied parameter is greater than 300, the screen is set to interlace. S Do not start computing until the appropriate keyboard key is hit. Which brings us to the keyboard command options. These keys should be hit during the programs execution. Q, X, C, ESC Exit the program. Because the explanation is so simple but there are so many keys, I need to add this nonsense sentence so the do documentation looks pretty. 0, G Go! Run at full speed. Stop. Wait for one of the keystroke commands to continue. SPACE Execute a single generation and then stop. Useful for single-stepp ing. 2, Insert a delay between generations; slow things down enough so you 4. can watch comfortably. The actual delay inserted can be calculated 6 by the formula (2^n)/50, in seconds, where n is the key pressed. This allows delays from 1/25 of a second between generations, all way to 10.24 seconds between generations. Ahh, now we get to the hard part, documenting the macro language which is used to set up initial generations. This command language is based somewhat on Logo (remember multitasking Color Computer Logo?) All whitespace is ignored. All caps are converted to lowercase. Comments are enclosed in < and >. The turtle starts in the middle of the screen, facing up, with the pen down. The basic commands are: Move forward one cell, setting the current cell if the pen is down. Turn towards the right. Turn towards the left. Turn facing the other direction. Lift the pen off the paper. Put the pen on the paper. The commands take a single argument, as well. For instance, 10 f moves forward 10 times, setting cells if the pen is down. Parentheses group actions, which can be repeated. For instance, 10 ( fr f 1 ) with the pen down draws a staircase pattern, by moving forward, then right, then forward, then left, 10 times. This grouping is nestable. Go to the x location supplied as a parameter. Go to the y location supplied as a parameter. Flip left and right. If executing again, things go back to normal. + Make right be the normal right, undoing any effects of the above. Move forward without setting any cells, ignoring the current pen. Move forward, setting the current cell, ignoring the current pen. Brackets ([]) push and pop a location stack. The things saved and restored are the x and y location, the direction, whether 'right' means a real right or a left (from the - command), and the pen state. Thus, you can do things like: 10 ( [ 10 * ] r . 1 ) to draw a 10 by 10 filled block. That 'r . l' sequence occurs often enough that the command ',' is used for it. This way, you can draw pictures in your editor. To draw a glider, you might use: [ *** ] Easy enough, eh? One last thing. You can even define single-character macros! If you use that glider often enough, you can make it a macro by simply using the '=' command. You must assign it to something grouped in parenthesis. So, g [ *** ] sets `g' to be a glider macro. Each time you use g in your script file, a glider will be drawn. Note that it is good practice to enclose your macro definitions with [ and ], hence the brackets above. There is a handful of examples provided. No apologies are made for the cryptic command language or the single character macros supplied.