' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2023.10.26.02.14]) on 2023.10.29 at 19:13 (Coordinated Universal Time)
' This program by Charlie Veniot is a port and mod
' of a SpecBAS program by ZXDunny (original code below the BAM program)

_ALERT("Click/touch the screen, or press a keyboard key, to draw the twisty maze with other random colors.")
sw = 701
sh = 301
SCREEN _NEWIMAGE(sw, sh, 12)

' 🟠🟠🟠 Main program 🟠🟠🟠

20 DEF fnS(L)=SIN(_D2R(L*9))

30 SC=3
COLOR INT( RND * 5 ) + 11, INT( RND * 3 )
CLS
   FOR L=0 TO 1010*SC/2
      O=L-40
      P=L MOD 40
      Q=(L+1) MOD 40
      S=fnS(P)/SC
      C=fnS(P+10)/SC
      T=fnS(Q)/SC
      D=fnS(Q+10)/SC
      ON (INT(RND*2)+1) GOSUB βž”LINE1, βž”LINE2
      _DISPLAY
   NEXT L

   SLEEP
   CLS
   GOTO 30

' 🟠🟠🟠 Subroutines 🟠🟠🟠

βž”LINE1:
  LINE (L*S+sw/2,L*C+sh/2) TO (O*T+sw/2,O*D+sh/2)
  RETURN

βž”LINE2:
  LINE (L*T+sw/2,L*D+sh/2) TO (O*S+sw/2,O*C+sh/2)
  RETURN

' 🟠🟠🟠 ZXDunny's SpecBAS program 🟠🟠🟠

'10 degrees: origin -400,-240 to 400,240

'20 def fn S(L)=SIN(L*9):
'   dim E$=TOKEN$ "DRAW L*S,L*C TO O*T,O*D",TOKEN$ "DRAW L*T,L*D TO O*S,O*C"

'30 SC=3:
'   FOR L=0 TO 1010*SC/2:
'      O=L-40:
'      P=L MOD 40:
'      Q=(L+1) MOD 40:
'      S=fn S(P)/SC:
'      C=fn S(P+10)/SC:
'      T=fn S(Q)/SC:
'      D=fn S(Q+10)/SC:
'      EXECUTE E$(INT(RND*2)+1):
'   NEXT L

'40 wait keydown:
'   cls:
'   GO To 10