' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2023.12.16.16.28]) on 2024.06.02 at 18:06 (Coordinated Universal Time)
' This program by Charlie Veniot is a port and mod of Jeerayut Wetweerapong's "simple animation #1"
' ( as shared on Facebook with the "BASIC Programming Language" group: https://www.facebook.com/share/v/72JbBy22DWK5JHJu/ )
' Although the original FreeBASIC program worked almost as-is in BAM, I modified it significantly
' to sanity-test various language features and to also match some of my quirky preferences/interests.

' 🟠 Main Program

  SCREEN _NEWIMAGE( 800, 480, 17 )
  DIM x%( 1 TO 10 ), y%( 1 TO 10 ), r%( 1 TO 10 ), c%( 1 TO 10 ), cv%(1 TO 15)
  
  🏁StartAnImage:
    a_step% = INT( RND * 88 ) + 2
    FOR DrawLayer% = 1 TO ( INT( RND * 33 ) + 2 )
      GOSUB ♻InitNodes
      FOR a% = 360 TO 0 STEP - a_step%
        FOR i% = 1 TO 10
          DRAW "B M" + x%( i% ) + "," + y%( i% )
          COLOR c%( i% )
          DRAW "TA" + a% + "R" + r%( i% )
        NEXT i%
        SLEEP 0.02
      NEXT a%
    NEXT DrawLayer%
    SLEEP 3
    CLS
  GOTO 🏁StartAnImage

' 🟠 Subroutines

  ♻InitNodes:
    FOR i% = 1 TO 15
      cv%( i% ) = 1 + INT( 63 * RND )
    NEXT i%
    FOR i% = 1 TO 10
      x%(i%) = 120 + INT( ( XMAX - 240 ) * RND )
      y%(i%) = 120 + INT( ( YMAX - 240 ) * RND )
      r%(i%) = 30 + INT( 90 * RND )
      c%(i%) = cv%( 1 + INT( 15 * RND ) )
    NEXT i%
  RETURN