Skip to content

AlexnBray/memory-mash-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory Mash

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.

Game Overview

  • The board is an N x N grid where N is the game size (1 to 9).
  • Every cell starts hidden as X.
  • There are exactly N unique card values (1 to N), and each value appears exactly N times somewhere on the board.
  • On each move, you enter exactly N coordinates.
  • 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.

Requirements

  • Python 3.10+ (the game uses modern type hints)
  • No external packages are required

Project Files

  • a1.py - main game implementation and game loop
  • support.py - constants/messages and hidden board generation
  • gameplay/ - example gameplay transcripts

How to Run

From the project root:

python a1.py

Controls

  • h or H - show help/command format
  • q or Q - 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 N unique, in-bounds coordinates each move.

Example Session

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

Gameplay Tips

  • 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.

Author

  • Alex Bray

About

python based terminal game developed for CSSE1001 coursework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages