' BASIC Anywhere Machine version and mod by Charlie Veniot 
' based on https://friends-of-basic.freeforums.net/thread/200/hypotrochoid-show
'_Title "The Hypotrochoid Show" 'for QB64 B+ 2019-07-18 trans to sb 2023-02-26
xmax = 900 : ymax = 720
screen _newimage(xmax, ymax, 27)
c2 = _RGB(200,0,0)
xc = xmax / 2: yc = ymax / 2: r = yc * .5: st = 3 / (2 * _Pi * r)
n = 0: m = 3
DO
  m = m + 1
  For n = 5 To 30 Step .05
    Cls
    For a = 0 To 2 * _Pi Step st * 1.75
      xReturn = xc + r * (Cos(a) + Cos(n * a) / 3 + Sin(m * a) / 2)
      yReturn = yc + r * (Sin(a) + Sin(n * a) / 3 + Cos(m * a) / 2)
      Circle (int(xReturn), int(yReturn)), 10, _RGB(0, int(rnd*156) + 100, 0)
    Next
  _delay 0.0001
  Next
LOOP