Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Life Experiments
#6
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 + ...
Reply


Messages In This Thread
Life Experiments - by bplus - 08-18-2022, 05:27 PM
RE: Life Experiments - by vince - 08-18-2022, 09:53 PM
RE: Life Experiments - by bplus - 08-18-2022, 10:24 PM
RE: Life Experiments - by vince - 08-18-2022, 10:45 PM
RE: Life Experiments - by bplus - 08-19-2022, 02:15 PM
RE: Life Experiments - by bplus - 08-19-2022, 02:26 PM



Users browsing this thread: 3 Guest(s)