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), road(Y, H), format('You can get from Burlington to ~w which will get you to ~w and then to ~w in two hops.\n',[X, Y, H]), fail.
stdout
You can get from Burlington to newton which will get you to hardwick and then to redville in two hops.
You can get from Burlington to newton which will get you to hardwick and then to newton in two hops.
You can get from Burlington to newton which will get you to burr and then to newton in two hops.
You can get from Burlington to newton which will get you to hallsburg and then to newton in two hops.
You can get from Burlington to newton which will get you to hallsburg and then to burlington in two hops.
You can get from Burlington to newton which will get you to burlington and then to newton in two hops.
You can get from Burlington to newton which will get you to burlington and then to hallsburg in two hops.
You can get from Burlington to hallsburg which will get you to newton and then to hardwick in two hops.
You can get from Burlington to hallsburg which will get you to newton and then to burr in two hops.
You can get from Burlington to hallsburg which will get you to newton and then to hallsburg in two hops.
You can get from Burlington to hallsburg which will get you to newton and then to burlington in two hops.
You can get from Burlington to hallsburg which will get you to burlington and then to newton in two hops.
You can get from Burlington to hallsburg which will get you to burlington and then to hallsburg in two hops.