05-19-2022, 08:25 PM
And here is another Ashish fractal I started playing around with:
Just another b+ mod
Code: (Select All)
_Title "Carbonated Circles Fractal by bplus 2017-10-15"
' working from Ashish simple Circle Fractal
Const xmax = 660
Const ymax = 700
DefInt A-Z
Screen _NewImage(xmax, ymax, 32)
_Delay .8 'sorry, my system needs .6 delay for _MIDDLE, yours may NOT
_ScreenMove _Middle ' not working with 32 in line above
Randomize Timer
Common Shared cx(), cy(), cr(), ci
ReDim cx(0): ReDim cy(0): ReDim cr(0)
r1 = 150: basey = ymax - r1 - 10
drawCircle xmax / 2, basey, r1
antigravity = -.6
nb = 60
Dim bx(nb), by(nb), br(nb), bdy(nb)
Dim bc&(nb)
For i = 1 To nb
r = rand%(1, ci)
bx(i) = cx(r): by(i) = rand(0, basey): br(i) = cr(r): bdy(i) = rand(-4, -2)
bc&(i) = _RGB(Rnd * 155 + 100, Rnd * 155 + 100, Rnd * 155 + 100)
Next
Cls
Do
While 1
Cls
For i = 1 To ci
Color &HFF88DDDD
Circle (cx(i), cy(i)), cr(i)
Next
For i = 1 To nb
Color bc&(i)
Circle (bx(i), by(i)), br(i)
If by(i) - 4 + br(i) < 0 Then
r = rand%(1, ci)
bx(i) = cx(r): by(i) = cy(r): br(i) = cr(r): bdy(i) = rand(-4, -2)
bc& = _RGB(rand%(100, 255), rand(100, 255), rand(100, 255))
Else
bdy(i) = bdy(i) + antigravity
by(i) = by(i) + bdy(i)
End If
Next
_Display
_Limit 10
Wend
Loop
Sub drawCircle (x, y, r)
Circle (x, y), r
ci = ci + 1
ReDim _Preserve cx(ci): cx(ci) = x
ReDim _Preserve cy(ci): cy(ci) = y
ReDim _Preserve cr(ci): cr(ci) = r
'PRINT cx(ci), cy(ci), cr(ci)
If r > 2 Then
drawCircle x + r, y, r / 2
drawCircle x - r, y, r / 2
End If
End Sub
Function rand% (lo%, hi%)
rand% = Int(Rnd * (hi% - lo% + 1)) + lo%
End Function
Just another b+ mod
b = b + ...