Logic puzzle · clingo running in your browser

Block Party Whodunit

Something went missing at the block party. A logic program writes every case from scratch, then proves its clues point to exactly one neighbor. You'll never get one that can't be solved, and you'll never run out.

Loading clingo

How a case gets written

The rules of the block party are about twenty lines of answer set programming, shown here. They say what a possible afternoon looks like, and what each kind of clue means. They never say how to solve anything.

  1. Pick a secret. The page quietly decides where everyone stood and what they brought.
  2. Add true clues in random order. After each one, clingo checks how many neighbors could still be guilty.
  3. Stop at one. Then try dropping each clue. If clingo can still prove there's only one possible thief, that clue was never needed.
  4. Check it's fair. For every innocent neighbor, clingo finds the fewest clues that clear them. Cases that are too easy get thrown out.