Clue-Solver

Clue Solver

A native iOS deduction assistant for the board game Clue (Cluedo). Use it alongside a physical game to automatically track suggestions, eliminate possibilities, and solve the mystery faster than manual note-taking ever could.

Features

Tech Stack

Building

# Generate Xcode project (if using XcodeGen)
xcodegen generate --spec ClueSolver/project.yml

# Or open directly
open ClueSolver/ClueSolver.xcodeproj

Build and run on an iOS 17+ simulator or device from Xcode.

Testing

# Logic + integration tests (fast, no simulator UI)
xcodebuild test \
  -project ClueSolver/ClueSolver.xcodeproj \
  -scheme ClueSolver \
  -destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
  -skip-testing:ClueSolverUITests

# Full suite including UI tests
xcodebuild test \
  -project ClueSolver/ClueSolver.xcodeproj \
  -scheme ClueSolver \
  -destination 'platform=iOS Simulator,name=iPhone 16 Pro'

The test suite includes oracle-verified solver correctness, replay equivalence checks, seeded random transcript testing, invariance tests (seat rotation, card renaming), edition validation, persistence integration, performance benchmarks, and end-to-end UI automation.

How It Works

  1. Setup — Pick an edition, set the number of players, enter names, distribute card counts, and select your dealt cards.
  2. Record turns — As each suggestion happens at the table, record who suggested what, and whether anyone showed a card (and which card, if you saw it).
  3. Watch the deductions roll in — The engine propagates constraints, resolves disjunctions (“Player showed one of Knife/Rope/Hall” → later narrows to just one), and identifies envelope cards by elimination.
  4. Check probabilities — The Cards tab shows real-time probability that each card is in the envelope, computed from exact triple enumeration.
  5. Make your accusation — When the engine has narrowed down the suspect, weapon, and room, you’ll know.

Project Structure

ClueSolver/
├── App/          Entry point and app state management
├── Models/       SwiftData models (Game, Player, Card, Turn, CardMarker, GameEdition)
├── Engine/       Constraint propagation solver, state validator, snapshots
├── Views/        SwiftUI screens (Home, Setup, Dashboard, Turn recording, Custom editions)
├── Editions/     Edition registry + 24 bundled JSON edition definitions
├── Theme/        Design system, haptics, sound, animations
├── Utilities/    Undo/redo manager, export manager
└── Extensions/   Navigation styling helpers

Documentation

Edition Support

Status Count Examples
Fully supported 3 Classic Clue, Clue 2016, Master Detective
Likely compatible (needs verification) 11 Stranger Things, The Office, Scooby-Doo, D&D, etc.
Not supported (extra mechanics) 10 Harry Potter, Game of Thrones, Star Wars, etc.

See the edition support audit for details on each edition.

License

Private repository. All rights reserved.