Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

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.

About

Prolog program that solves the bridge and torch puzzle

Resources

Releases

No releases published

Packages

No packages published

Languages