MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Creating Raster Image Animation

  • To: mathgroup at
  • Subject: [mg21854] Creating Raster Image Animation
  • From: Mike Fuller <mmfuller at>
  • Date: Wed, 2 Feb 2000 22:54:13 -0500 (EST)
  • Organization: University of New Mexico, Albuquerque
  • Sender: owner-wri-mathgroup at

I'm trying to get a graphical representation of a cellular automata to work.
I've implemented Conway's Game of Life using code provided by Gaylord et al.
The code creates a matrix showing the location of "living" and "dead" cells.
This program works fine. But I'm having trouble getting an animated
representation to work. When I try to evaluate the output from the Game,
using a separate program, it simply produces the same output as the Game (a
matrix of values). Does anyone have any idea how I can modify the code to my
ShowLife program (below) get the desired result?


 Here's the code for the CA:

LifeGame[s_, t_]:=
    Module[{initconfig, livingNghbrs, update},
      initconfig = Table[Random[Integer], {s}, {s}];
      livingNghbrs[mat_] :=
        Apply[Plus, Map[RotateRight[mat, #]&,
      update[1,2]:= 1;
      update[_,3]:= 1;
      update[_,_]:= 0;
      FixedPointList[update[#, livingNghbrs[#]]&,
                       initconfig, t]]

And here's the code for the graphic animation:

ShowLife[list_, opts__Rule]:=
            {1-> RGBColor[1,0,0],
            0-> RGBColor[0,0,0]}]],
        AspectRatio-> Automatic, opts]])&,

  • Prev by Date: Re: Fitting a function to a list (newbie)
  • Next by Date: Re: Evaluating a Notebook down to a selected point (without mousing)?
  • Previous by thread: Re: NDSolve and numeric-only computation
  • Next by thread: Re: Creating Raster Image Animation