Memory
--------------------------------------------------------
Version: 1.0, 980412
Creator: Daniel Bergman.
Description: Memory for the TI80. Try pairing the bricks together.
Comments: "->" is the "STO>"-button, the ending quotes aren't
needed in some places.
Known bugs: None.
Size: 377 bytes.
For more games and programs, please visit http://ti80.burtrask.net.
PROGRAM:MEMORY
LBL 0
INPUT "PAIRS?",R
IF R>49:GOTO 0
IF R<2:GOTO 0
CLRLIST L1,L2
R->DIM L1
R->DIM L2
2R->R
FOR(A,1,R/2
CLRHOME
DISP "PLACING PAIR:",A
LBL X
RANDINT(1,R->X
IF L2(X:GOTO X
LBL Y
RANDINT(1,R->Y
IF L2(Y:GOTO Y
IF Y=X:GOTO Y
A->L1(X:A->L1(Y
1->L2(X:1->L2(Y
END
CLRLIST L2
R->DIM L2
0->G
CLRHOME
LBL 1
IF PROD L2:GOTO S
INPUT "BRICK 1?",X
IF X<1:GOTO 1
IF X>R:GOTO 1
IF L2(X:GOTO 1
DISP L1(X
LBL 2
INPUT "BRICK 2?",Y
IF Y<1:GOTO 1
IF Y>R:GOTO 1
IF L2(Y:GOTO 1
DISP L1(Y
G+1->G
IF L1(X)=L1(Y
THEN
DISP "PAIR!
1->L2(X:1->L2(Y
END
PAUSE
CLRHOME
GOTO 1
LBL S
CLRHOME
DISP "ALL TAKEN IN
DISP G,"TURNS
CLRLIST L1,L2
DISP "TURNS/PAIR:
G/.5R
--------------------------------------------------------------------
Copyright (C) 1998 by Daniel Bergman & Mattias Morén
http://ti80.burtrask.net