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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Update README.md Oct 30, 2018
bridge.pl First commit Oct 30, 2018

README.md

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 bridge.pl in your favorite Prolog environment and type:

print_all_solutions.

You can’t perform that action at this time.