' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2026.05.16.03.15]) on 2026.10.23 at 21:23 (Coordinated Universal Time)
' This program by Charlie Veniot
' Just a quick "brain age" exercise playing around with DRAW and the SIN function
' resulting in a geometric shape resembling the petals of a flower

s% = 200
cmax% = 7
SCREEN _NEWIMAGE(s% * 2 + 1, s% * 2 + 1,17)
DIM c%(0 TO cmax%)
sa% = 10

Another_Rendering:

  xlast% = 0 : ylast% = 0 : xnow% = 0 : ynow% = 0
  f% = INT( RND * 7 + 2 )
  FOR i% = 0 TO cmax%
      c%(i%) = INT( RND * 62 + 1)
  NEXT i%
  cb% = INT( RND * 62 + 1)
  af% = INT( RND * 45 )
  thiscmax% = 1 + INT( RND * cmax% )

  
  FOR a% = 0 TO ( 360 )  step 1
      COLOR c%( ( a% MOD (thiscmax% + 1) ) )
      DRAW "TA " + ( a% + af% )
      PSET (s%, s%), 0
      DRAW "U " + ( ABS( SIN( _D2R( a% * f% ) ) ) * ABS( s% - sa% )  )
      xnow% = POINT(0) : ynow% = POINT(1)
      IF xlast% <> 0 THEN COLOR 63 : LINE (xlast%, ylast%) TO (xnow%, ynow%), cb%
      xlast% = xnow% : ylast% = ynow%
      sleep 0.01
  NEXT a%

  SLEEP 5
  sa% = ( sa% + (INT( RND * 35 )) MOD s% )
  IF INT(RND * 4) = 0 THEN sa% = 10 : CLS

GOTO Another_Rendering