Memory Mash is a terminal-based memory matching game written in Python. You choose a game size, reveal card coordinates each turn, and try to uncover all matching sets in as few moves as possible.
- The board is an
N x Ngrid whereNis the game size (1to9). - Every cell starts hidden as
X. - There are exactly
Nunique card values (1toN), and each value appears exactlyNtimes somewhere on the board. - On each move, you enter exactly
Ncoordinates. - If all revealed cards for that move match, they stay revealed.
- If they do not all match, newly revealed cards are hidden again.
- You win when all cards are revealed.
- Python 3.10+ (the game uses modern type hints)
- No external packages are required
a1.py- main game implementation and game loopsupport.py- constants/messages and hidden board generationgameplay/- example gameplay transcripts
From the project root:
python a1.pyhorH- show help/command formatqorQ- quit the current game- Coordinate move format:
[R1],[C1] [R2],[C2] ... [RN],[CN]- Example for game size
3:1,1 2,2 3,3
Notes:
- Coordinates are 1-indexed when entered by the player.
- You must enter exactly
Nunique, in-bounds coordinates each move.
Welcome to Memory Mash.
Please enter a game size between 1 to 9: 3
1 2 3
+-++-++-+
1|X||X||X|
+-++-++-+
2|X||X||X|
+-++-++-+
3|X||X||X|
+-++-++-+
Please enter command: 1,1 2,2 3,3
...
You have revealed all cards! It took you 9 moves!
Would you like to play again? (y/n): n
- Start by sampling spread-out coordinates to locate duplicates quickly.
- Track previously seen values and positions across turns.
- Prioritize finishing near-complete sets to reduce future guesses.
- Alex Bray