wumpus-world

Using Bayes formula

↘锁芯ラ 提交于 2020-02-08 10:01:43
问题 suppose the cave system contains 100 caves, of which 90 caves are without a hidden treasure and 10 caves contain a buried gold object. In 70% of the caves with a hidden treasure, the Wumpus has left behind his usual stench from digging about and bumping into walls. In the remaining caves with hidden treasures in them, the Wumpus has left no trace, i.e. they are non-smelly. Furthermore, all the caves without a hidden treasure are free from smell, since the Wumpus has fled the cave system. The

Prolog path backtracking runs forever depending on grid size

半城伤御伤魂 提交于 2019-12-11 06:49:46
问题 I've written some code to do backtracking in Prolog that generates all the possible paths to reach the Gold cell from the initial one (Agent). The input of getAllPaths is the map size NxN. When I run it with a 6x6 map it works perfectly and prints all the possible paths, but when I input any map size >= 7 it prints the first path and gets stuck there when I require the next possible solution with ; . Here is my code: gold(3, 3). agent(1, 1). getAllPaths(MS) :- agent(X, Y), assertz(worldSize