This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/JIT/examples/hanoi.pl

17 lines
250 B
Prolog

:- initialization(main).
han(N,_,_,_) :- N =< 0.
han(N,A,B,C) :- N > 0,
N1 is N-1,
han(N1,A,C,B),
han(N1,C,B,A).
main :-
unix( argv([H|_]) ),
number_atom(N,H),
han(N,4,5,6),
statistics,
statistics_jit.