This is a simple implementation of Conway's game of Life with an endless world.

The program outputs an animation of the game. how long the simulation will run. Takes as input the width and height of the universe, followed by the pattern (which is terminated by the end of file). | | | * | The nXn grid also gets a# new border of empty cells, which just makes the test simpler# for determining what do with a cell on each generation.# It would be better to let the user move the cursor and click# on cells to create/delete living cells, but this version# Simple-minded procedure to 'play' Life from a starting grid.# Compute one generation of Life from the current one.# Return the number of living cells surrounding the current cell.# Check to see if all the cells have died or we've exceeded the // x and y reversed to draw matrix like it looks in source// import all lodash functions to the main namespace, but isNaN not to cause conflicts// let world = map(range(WORLD_WIDTH), partial(ary(map, 2), range(WORLD_HEIGHT), partial(random, 0, 1, false)));"Usage: %s [acorn|growth|blinker|engine|line|rabbits|random] width height\n"% Populate the binary lattice with the Gosper Glider/* REXX ---------------------------------------------------------------'Create a file containing the pattern to be processed''named somename.in (octagon.in such as this for the octagon):''Run the program by entering "rexx conlife somename [pause]"''(pause is the amount of milliseconds between 2 pictures. sequence of n boards evolving from it. or by calling animation(n; sleep) with sleep approximately equal to the number of milliseconds between refreshes. 4 0 obj the entire array cycling through the eight positions of the neighbors.! | | Sample output contains 3 generations of the blinker and 5 of the glider: %%----------------------------------------------------------------------%%----------------------------------------------------------------------%% Main procedure: generate n generations of life and store each file. Enter spacebar to continue or pause, ESC to stop"' UNTIL press = CHR(27) 'return to do loop up top until "esc" key is pressed." |.......#............| |..#..#.#............| |.......#............| |..#...#.............| -}# This procedure reads in the initial pattern, inserting it# into an nXn grid of cells. | |

in a A version using the boardless approach.

Here's the gridless version. You have to figure out how to use your enemies once they are petrified: turn them into platforms or transform them into projectiles.

| | %% Create a subfolder where your gol.pl resides and place  %% your initial PBM '0.0000.pbm' inside . Running this program will compute and draw the first 300 "frames". %% You need to adjust the number of zeros after . %% read_pbm( +File path, +Grid size, -List 2D )  %%----------------------------------------------------------------------%%----------------------------------------------------------------------%% Morph simple list into a 2-dimensional one with size GS x GS  %% nest( ?List simple, ?Grid size, ?2D list )  %%----------------------------------------------------------------------%%----------------------------------------------------------------------%% Write a GS x GS 2-dimensional list into a 2bit Protable Bitmap.
<< A more recent (and cleaner) implementation of this algorithm can be found here: life.c 1.8. filled with random cells,

generation 3:
other games in the distribution. | | Download the full demo here:… << Random universe!###########################################################################! /Group 22 0 R must be as long as the number of  %% generations. >> %����