05-10-2022, 04:09 PM
Ashish started the thread with this:
Which reminds me allot of Sprezzo's efforts of circles within circles... only he did pendulums.
Code: (Select All)
' 2022-05-10 Attempt to restore Ashish QB64 Spirograph from a SmallBASIC translation of it
'Coded By Ashish Kushwaha
' signature "if (Me.Success) {Me.Improve();} else {Me.TryAgain();}"
_Title "Spirograph"
Screen _NewImage(700, 700, 32)
Type spirals
x As Single
y As Single
rad As Single
ang As _Float
End Type
Dim Shared spiral(10) As spirals
spiral(0).x = _Width / 2
spiral(0).y = _Height / 2
spiral(0).rad = 160 'confused with SB radian function I will use .r
stroke~& = _RGB(80, 80, 80) 'I guess this is color setting
Do
Cls , _RGB(230, 230, 230)
Circle (spiral(0).x, spiral(0).y), spiral(0).rad, stroke~&
spiral(0).ang = spiral(0).ang + .01
For i = 1 To UBound(spiral)
spiral(i).x = Cos(spiral(i - 1).ang) * spiral(i - 1).rad + spiral(i - 1).x
spiral(i).y = Sin(spiral(i - 1).ang) * spiral(i - 1).rad + spiral(i - 1).y
spiral(i).rad = spiral(i - 1).rad / 1.5
spiral(i).ang = spiral(i - 1).ang * 1.5
Circle (spiral(i).x, spiral(i).y), spiral(i).rad, stroke~&
Next
_Display
_Limit 60
Loop
Which reminds me allot of Sprezzo's efforts of circles within circles... only he did pendulums.
b = b + ...