Skip to content
Prolog program that solves the bridge and torch puzzle
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information. Update Oct 30, 2018 First commit Oct 30, 2018

Bridge and torch

Prolog program to solve the bridge and torch puzzle.

Four people need to cross a bridge at night which only supports two people at the same time. Person A needs 1 minute to cross the bridge, B needs 2 minutes, C needs 5 minutes and D needs 10 minutes. When two people cross the bridge they move at the slowest person’s pace. They have a torch which has battery left for only 17 minutes. They can’t cross the bridge without light. How can they manage to cross the bridge?

Open in your favorite Prolog environment and type:


You can’t perform that action at this time.