A terminal-based memory-matching game built with OCaml + Dune, featuring a pure/testable game engine and terminal UI.
- 5 difficulty presets + custom board sizes
- 7 modes: Classic, Time Attack, Perfect, Blitz, Zen, Streak, Daily Challenge
- Combo scoring + difficulty multipliers
- Deterministic seeded boards
- Daily Challenge with the same board for everyone
- AI opponent with Easy, Normal, Hard, and Expert levels
- Local leaderboard and lifetime statistics
- Save & resume
- 4 terminal themes
- Keyboard navigation
- OCaml >= 4.14
- Dune >= 3.0
- Unix library
The application uses the OCaml standard library + Unix and has no runtime external dependencies.
Run these commands in the terminal:
sudo apt update
sudo apt install -y opam
opam init -y
eval $(opam env)
opam install -y dune alcotestdune builddune testdune exec bin/main.exesudo apt update && sudo apt install -y opam && opam init -y && eval $(opam env) && opam install -y dune alcotest && dune build && dune test && dune exec bin/main.exe| Key | Action |
|---|---|
| Arrow Keys | Move cursor |
| Enter | Flip card |
| H | Hint |
| P | Pause |
| R | Restart |
| Q | Main menu |
Hints cost points and are disabled in Perfect mode.
lib/core → Pure game engine
lib/ui → Terminal UI, themes, input, menus
lib/ai → AI opponent
lib/persist → Saves, leaderboard, statistics
lib/test → Test suite
bin/ → Main executable
Save data, statistics, and leaderboard are stored in:
$XDG_DATA_HOME/cardmatch
or, by default:
~/.local/share/cardmatch
Enjoying CardMatch 2.0? Support development with a coffee:
See the repository license for the applicable terms.
CardMatch 2.0 — Built with OCaml + Dune. 🃏☕