From Learn @ Cemetech
Jump to navigationJump to search

Memory is a simple "card" game where you flip over two cards each turn to try to get a matching pair. If they match, then the cards are removed from the playing field. If they don't match, the cards are just flipped back over. You continue playing until all of the cards are removed. The game playing field is a square 4x4 matrix, but you can increase this to a larger size if you like.

The Code

:DelVar W
:DelVar S1→Y
:DelVar T1→X
:Repeat K=21 and [A](Y,X)(Y≠S or X≠T
:Repeat Ans
:If not(B:Then
:If [A](Y,X)=[A](S,T:Then
:Disp "Score:
:Pause W

The Download

In case you want to try the program on your calculator, you can download the program in .8xp format.