10 REM " MEMORY " Ch.W.Brederode, LIS
SE 1988, The Netherlands
15 REM This is Public Domain
16 ON ERROR RUN
17 *KEY10 OLD|M VDU7:RUN|M
20 MODE2:HIMEM=&2800:IF L% THEN 40
30 *LOAD MEMKRT
40 CLS:DIM A%66,SC%(1):SC%(0)=0:SC%(1
)=0
50 N=RND(-TIME):D%=0:G%=0:J%=0:L%=1:O
%=0:NR=0:VNR=255
52 VDU23,1,0;0;0;0;
55 IF Z%=255 THEN 110
60 PRINTTAB(3,12)"M E M O R Y"'" ``
`````````"
70 PRINTTAB(3,19)"explanation? Y/N";
80 Q$=GET$:IF INSTR("Yy",Q$) MODE6:HI
MEM=&2800:PROCuitleg:MODE2:HIMEM=&2800
90 PRINTTAB(3,12)"M E M O R Y"'" ``
`````````";
100 REM --- schudden ---
105 VDU23,1,0;0;0;0;
110 FOR N%=2 TO 65:A%?N%=(N%/2)-1:NEXT
120 FOR N%=66 TO 4 STEP-1:R%=RND(N%-2)
+1:A%?N%=A%?R%
130 FOR M%=R% TO N%-2:A%?M%=A%?(M%+1):
NEXT :SOUND1,-1,N%*4,1
140 NEXT:A%?3=A%?2:A%=A%+3:CLS
150 REM --- teken speelveld ---
160 GCOL0,1
170 FOR X=96 TO 1132 STEP128:MOVEX,204
:DRAWX,974:NEXT
180 FOR Y=204 TO 974 STEP96:MOVE96,Y:D
RAW1116,Y:NEXT
190 COLOUR6:FOR X=2 TO 16 STEP 2:FOR Y
=3 TO 24 STEP 3
200 PRINTTAB(X,Y)"?":NEXT:NEXT:COLOUR3
205 IF Z%=255 THEN583
206 VDU23,1,1;0;0;0;
210 X%=2:Y%=3:*FX4,1
220 REPEAT
230 REM --- wie aan de beurt? ---
240 IF J%AND1 PRINTTAB(13,30)">":PRINT
TAB(13,31); ELSE PRINTTAB(5,30)"<":PRIN
TTAB(5,31);
250 REM --- cursor ---
260 REPEAT
280 PROCc:Q=GET:PROCc:IF Q=13 UNTILTRU
E:GOTO360
290 IF Q<136 OR Q>139 THEN280
300 Q=Q-135:ON Q GOTO 310,320,330,340
310 X%=X%-2-2*(X%=2) :UNTILFALSE
320 X%=X%+2+2*(X%=16):UNTILFALSE
330 Y%=Y%+3+3*(Y%=24):UNTILFALSE
340 Y%=Y%-3-3*(Y%=3) :UNTILFALSE
350 REM --- volgnr en plaatje ---
360 PROCc:NR=8*(Y%/3)-9+(X%/2):N%=A%?N
R:PRINTTAB(8,30);L%
370 IF D%AND1 THEN 430
380 REM --- 1e kaart ---
390 IF N%=255 SOUND1,-1,200,1:PROCc:UN
TILFALSE
400 PROCplaatje:G%=N%:VNR=NR:D%=D%+1:S
%=X%:T%=Y%:PROCc
410 UNTILFALSE
420 REM --- 2e kaart ---
430 PROCc:IF N%=255 SOUND1,-1,200,1:UN
TILFALSE
440 IF NR=VNR SOUND1,-1,200,1:UNTILFAL
SE
450 PROCc:PRINTTAB(5,30)" ":PRINTTAB(1
3,30)" "
460 L%=L%+1:PROCplaatje:U%=X%:V%=Y%:D%
=D%+1
470 IF N%=G% O%=1:A%?NR=255:A%?VNR=255
:SC%(J%AND1)=SC%(J%AND1)+1
480 PRINTTAB(1,30);SC%(0):PRINTTAB(16,
30);SC%(1):PRINTTAB(8,31);
490 REM --- terugdraaien ---
500 Q=INKEY(500):PROCc
510 IF O% V$=" ":O%=0 ELSE V$="?":J%=J
%+1
520 COLOUR6
530 PRINTTAB(S%,T%-1)" ":PRINTTAB(S%,T
%)V$
540 PRINTTAB(U%,V%-1)" ":PRINTTAB(U%,V
%)V$
550 COLOUR3:UNTIL SC%(0)+SC%(1)=32
560 REM --- einde? ---
570 PRINTTAB(1,28)"ONCE MORE? Y/N";
580 Z%=255:Q$=GET$:IF INSTR("Yy",Q$) Z
%=0
581 RUN
582 REM --- einde ---
583 *fx4
584 FOR NR=0 TO 63:N%=A%?NR:PROCplaatj
e:NEXT
585 VDU23,1,1;0;0;0;
590 PRINTTAB(2,29)"SEE YOU LATER! "
; :Z%=0
600 Q=GET:END
601DEFPROCc
602 VDU5:GCOL3,8:MOVEX%*64,1008-Y%*32:
VDU95:VDU4
603 ENDPROC
610DEFPROCplaatje
620 M%=&3000+1344+(NR DIV8)*1920+(NR M
OD8)*64
630 P%=&2800+N%*64
640 FOR K%=0TO31STEP4:M%!K%=P%!K%:NEXT
650 M%=M%+640:P%=P%+32
660 FOR K%=0TO31STEP4:M%!K%=P%!K%:NEXT
670 ENDPROC
680DEFPROCuitleg
690 PRINT'"MEMORY FOR ONE OR TWO
PLAYERS"
700 PRINT"============================
========"
710 PRINT'"Each player searches two
matching"
720 PRINT'"cards with the SAME fig
ure."
730 PRINT'"Use the cursor-keys for
searching"
740 PRINT'"and turn the cards with RET
URN."
750 PRINT'"He who finds two the same c
ards may"
760 PRINT'"go one more time."
770 PRINT'"The computer keeps up t
he score"
780 PRINT'"and tells you with < or
> who's"
790 PRINT'"turn it is."
800 PRINT'''" Press any
key...";:Q=GET
810 ENDPROC