prologdepth-first-searchwater-jug-problem

Depth First Search Prolog


I'm trying to solve a water, jug problem (one 7L, one 4L, get 5L in the 7L jug) using dept first search. However something keeps going wrong whenever I try to get a new state back from one of my actions. Prolog Code

I can't figure out what is going wrong, this is what the output looks like after trace: enter image description here

Thanks in advance for any help!


Solution

  • You should copy and paste your code into your question; we cannot copy and paste it from your images, which makes it more work to help you, which in turn makes it less likely that we will help.

    Some problems I noticed anyway: