/potion_riddle

Solver for Snape's potion riddle in Prolog

Primary LanguageProlog

Solver for the Potion Riddle

A Prolog program to solve Snape's potion puzzle from the first Harry Potter book.

I used the SWI-Prolog environment during the implementation.

Usage

  1. Ensure SWI-Prolog is installed. SWI-Prolog is a package on most major Linux distributions.
  2. Run swipl -f main.pl
  3. Get the solution
?- solution(X).
X = [poison, wine, ahead, poison, poison, wine, back] .

Notes

As solving the riddle relies on seeing the bottles, and the book doesn't disclose enough information, this solver relies on the drawing included in the Pottermore game.

Illustration from Pottermore/StackExchange