Concentration-like game: match the pairs.
Appears on
Gallery
Source Code
10 PAPER 7: INK 0: FLASH 0: BORDER 7 20 FOR i=1 TO 4: READ x$: FOR j=0 TO 7: READ x: POKE USR x$+j,x: NEXT j: NEXT i 30 DATA "H",34,119,127,127,62,62,28,8,"C",28,28,8,107,127,107,8,8,"D",8,28,62,127,62,28,8,0,"S",8,28,62,127,127,127,107,8 40 LET s$="HCDS": LET v$="A23456789TJQK" 50 DIM c(52): DIM t(52): DIM v(52): DIM s(4) 60 FOR i=1 TO 4: LET s(i)=CODE s$(i)+79: NEXT i 70 FOR i=1 TO 52: LET c(i)=i: NEXT i 80 FOR i=1 TO 52: LET r=INT (52*RND)+1: LET z=c(i): LET c(i)=c(r): LET c(r)=z: NEXT i 90 FOR i=1 TO 52: LET t(i)=INT ((c(i)-1)/13)+1: LET v(i)=c(i)-13*(t(i)-1): NEXT i 120 PAPER 4: PRINT TAB 31: FOR i=1 TO 5: FOR j=1 TO 2: PRINT " \::\:: \::\:: \::\:: \::\:: \::\:: \::\:: \::\:: \::\:: \::\:: \::\:: ": NEXT j: PRINT TAB 31: NEXT i 130 FOR j=1 TO 2: PRINT " \::\:: \::\:: ": NEXT j: PRINT TAB 7 140 PAPER 7: PLOT 0,175: DRAW 0,-151: DRAW 55,0: DRAW 0,24: DRAW 192,0: DRAW 0,127: DRAW -247,0 150 FOR n=1 TO 52: GO SUB 600: PRINT AT l1,c1; INVERSE 1;n: NEXT n 160 LET ch=0: LET pr=0: PRINT AT 16,8;"CHOICES: 0 PAIRS: 0" 200 PRINT AT 18,8;" ": INPUT "Enter pair: (1)=";p1 210 IF p1<>INT p1 OR p1>52 OR p1<1 THEN INPUT "Invalid - reenter (1)=";p1: GO TO 210 220 IF v(p1)=0 THEN INPUT "Already paired - reenter (1)=";p1: GO TO 210 230 LET n=p1: GO SUB 600: GO SUB 500 240 INPUT " (2)=";p2 250 IF p2<>INT p2 OR p2>52 OR p2<1 THEN INPUT "Invalid - reenter (2)=";p2: GO TO 250 260 IF v(p2)=0 THEN INPUT "Already paired - reenter (2)=";p2: GO TO 250 270 IF p1=p2 THEN INPUT "Pair must be separate - reenter (2)";p2: GO TO 250 280 LET n=p2: GO SUB 600: GO SUB 500 290 LET ch=ch+1: PRINT AT 16,17;ch 300 IF v(p1)<>v(p2) THEN GO TO 340 310 PRINT AT 18,8; INK 7;"Correct choice!": LET v(p1)=0: LET v(p2)=0: LET pr=pr+1: PRINT AT 16,28;pr: BEEP .5,25: BEEP .5,15 320 IF pr=26 THEN PRINT AT 20,0;"You have finished after ";ch;" turns": BEEP .5,20: BEEP .5,25: BEEP .5,20: GO TO 360 330 GO TO 350 340 PRINT AT 18,8;"Do not match ": BEEP 1,-15: PAUSE 150: GO SUB 800: LET n=p1: GO SUB 600: GO SUB 800 350 INPUT "Press ENTER for next go"; LINE z$: GO TO 200 360 PAUSE 150: INPUT "Press 1 to repeat or 0 to stop"; LINE z$ 370 IF z$="1" THEN RUN 380 STOP 500 PAPER 7: LET vn=v(n): LET sn=t(n): INK 2-(sn=2*INT (sn/2))*2 510 PRINT AT l1,c1;v$(vn);" ";AT l1+1,c1;" ";CHR$ s(sn) 520 INK 0 530 PLOT c1*8-1,178-8*l1: DRAW 17,0: DRAW 0,-17: DRAW -17,0: DRAW 0,17 540 BEEP 1,5: RETURN 600 LET x10=INT (n/10): LET x1=n-10*x10 605 IF x1=0 THEN LET x10=x10-1: LET x1=10 610 LET l1=1+3*x10 620 LET c1=3*x1-2 630 RETURN 800 PRINT AT l1,c1; INVERSE 1;n: IF n<10 THEN PRINT "\::" 810 PRINT AT l1+1,c1;"\::\::" 820 RETURN 9997 STOP 9998 SAVE "MEMORY MAT" LINE 1