News for hackers. Stuff that matters.
Re:Solving a Dungeons and Dragons riddle using Prolog by soveran on Tuesday January 03, 2023 @08:12AM (#34230891)
For an alternative solution, describe the directed graph by listing the nodes and using whitespace to represent the arcs:

  $ cat riddle
  Vixen Rudolph
  Vixen Prancer
  Vixen Dasher
  Dancer Vixen
  Comet Vixen
  ...
  Vixen Dasher
Then use tsort:

  $ tsort riddle
  Dancer
  Donder
  Comet
  Vixen
  Blitzen
  Dasher
  Rudolph
  Cupid
  Prancer
Re:Solving a Dungeons and Dragons riddle using Prolog by gpderetta on Tuesday January 03, 2023 @08:16AM (#34230925)
Yep, I was wondering if this didn't just need a topological sort (as shown by the make solution elsethread).