ofile := "/tmp/eca.jbv" ;; gbf grid = < d ; 100 d > ;; S0 := map((fun x -> random(2)), iota(100, seq:())) following |d> ;; fun nth_bit(num,n) = if n == 0 then num%2 else nth_bit(num/2,n-1) fi ;; trans rules[number = 90] = { b => nth_bit(number, 4*neighbor(,b)) } ;; fun output(S) = ( for i = 0 to 100 do if S.(i * |d>) == 1 then ofile << " { " << i << " " << iteration << " 0 0 0 } " fi; S ) ;; ofile << " { " ;; rules[iter = 100, prelude = output, interlude = output, postlude = output ](S0) ;; ofile << " }\n" ;;