Almost same thing with 5 cells above looking at sums 1,2 or3 opposed to 0, 4 or 5
Code: (Select All)
_Title "Cellular first 3 of 5 Rule"
Screen _NewImage(1300, 700, 32)
_ScreenMove 40, 0
DefLng A-Z
s = 2
n = 1300 / s - 2
Dim a(0 To n + 1), ng(0 To n + 1)
a(n / 2) = 1
y = 0
While y < 700
For i = 2 To n - 2
sum = a(i - 2) + a(i - 1) + a(i) + a(i + 1) + a(i + 2)
If sum = 0 Or sum = 4 Or sum = 5 Then
ng(i) = 0
Line (i * s, y)-Step(s, s), &HFF000000, BF
ElseIf sum = 1 Or sum = 2 Or sum = 3 Then
ng(i) = 1
Line (i * s, y)-Step(s, s), , BF
End If
Next
y = y + s
For i = 1 To n
a(i) = ng(i)
Next
Wend
Sleep
b = b + ...