10 REM *** MAGIAPOTAGIA 1977 ***
20 DIM L$(6): DIM M$(6): DIM R$(6): DIM B$(20)
30 GOSUB 900
40 PRINT "{clrhome}{17×crsrD}{4×crsrR}I'LL TRY TO GUESS  WHICH CARD IS"
50 PRINT "{5×crsrR}THE ONE YOU HAVE CHOSEN - JUST"
60 PRINT "{4×crsrR}TELL ME,  WHICH COLUMN IS IT IN?"
100 REM *** MAIN LOOP ***
110 FOR T=1 TO 3
200 REM *** DISTRIBUTE CARDS ***
210 FOR Z=0 TO 18 STEP 3
220 L$(Z/3)=B$(Z): M$(Z/3)=B$(Z+1): R$(Z/3)=B$(Z+2)
230 NEXT Z
300 REM *** PRINT CARDS ***
310 FOR Y=1 TO 3: W$="": FOR W=1 TO 1+8*Y: W$=W$+"{crsrR}": NEXT W
320 PRINT "{home}";W$;X$
330 FOR Z=0 TO 6: PRINT W$;Y$;"{4×crsrL}";
340 IF Y=1 THEN PRINT L$(Z)
350 IF Y=2 THEN PRINT M$(Z)
360 IF Y=3 THEN PRINT R$(Z)
370 PRINT W$;Z$: NEXT Z
380 PRINT "{crsrU}";W$;Y$: PRINT W$;Z$: NEXT Y
390 PRINT "{5×crsrD}{16×crsrR}L/M/R   {3×crsrL}";: INPUT Q$
400 REM *** CHECK INPUT ***
410 IF Q$="L" THEN GOSUB 470
420 IF Q$="M" THEN GOSUB 480
430 IF Q$="R" THEN GOSUB 490
440 IF T=3 THEN GOTO 460
450 PRINT "{7×crsrU}":FOR N=1 TO 16: PRINT D$;: NEXT N
460 NEXT T: GOTO 500
470 FOR Z=0 TO 6: B$(Z)=M$(Z): B$(Z+7)=L$(Z): B$(Z+14)=R$(Z): NEXT Z: RETURN
480 FOR Z=0 TO 6: B$(Z)=L$(Z): B$(Z+7)=M$(Z): B$(Z+14)=R$(Z): NEXT Z: RETURN
490 FOR Z=0 TO 6: B$(Z)=M$(Z): B$(Z+7)=R$(Z): B$(Z+14)=L$(Z): NEXT Z: RETURN
500 REM *** THE REVEAL ***
510 FOR N=1 TO 5: PRINT D$;: NEXT N
520 PRINT "{3×crsrR}YOUR CARD IS ";B$(10);", AND THAT'S MAGIC!"
530 PRINT "{crsrD}{6×crsrR}INPUT 'P' TO PLAY AGAIN: ";: INPUT Q$
540 IF Q$="P" THEN GOTO 30
899 END
900 REM *** ARRAYS ***
910 X$=CHR$(228)+CHR$(228): Y$=CHR$(229)+"    "+CHR$(231)
920 Z$=CHR$(204)+X$+X$+CHR$(250): X$=X$+X$+X$
930 FOR N=0 TO 20
940 B$(N)=MID$("1A2A3A4A5A6A7A8A9A1B2B3B4B5B6B7B8B9BJJXXZZ",2*N+1,2): NEXT N
950 D$="": FOR N=1 TO 40: D$=D$+CHR$(20): NEXT N: RETURN
