In fact here is a quick and dirty solution - you can tell how long it took me by the time between posts (and Id like to point out Im talking with Adam in the background !!!)

Code:

unit Unit1;
interface
uses
graphics, Classes, ExtCtrls,forms;
type
TCells = array of array of boolean;
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
cells :tcells;
function CountNeighbours(x,y:integer) : integer;
public
{ Public declarations }
end;
const XWIDTH = 100;
YWIDTH = 100;
CELLWIDTH = 5;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.CountNeighbours(x, y: integer): integer;
var i,j:integer;
begin
result:=0;
for i := -1 to 1 do
for j := -1 to 1 do
if ((not ((i=0) and (j=0))) and (x+i>=0) and (y+j>0) and (x+i<XWIDTH) and (y+j<
YWIDTH) and cells[x+i,y+j]) then inc(result);
end;
procedure TForm1.FormCreate(Sender: TObject);
var i,j:integer;
begin
randomize;
setlength(cells,XWIDTH,YWIDTH);
for i := 0 to XWIDTH-1 do
for j :=0 to YWIDTH-1 do
cells[i,j]:=random(100)>49;
end;
procedure TForm1.FormPaint(Sender: TObject);
var i,j:integer;
begin
for i := 0 to XWIDTH-1 do
for j :=0 to YWIDTH-1 do
begin
if cells[i,j] then
canvas.Brush.Color:=clred
else
canvas.Brush.Color:=Color;
canvas.FillRect(rect(i*(CELLWIDTH+1),j*(CELLWIDTH+1),(i*(CELLWIDTH+1))+
CELLWIDTH,(j*(CELLWIDTH+1))+CELLWIDTH));
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var tmpcells :tcells;
i,j:integer;
n : integer;
begin
setlength(tmpcells,XWIDTH,YWIDTH);
for i := 0 to XWIDTH-1 do
for j :=0 to YWIDTH-1 do
begin
n:=CountNeighbours(i, j);
if (((n=2) and cells[i,j]) or (n=3) ) then
tmpcells[i,j]:=true
else
tmpcells[i,j]:=false;
end;
cells:=tmpcells;
paint;
end;
end.