OK here is another Mutation: Pixel Life 2
Code: (Select All)
Option _Explicit
_Title "pixel Life 2" ' b+ 2023-10-15
' inspired by James Jarvis Pixel Life
Dim As Long XPixels, YPixels
XPixels = 401 ' so we can do perfect symmetry
YPixels = 401 ' ditto
Screen _NewImage(XPixels, YPixels, 12) ' the 12 only allows 16 colors
_ScreenMove 400, 150
Dim As Long s2, x, y, xx, yy, nc, gen
s2 = _NewImage(XPixels, YPixels, 12)
Do
_Dest 0
_PutImage , s2, 0
_Display
' update s2
_Source 0
_Dest s2
Line (0, 0)-(XPixels - 1, YPixels - 1), 9, B ' draw eternal white border seed and sun!
Line (1, 1)-(XPixels - 2, YPixels - 2), 0, BF ' clear inside
For y = 1 To YPixels - 2
For x = 1 To XPixels - 2
nc = 0
For yy = -1 To 1
For xx = -1 To 1
If Point(x + xx, y + yy) Then nc = nc + 1
Next
Next
If Point(x, y) Then nc = nc - 1
If nc = 2 Then
PSet (x, y), 9
ElseIf nc = 3 Then
PSet (x, y), 10
End If
Next
Next
gen = gen + 1
_Title "Gen:" + Str$(gen)
If gen < 300 Then _Limit 100 Else _Limit 1
Loop Until _KeyDown(27)
b = b + ...