home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff131.lzh / Life / README < prev    next >
Text File  |  1988-03-14  |  5KB  |  137 lines

  1. This is a new version of my ancient LIFE program, significantly hacked and
  2. added to.  It is by no means in a final state, but it since no one else has
  3. presented a nice LIFE environment, it will have to do.  Some example input
  4. files have been provided as well, in a new (not another!) macro language
  5. that I hacked together one day many days ago.  It requires operation from
  6. the CLI.
  7.  
  8. First, let's run it.  Simply change directories to the life directory on
  9. the disk, and type, for instance,
  10.  
  11.     life xmp/r
  12.  
  13. That's all there is to it!  Hit Q, ESC, X, or ^C to exit.  Some other
  14. sample command lines are:
  15.  
  16.     life -h xmp/acorn
  17.     life -o -t -p2 xmp/bomb
  18.     life -r100 -h xmp/bcity  ; be patient!
  19.  
  20. The rest of this documentation has three parts:  an explanation of the
  21. command line arguments, an explanation of the keyboard command keys during
  22. the run of the program, and an explanation of the macro language.  This
  23. is the usage line of the program.  Note that all parameters must not be
  24. separated from their option letter by a space; use -h352 instead of -h 352.
  25.  
  26.     life [-h[n]] [-r[n]] [-pn] [-o] [-t] [-v[n]] [-s] [infile]
  27.  
  28. -h    This option sets hires mode.  The optional parameter sets the
  29.     horizontal resolution to something other than 640; it must be
  30.     a multiple of 16.  Actually, if the parameter is less than 400,
  31.     low res is assumed.
  32.  
  33. -r    Set a cell randomly every generation.  If a parameter is supplied,
  34.     it indicates how long to delay in generations before setting each
  35.     cell; -r10 sets a random cell every 10 generations.
  36.  
  37. -p    Set the number of bitplanes to use.
  38.  
  39. -o    Orify; this option allows cells to leave `tracks', so you can trace
  40.     the glider guns and the like.  You *must* use at least -p2 with this
  41.     option.
  42.  
  43. -t    Wrap the screen as in a torus.
  44.  
  45. -v    Set the vertical resolution.  If the supplied parameter is greater
  46.     than 300, the screen is set to interlace.
  47.  
  48. -s    Do not start computing until the appropriate keyboard key is hit.
  49.  
  50. Which brings us to the keyboard command options.  These keys should be hit
  51. during the programs execution.
  52.  
  53. Q, X,    Exit the program.  Because the explanation is so simple but there
  54. ^C, ESC    are so many keys, I need to add this nonsense sentence so the docs
  55.     documentation looks pretty.
  56.  
  57. 0, G    Go!  Run at full speed.
  58.  
  59. S    Stop.  Wait for one of the keystroke commands to continue.
  60.  
  61. SPACE    Execute a single generation and then stop.  Useful for single-stepping.
  62.  
  63. 1, 2,    Insert a delay between generations; slow things down enough so you
  64. 3, 4,    can watch comfortably.  The actual delay inserted can be calculated
  65. 5, 6,    by the formula (2^n)/50, in seconds, where n is the key pressed.
  66. 7, 8,    This allows delays from 1/25 of a second between generations, all the
  67. 9    way to 10.24 seconds between generations.
  68.  
  69. Ahh, now we get to the hard part, documenting the macro language which is
  70. used to set up initial generations.  This command language is based somewhat
  71. on Logo (remember multitasking Color Computer Logo?)  All whitespace is
  72. ignored.  All caps are converted to lowercase.  Comments are enclosed in
  73. < and >.  The turtle starts in the middle of the screen, facing up, with
  74. the pen down.  The basic commands are:
  75.  
  76. f    Move forward one cell, setting the current cell if the pen is down.
  77. r    Turn towards the right.
  78. l    Turn towards the left.
  79. b    Turn facing the other direction.
  80. u    Lift the pen off the paper.
  81. d    Put the pen on the paper.
  82.  
  83. The commands take a single argument, as well.  For instance,
  84.  
  85.     10 f
  86.  
  87. moves forward 10 times, setting cells if the pen is down.
  88.  
  89. Parentheses group actions, which can be repeated.  For instance,
  90.  
  91.     10 ( f r f l )
  92.  
  93. with the pen down draws a staircase pattern, by moving forward, then right,
  94. then forward, then left, 10 times.  This grouping is nestable.
  95.  
  96. x    Go to the x location supplied as a parameter.
  97. y    Go to the y location supplied as a parameter.
  98. -    Flip left and right.  If executing again, things go back to normal.
  99. +    Make right be the normal right, undoing any effects of the above.
  100. .    Move forward without setting any cells, ignoring the current pen.
  101. *    Move forward, setting the current cell, ignoring the current pen.
  102.  
  103. Brackets ([]) push and pop a location stack.  The things saved and restored
  104. are the x and y location, the direction, whether `right' means a real right
  105. or a left (from the - command), and the pen state.  Thus, you can do things
  106. like:
  107.  
  108.     10 ( [ 10 * ] r . l )
  109.  
  110. to draw a 10 by 10 filled block.  That `r . l' sequence occurs often enough
  111. that the command `,' is used for it.  This way, you can draw pictures in
  112. your editor.  To draw a glider, you might use:
  113.  
  114.     [.*.],
  115.     [..*],
  116.     [***]
  117.  
  118. Easy enough, eh?  One last thing.  You can even define single-character
  119. macros!  If you use that glider often enough, you can make it a macro by
  120. simply using the `=' command.  You must assign it to something grouped in
  121. parenthesis.  So,
  122.  
  123. = g ( [
  124.    [.*.],
  125.    [..*],
  126.    [***]
  127.    ] )
  128.  
  129. sets `g' to be a glider macro.  Each time you use g in your script file, a
  130. glider will be drawn.  Note that it is good practice to enclose your macro
  131. definitions with [ and ], hence the brackets above.
  132.  
  133. There is a handful of examples provided.  No apologies are made for the
  134. cryptic command language or the single character macros supplied.
  135.  
  136. Enjoy!  Bugs to Tomas Rokicki, Box 2081, Stanford, CA  94309.
  137.