WindowTitle "J.-H. CONWAY´s 'LIFE'":font 2:randomize
var n%=20'40'55' 'Pure XProfan-11.2a Version
var m%=30'168'40'55'168 '(CL) 2018-04 P.Specht, Wien
declare f%[n%-1,m%-1,2],i%,j%,g%,h%,s%,ip%,im%,jp%,jm% :Label:
WindowStyle 24:cls''Window 0,0-%maxx,%maxy:showmax
if rnd()<0.6:whileloop 0,n%-1:i%=&Loop:Whileloop 0,m%-1:j%=&Loop
case rnd()<0.125:f%[i%,j%,g%]=1:endwhile:endwhile:endif'Random
f%[2,2,0]=1:f%[2,3,0]=1:f%[2,4,0]=1'Blinker + 2 Glider:
f%[7,9,0]=1:f%[8,9,0]=1:f%[9,9,0]=1:f%[7,10,0]=1:f%[8,11,0]=1
f%[11,9,0]=1:f%[12,9,0]=1:f%[13,9,0]=1:f%[13,10,0]=1:f%[12,11,0]=1
REPEAT:h%=not(g%):locate 1,1:whileloop 0,n%-1:i%=&Loop
ip%=i%+1:case ip%>(n%-1):ip%=0:im%=i%-1:case im%<0:im%=n%-1
:whileloop 0,m%-1:j%=&Loop
IF f%[i%,j%,g%]:print "o";:else :print chr$(183);:endif
jp%=j%+1:case jp%>(m%-1):jp%=0:jm%=j%-1:case jm%<0:jm%=m%-1
s%=f%[ip%,jp%,g%]+f%[ip%,j%,g%]+f%[ip%,jm%,g%]+f%[i%,jm%,g%]\
+f%[im%,jm%,g%]+f%[im%,j%,g%]+f%[im%,jp%,g%]+f%[i%,jp%,g%]
case (s%<2) or (s%>3):f%[i%,j%,h%]=0
case (s%=2) or (s%=3):f%[i%,j%,h%]=f%[i%,j%,g%]
case s%=3:f%[i%,j%,h%]=1:endwhile:print
endwhile:g%=not(g%):waitinput 42:UNTIL %key:goto "Label"