食人者和传教士
我是 prolog 的新手,开始学习 prolog。 我发现在序言中解决传教士和食人者的谜题很有趣。我研究了很多论坛并找到了我认为是一个非常好的解决方案的链接。但有些我没有得到实际结果。输出上的动作似乎是错误的。我尝试跟踪程序,在分配值期间一切似乎都很完美,但不知何故解决方案是错误的。
我需要专家帮助才能知道逻辑错误到底在哪里。
来源:http://www.enrico-franchi.org /2008/12/missionaries-cannibals-and-prolog.html
I am a newbie to prolog and started learning prolog.
I found the missionaries and cannibals puzzle interesting to solve in prolog. I have researched a lot of forums and found the link which I think is a very good solution. But some how I am not getting the actual result. The moves on the output seem to be wrong. I tried to trace the program, everything seems perfect during the assignment of the values but somehow the solution is wrong.
I need experts help to know where exactly is the logical error.
Source: http://www.enrico-franchi.org/2008/12/missionaries-cannibals-and-prolog.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如我们在帖子评论中讨论的那样,没有逻辑错误,只是输出格式选择不当。
As we discussed in the comments of the post, there was no logical error, just an ill chosen output format.