Another unexplored topic in G'MIC : Cellular Automata

Cellular automata are generated pictures based on some sort of rules. I don’t know how to explain that better, so I will leave this source in which I used to based my code on - 1D Boolean Cellular Automata.

image

image

Reptorian's Cellular Automata Code
rep_cellular_automata:
skip ${2=}

channels 0

rule_decimal,min_arr_size=${1-2}

dec2bin $1 ('${}') -. 48 # Create Binary Array From Decimal Input
nm. rules

if narg($min_arr_size)
 if w<$min_arr_size
  r. $2,1,1,1,0,0,1
 fi
fi

repeat $!-1 l[$>,-1]
 ow,oh={w#0},{h#0}
 
 unroll[0] x
 iter={ceil(w#0/w#-1)}
 
 $ow,1,1,1,int(u(0,2))
 
 repeat $iter,p
 
  pos={$p*w}
  
  if !iv#-1 f. int(u(0,2)) fi
  
  {w},1,1,1,"begin(
   state(n)=i(#-1,n,0,0,0);
  );
  k=4*state((x-1+w)%w)+2*state(x)+state((x+1)%w);
  i(#-2,k,0,0,0);"
  
  j[0] [-1],$pos,0
  
  rm..
  
 done
 
 r[0] $ow,$oh,1,1,-1
 rm.
 
endl done

rm.
2 Likes