domains
loc=symbol
predicates
hanoi(integer)
move(integer,loc,loc,loc)
inform(loc,loc)
clauses
hanoi(N):-move(N,left,right,middle).
move(1,A,_,C):-
inform(A,C),!.
move(N,A,B,C):-
N1=N-1,
move(N1,A,C,B),
inform(A,B),
move(N1,B,A,C).
inform(LOC1,LOC2):-
write("\n move disc from ",LOC1," to " ,LOC2).
Labels
- BFS (1)
- BNM (1)
- crypt arithmetic puzzle (1)
- depth first search (1)
- monkey banana problem (1)
- n-queen Problem (1)
- Tower of hanoi (1)
- water jug problem (1)
Friday, July 6, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment