N = 150 : M = 150 : P = 0.03 : F = 0.00003 dim f(N+2,M+2) # 1 tree, 0 empty, 2 fire dim fn(N+2,M+2) graphsize N,M fastgraphics for x = 1 to N for y = 1 to M if rand<0.5 then f[x,y] = 1 next y next x while True for x = 1 to N for y = 1 to M if not f[x,y] and rand