Usage: Life1D <rows> <rule> This program simulates 1D Life: the simplest class of one-dimensional cellular automata in a <ROWS=rows+1> x <COLS=2*rows+1> grid starting with a single live cell in the middle of the top row using rule <rule>. These 1D rules are defined in Wolfram's Elementary Cellular Automata: http://mathworld.wolfram.com/ElementaryCellularAutomaton.html This program will print to stdout data in plain PBM file format. This output can be easily viewed using the xv command or converted to a another format using the pbmto* and ppmto* utilities. A plain ascii PBM file can be created by adding a header line "P1 <WIDTH> <HEIGHT>" and followed by a grid of data (0 = dead = black, 1 = live = white). A call to "man pbm" can help answer questions about about the format. Add a comment on the first line with a brief description of the image. Arguments: <rows> is a positive integer specifying the number of rows to generate (not counting the first "seed row" which is all dead except for a central live cell). The columns are computed automatically -- enough so that the rule, if it were to grow in the normal triangular pattern, would just perfectly reach the edge. Off the board is considerered "dead". <rule> is a number from 0-255 specifying the rule to use Examples: See Rule 60 : http://mathworld.wolfram.com/Rule60.html unix% Life1D 3 60 P1 7 4 ## 3 rows of Life1D (Rule 60) by Yourfirstname Yourlastname 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 See Rule 90 : http://mathworld.wolfram.com/Rule90.html unix% Life1D 5 90 P1 11 6 ## 5 rows of Life1D (Rule 90) by Yourfirstname Yourlastname 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 1 See Rule 250 : http://mathworld.wolfram.com/Rule250.html unix% Life1D 4 250 P1 9 5 ## 4 rows of Life1D (Rule 250) by Yourfirstname Yourlastname 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
unix% Life1D 3 60 | ppmtogif > Life1D_3_60.gifHere are the gifs resulting from the examples above:
Life1D 3 60 | Life1D 5 90 | Life1D 4 250 |