dos33fsprogs/graphics/gr/twister/twister.bas
2023-12-06 23:31:08 -05:00

23 lines
693 B
QBasic

10 REM TWISTER-DEMO
15 REM https://8bitshack.org/post/twister/
20 HGR
30 FOR A2 = 1 TO 360 STEP 3
40 AM = 120+COS(A2*0.0174533)*100
50 AN = -3.141593+SIN(A2*0.0174533)*3.141593
60 FOR Y = 1 TO 159 STEP 2
65 FV = Y/AM+AN
70 X1 = 35*SIN(FV)
80 X2 = 35*SIN(FV+1.570796)
90 REM X3 = 140+35*SIN(FV+3.141593)
95 X3 = -X1
100 REM X4 = 140+35*SIN(FV+4.712389)
105 X4 = -X2
108 HCOLOR = 0: HPLOT 105,Y TO 175,Y
110 IF X1 < X2 THEN HCOLOR = 1: HPLOT 140+X1,Y TO 140+X2,Y: GOTO 130
120 IF X3 < X4 THEN HCOLOR = 1: HPLOT 140+X3,Y TO 140+X4,Y
130 IF X2 < X3 THEN HCOLOR = 2: HPLOT 140+X2,Y TO 140+X3,Y: GOTO 150
140 IF X4 < X1 THEN HCOLOR = 2: HPLOT 140+X4,Y TO 140+X1,Y
150 NEXT Y
160 NEXT A2
170 GOTO 30