Cellular Automaton for BZ reactions

I made cellular automaton program for BZ reactions according to Dewdney's "Computer Recreation".  Example of usage of the program is as follows.

Variables of the program gotta are
	system: number of elements a rows and a columns in rectangular lattice, 
	state: number of states, 
	k1, k2, g: constants, 
	nRepeat: number of iterations.

gotta[system_,  state_,  k1_,  k2_,  g_,  nRepeat_] := 
        Module[{init,  updt,  func}, 
init  =  
            Table[Random[
                Integer,  {0,  
                  state}], {system}, {system}]; 
updt[
              lst_] := Module[{}, 
MapThread[
                func, {lst,  RotateRight[lst,  {0, 1}],  
                  RotateRight[lst,  {0,  -1}],  
                  RotateRight[lst,  {1, 0}],  
                  RotateRight[lst,  {-1, 0}],  
                  RotateRight[lst,  {1, 1}],  
                  RotateRight[lst,  {1,  -1}],  
                  RotateRight[lst,  {-1, 1}],  
                  RotateRight[lst,  {-1, -1}]},  
                2]
]; 
func[
              xy_ /;  xy  ==  state,  xmy_,  xpy_,  xym_,  xyp_,  
              xmym_,  xpym_,  xmyp_,  xpyp_] := 
            0; 
func[xy_ /;  xy  ==  0,  xmy_,  
              xpy_,  xym_,  xyp_,  xmym_,  xpym_,  xmyp_,  xpyp_] := 
            Module[{tmplst,  a,  
                b},  
tmplst = {xmy,  xpy,  xym,  
                  xyp,  xmym,  xpym,  xmyp,  
                  xpyp}; 
b  =  
                Count[tmplst, state]; 
a  =  
                Count[tmplst,  
                  x_ /;  0 < x < state]; 
  
Floor[
                  a/k1] + 
                Floor[b/k2]
]; 
func[
              xy_,  xmy_,  xpy_,  xym_,  xyp_,  xmym_,  xpym_,  
              xmyp_,  xpyp_] := 
            Module[{tmplst,  s,  a,  b,  
                tmp},  
tmplst = {xmy,  xpy,  xym,  
                  xyp,  xmym,  xpym,  xmyp,  
                  xpyp}; 
b  =  
                Count[tmplst, state]; 
a  =  
                Count[tmplst,  
                  x_ /;  0 < x < state]; 
  
s  =  
                xy  +  Total[tmplst]; 
tmp  =  
                Floor[s/(a + b + 1)]  +  g; 
If[
                tmp  >  state,  state,  
                tmp]
]; 
NestList[updt, 
            init,  nRepeat]
];

Map[
          ArrayPlot[#,  
              ColorFunction -> (Hue[2/3 - #/200. ] &) ] &,  
          gotta[50,  200,  3,  3,  45,  200]]; // Timing