' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2023.12.16.16.28]) on 2024.06.08 at 02:58 (Coordinated Universal Time)
' This is Peter McGavin's QBASIC program
' altered ever-so-slightly to get it working in BAM.
' Note the changed/removed/added lines marked with a "🟠"


 10 REM Vampire Einstein aperiodic tessellation without reflections
 20 REM Ported to QBASIC by Peter McGavin, 6-8 Jun 2024
 30 REM from BBC-BASIC version by Richard Russell, 03-Jun-2024
 40 REM
 50 DIM DA(7,2)
 '🟠 60 ON ERROR GOTO 400 : SCREEN 12 : ON ERROR GOTO 0 : CLS
 60 SCREEN 12 : CLS
 70 S = 640/1276 : REM Overall scale
 80 L = S*3*SQR(307 + 72*SQR(3))
 90 T = ATN(3/(16/9 + SQR(3)))
'🟠 100 THICK% = 2 : REM Boundary line thickness
100 THICK% = 1 : REM Boundary line thickness
110 PI2 = 8*ATN(1)
120 DEG2RAD = PI2/360
130 REM
140 FOR I%=1 TO 7 : FOR J%=1 TO 2 : READ D : DA(I%,J%)=DEG2RAD*D : NEXT J%,I%
150 FOR T% = 1 TO 45
160   READ X0, Y0, A : X0 = S*X0 : Y0 = S*Y0 : A = DEG2RAD*A
170   FOR IX% = THICK% TO 0 STEP -1 : X = X0 + IX%
180     FOR IY% = THICK% TO 0 STEP -1 : Y = Y0 + IY%
190       FOR I% = 1 TO 7
200         D = DA(I%,1) + A
210         X = X + L*SIN(T + D) : Y = Y + L*COS(T + D)
220         GOSUB 340
230         D = DA(I%,2) + A
240         GOSUB 340
250         X = X - L*SIN(T + D) : Y = Y - L*COS(T + D)
260       NEXT I%
270      IF IX%=0 AND IY%=0 THEN PAINT (X-S*(120*SIN(A)+50*COS(A)),Y-S*(120*COS(A)-50*SIN(A))),T% MOD 14+1,15
280     NEXT IY%
290   NEXT IX%
300 NEXT T%
310 A$ = INPUT$(1)
'🟠 320 STOP
320 END
330 REM Side
340 R1 = (9*3)*S : R2 = (8*3)*S
350 LINE (X, Y)-(X - R2*SIN(D), Y - R2*COS(D)),15
355 SLEEP 0.01 '🟠 Added
360 IF D > PI2 THEN D = D - PI2
'🟠 370 D1 = D + DEG2RAD*120 : IF D1 > PI2 THEN D1 = D1 - PI2
370 D1 = D + DEG2RAD*120
380 CIRCLE (X - R2*SIN(D) - R1*COS(D), Y - R2*COS(D) + R1*SIN(D)),R1,15,D,D1,1
385 SLEEP 0.01 '🟠 Added
390 RETURN
'🟠 400 SCREEN 9 : RESUME NEXT : REM Error handler for SCREEN 12 failure
410 REM
420 DATA 80,170, 50,320, 200,290, 170,350, 230,140, 260,170, 290,200
430 DATA 514,710,0,   662,670,0,   958,714,60,  848,311,180, 368,795,300
440 DATA 770,776,120, 919,861,60,  881,1009,60, 1066,822,180,1212,780,180
450 DATA 660,500,60,  258,562,240, 344,586,330, 591,244,300, 441,160,240
460 DATA 256,392,300, 994,226,120, 959,714,300, 1213,780,180,1082,542,90
470 DATA 1102,332,120,258,392,180, 220,710,240, 148,286,300, 220,708,120
480 DATA 98,882,270,  332,1114,0,  478,1072,0,  1106,628,0,  1252,416,60
490 DATA 1032,78,240, 886,120,0,   738,159,0,   480,11,240,  38,178,300
500 DATA 110,432,180, 296,200,0,   1180,162,300,-112,94,240, 58,-30,270
510 DATA 1068,-70,240,74,794,180,  110,431,60,  688,1094,30, 1362,694,120
520 END