# Conway's Game of Life



## JBCM627 (Oct 23, 2008)

So I just made a really random connection, and thought of a good (imo) name for some of the OLL shapes: what Bob calls the "awkward" shapes. And I thought this merited its own thread.

anyway, one of my first C++ programs was to code this game and a few variations on the rules, etc... although, that was last year, so I don't know why I just realized this.

Per Conway's game of life, I'd like to suggest "glider" shapes:







PS, Lucas or other Stanford people, as an interesting site note, you can make Karel play with a fixed board size, although I doubt you'll take CS106a there 
Edit: That is, you can make Karel play without using any variables.


----------



## Lucas Garron (Oct 23, 2008)

JBCM627 said:


> PS, Lucas or other Stanford people, as an interesting site note, you can make Karel play with a fixed board size, although I doubt you'll take CS106a there


Only because I'm taking 106x instead. 
Our Assignment 1.
Also, I've met Conway, and recently had Donald Knuth walk by a discussion of our assignment 1 and talk to us about Golly. 
(Oh, and if there's anyone else on speedsolving.com at Stanford, I'd like to know.)

Anyhow, I'd like the name "glider" for those OLLs, if I had any interest in OLL. I suggest naming them correctly, though (that is, the shapes with 5 LL colors facing up).


Also, not a permanent link, but http://archive.garron.us/code/2008/life_final.cpp.
Also, if you wanna try the compiled version: http://archive.garron.us/code/2008/lg_life.exe


----------



## JBCM627 (Oct 23, 2008)

Haha, nice:


> How fast would you like to run the simulation?
> 0: Frank Morris speed. (Faster than possible.)
> 1: Rowe Hessler speed. (As fast as possible.)
> 2: Nakajima speed. (With a slight pause after each step.)
> ...



I'll have to post my version tomorrow (its not on this computer). Its command line, but it has a few variations on the rules, including sets that generates "mazelike" structures, amoeba structures, and some other interesting things. There are a few preprogrammed arrangements, like the glider guns.

A good applet with traditional rules is here: http://www.math.com/students/wonders/life/life.html


----------



## Lewis (Oct 23, 2008)

I've been interested in Conway's Game of Life since I was about 9, mainly creating objects and patterns. I haven't yet written my own program though. I've got close to a gigabyte of Game of life patterns, software etc. on my computer that has gathered over time!
I've also always referred to that OLL situation as the glider.

Does anyone know of any Game of Life forums anywhere?


----------



## pjk (Oct 23, 2008)

I thought about that a couple years ago when I was dealing with Conway's Game of Life. I had to write the game as well for a college course I took in high-school, except I did it in Java.


----------



## rjohnson_8ball (Oct 23, 2008)

Soon after the game was mentioned in Scientific American in the late 70's or early 80's, I made a computer program for it. I had to rewrite it a few years back. I use the "curses" library, displaying "@" characters for life. I use the window width and height, and let things connect left/right and top/bottom (toroidal space). The initial pattern starts as about 40% life, randomly assigned in the window. (Time of day determines the starting seed for random number generator.) I display the "generation count" on the corner of the screen. It's cool to sometimes get life that hits 1000 generations before dying or becoming stable.

My original version would detect "stable" life by recording its state every 16 generations and seeing if the state changed from 16 generations ago.

I had this grand idea of mass producing large panels, connecting many together into home murals or highway billboards. The random seeds of life could be derived from background music.


----------



## Lewis (Oct 23, 2008)

rjohnson_8ball said:


> It's cool to sometimes get life that hits 1000 generations before dying or becoming stable.




Try drawing this pattern in a program, It runs for close to 30,000 generations. Each dot is an 'off' cell, each * is an 'on' cell.

```
..........***..
...............
...........**.*
............*.*
..............*
...............
.*.............
*.*............
.*.............
```


----------



## rjohnson_8ball (Oct 23, 2008)

@Lewis, Does your drawing indicate the precise width and height? Is it toroidal space with left/right, top/bottom connected?


----------



## JBCM627 (Oct 24, 2008)

Version I made last year:

http://thewonderidiot.net/timer/CSE/life.cpp
http://thewonderidiot.net/timer/CSE/life.exe

Fairly simple and straightforward. Its completely command line, so you'll need to have the size of your terminal/prompt large enough so larger grids will work - over 200 chars/line is best for the largest grid. You can hold down Enter to "animate" it.

Some cool scenarios:
"Diamoeba" rule on a 100x100 random grid with half of it populated
"Flakes" with a small cluster of points on a large grid (try infinite life or acorn)
"Maze" on a random grid, less than half populated, or "infinite life" pattern
"Walled Cities" on a large random grid about 1/5 populated


----------



## Escher (Oct 24, 2008)

not massively relevant, but is it just me who can see tetris pieces flying around in that animation...?


----------



## Neroflux (Oct 24, 2008)

tetris has 4 pieces. this thing has 5.


----------



## Escher (Oct 24, 2008)

yes. that is true.
that does not detract from the fact that the S and 2 L shapes are clearly visible.


----------



## Lewis (Oct 24, 2008)

rjohnson_8ball said:


> @Lewis, Does your drawing indicate the precise width and height? Is it toroidal space with left/right, top/bottom connected?



The pattern would have to be in the middle of a very large grid (500x500) with dead cells surrounding it in order to run for the full length. Try copying and pasting the pattern into this program.


----------

