10 REM " MIDI-MEMORY " Ch.W.Brederode
, LISSE 1988, The Netherlands
15 REM This is Public Domain
16 ON ERROR RUN
17 *KEY10 OLD|M RUN|M
20 MODE2:HIMEM=&2800:IF L% THEN 40
30 *LOAD MIDIKRT
40 CLS:DIM A%32,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)"MIDI-MEMORY"'" ``
`````````"
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)"MIDI-MEMORY"'" ``
`````````"
100 REM --- schudden ---
105 VDU23,1,0;0;0;0;
110 FOR N%=2 TO 31:A%?N%=(N%/2)-1:NEXT
120 FOR N%=32 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%=160 TO 1120 STEP160:MOVEX%,
172:DRAWX%,972:NEXT
180 FOR Y%=172 TO 972 STEP160:MOVE160,
Y%:DRAW1120,Y%:NEXT
190 GCOL0,6:VDU5:FOR X%=200 TO 1060 ST
EP160:FOR Y%=900 TO 260 STEP-160
200 MOVEX%,Y%:PRINT"?":NEXT:NEXT:VDU4
205 IF Z%=255 THEN583
206 VDU23,1,0;0;0;0;
210 X%=0:Y%=0:OX%=0:OY%=0
215 PRINTTAB(5,30)"<"
216 *FX4,1
220 REPEAT
230 REM --- wie aan de beurt? ---
235 PRINTTAB(5,30)" ":PRINTTAB(13,30)"
"
240 IF J%AND1 PRINTTAB(13,30)">" ELSE
PRINTTAB(5,30)"<"
250 REM --- cursor ---
260 REPEAT
270 PROCc
280 Q%=GET:IF Q%=13 UNTILTRUE:GOTO360
290 IF Q%<136 OR Q%>139 THEN280
300 Q%=Q%-135:ON Q% GOTO 310,320,330,3
40
310 X%=X%-1-(X%=0):UNTILFALSE
320 X%=X%+1+(X%=5):UNTILFALSE
330 Y%=Y%+1+(Y%=4):UNTILFALSE
340 Y%=Y%-1-(Y%=0):UNTILFALSE
350 REM --- volgnr en plaatje ---
360 NR=X%+6*Y%:N%=A%?NR:PRINTTAB(8,30)
;L%;
370 IF D%AND1 THEN 430
380 REM --- 1e kaart ---
390 IF N%=255 SOUND1,-1,200,1:UNTILFAL
SE
400 PROCplaatje:G%=N%:VNR=NR:D%=D%+1:S
%=X%:T%=Y%
410 UNTILFALSE
420 REM --- 2e kaart ---
430 IF N%=255 SOUND1,-1,200,1:UNTILFAL
SE
440 IF NR=VNR SOUND1,-1,200,1:UNTILFAL
SE
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(5+8*(J%AND1),31);
490 REM --- terugdraaien ---
500 Q=INKEY(500)
510 IF O% V$=" ":O%=0 ELSE V$="?":J%=J
%+1
511 PROCkeer(S%,T%):PROCkeer(U%,V%)
520 COLOUR6
550 COLOUR3:UNTIL SC%(0)+SC%(1)=15
560 REM --- nog een keer? ---
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 29: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
610DEFPROCplaatje
615 LOCAL B%,H%,E%,G%,K%
620 M%=&3000+1368+(NR DIV6)*3200+(NR M
OD6)*80
630 P%=&2800+N%*128
640 FOR B%=0 TO 7:FOR H%=0 TO 3:E%=M%+
B%*8+H%*640
642 ?E%=?P%:E%?1=?P%:E%?2=P%?1:E%?3=P%
?1
643 E%?4=P%?2:E%?5=P%?2:E%?6=P%?3:E%?7
=P%?3
644 P%=P%+4
650 NEXT:NEXT
651 ENDPROC
652DEFPROCkeer(X%,Y%)
654 LOCAL H%,V%
655 H%=176+X%*160:V%=960-Y%*160
656 MOVEH%,V%:PLOT3,128,0:PLOT83,-128,
-128:PLOT83,128,0
660 VDU5:GCOL0,6:MOVEH%+24,V%-60:PRINT
V$:VDU4
670 ENDPROC
671DEFPROCc
672 GCOL0,0:VDU5:MOVEOX%,OY%:VDU95
673 NX%=200+160*X%:NY%=848-160*Y%
674 GCOL0,8:MOVENX%,NY%:VDU95,4
675 OX%=NX%:OY%=NY%:PRINTTAB(5+8*(J%AN
D1),31);
676 ENDPROC
680DEFPROCuitleg
690 PRINT'"MIDI-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
cards may"
760 PRINT'"go once more."
770 PRINT'"The computer keeps up the
score and"
780 PRINT'"shows with < or > who's t
urn it is."
800 PRINT'''" Press
any key...";:Q=GET
810 ENDPROC