' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2024.09.09.00.00]) on 2025.08.09 at 03:29 (Coordinated Universal Time)
' This program by Charlie Veniot draws the Acadian flag

_TITLE ("Drapeau acadien")


' 🟠🟠🟠 CONSTANTS 🟠🟠🟠

  ' delay value to animate the flag's drawing
    CONST zzz = 0.7

  ' flag colours
    CONST 🟨OR    = _RGB( 255, 215,   0 ), _
          🟦BLEU  = _RGB(   0,  56, 150 ), _
          ⬜BLANC = _RGB( 255, 255, 255 ), _
          πŸŸ₯ROUGE = _RGB( 207,  20,  43 ) 

  ' flag dimensions
    CONST FLAG_SCALE = 8, _ 
          🏁W = 120 * FLAG_SCALE , _
          🏁H =  72 * FLAG_SCALE

  ' star size and position
    CONST star_size = 🏁W / 9, _
          star_x = 🏁W / 6, _
          star_y = 🏁H / 3
        
' 🟠🟠🟠 ARRAYS 🟠🟠🟠

  ' star points
    DIM x%( 0 TO 4 )
    DIM y%( 0 TO 4 )

' 🟠🟠🟠 MAIN PROGRAM 🟠🟠🟠

  SCREEN _NEWIMAGE( 🏁W, 🏁H, 32 )
  
  GOSUB A100🟦_DrawTricolor
  GOSUB A200⭐_DrawStar

  SLEEP

  END

' 🟠🟠🟠 SUBROUTINES 🟠🟠🟠

  A100🟦_DrawTricolor:
    LINE ( 0, 0 )               TO ( 🏁W / 3 - 1, 🏁H - 1 ),     🟦BLEU, BF  : SLEEP zzz
    LINE ( 🏁W / 3 - 1, 0 )     TO ( 🏁W / 3 * 2 - 1, 🏁H - 1 ), ⬜BLANC, BF : SLEEP zzz
    LINE ( 🏁W / 3 * 2 - 1, 0 ) TO ( 🏁W - 1, 🏁H - 1 ),         πŸŸ₯ROUGE, BF : SLEEP zzz
  RETURN


  A200⭐_DrawStar:
    ' Setup star's points
      FOR a% = 0 TO 4
          PRESET( star_x, star_y )
          COLOR 🟨OR
          DRAW "TA " + ( a% * 72 ) + " BU" + star_size
          x%( a% ) = POINT(0)
          y%( a% ) = POINT(1)
      NEXT a%

    ' Draw lines from points to relevant points
      DRAW "BM" + x%(0) + "," + y%(0)
      DRAW "M" + x%(2) + "," + y%(2) : SLEEP zzz
      DRAW "M" + x%(4) + "," + y%(4) : SLEEP zzz
      DRAW "M" + x%(1) + "," + y%(1) : SLEEP zzz
      DRAW "M" + x%(3) + "," + y%(3) : SLEEP zzz
      DRAW "M" + x%(0) + "," + y%(0) : SLEEP zzz

    ' Fill the resulting polygons
      FOR a% = 0 TO 288 STEP 72
          PRESET( star_x, star_y )
          DRAW "TA " + a% + " BU" + ( star_size - 5 )
          PAINT( POINT(0), POINT(1) ), 🟨OR, 🟨OR
          SLEEP zzz
      NEXT a%
      PAINT( star_x, star_y ), 🟨OR, 🟨OR

  RETURN