the simulation of life

Hi I am suposed to write this program for school , I am confused I dont know where to start can someone give me a little direction please.
Thank you
Bianka

Write a program to implement the simulation of life as described in Scientific American by Martin Gardner. The program will be implemented on a two dimensional surface of size 80 by 80 visible elements. The rules of the simulation are as follows:

1)An initial set of cells are marked as “alive” by the user. This is generation 0. Your program will ask the user to input a set of row and column values to let the user determine which cells are “alive”. Display this generation.
2)Cells change for each succeeding generation by the following rules:
a.A living cell dies of overcrowding in the next generation if it currently has 4 or more living neighbors.
b.A living cell dies of loneliness in the next generation if it currently has only 0 or 1 living neighbors.
c.An empty cell becomes a “birth” cell (becomes alive) in the next generation if it has exactly 3 living neighbors.
d.All other cells remain unchanged.
3)The new generation becomes the current generation and is displayed.
4)After displaying each new generation, ask the user if they wish to continue to the next generation or stop at this point.
The LIFE program! I can't help you program it, but I know it's been done before many, many times and I'm sure a Google search will dig up something. I remember playing with these when I was a kid. If you knew how, you could create a matrix of "cells" which would morph and grow, then spit out a "cannonball" cell that would move slowly across the screen (or, at least it looked like it was moving. New cells were born in the "forward" direction and old cells died in the "backward" direction, so it looked like a little animated ball that was moving).

Sounds dificult but thank you for the tip Merak. I will keep working on it.
It's impossible to help because you have not said what the problem is. Simply saying you don't know where to start is a rather large space of possibilities! What are you programming it in (in particular is it graphical)? Do you know what a 2-dimensional array is?
Last edited on
Topic archived. No new replies allowed.