fork download
  1. % road(X,Y): city X is connected to city Y by a road
  2. road(durango,redville).
  3. road(redville,durango).
  4. road(redville,hardwick).
  5. road(hardwick,redville).
  6. road(hardwick,newton).
  7. road(newton,hardwick).
  8. road(newton,burr).
  9. road(burr,newton).
  10. road(newton,hallsburg).
  11. road(hallsburg,newton).
  12. road(newton,burlington).
  13. road(burlington,newton).
  14. road(hallsburg,burlington).
  15. road(burlington,hallsburg).
Success #stdin #stdout 0.02s 6204KB
stdin
road(burlington, X), road(X, Y), format('You can get from Burlington to ~w which will get you to ~w in two hops.\n',[X, Y]), fail.
stdout
You can get from Burlington to newton which will get you to hardwick in two hops.
You can get from Burlington to newton which will get you to burr in two hops.
You can get from Burlington to newton which will get you to hallsburg in two hops.
You can get from Burlington to newton which will get you to burlington in two hops.
You can get from Burlington to hallsburg which will get you to newton in two hops.
You can get from Burlington to hallsburg which will get you to burlington in two hops.