hanoi.pl

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:08.0
disk size 409 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
%query: move(i,i,i,i).
% From the Prolog tutorial by J.R.Fisher 1999 
% http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/contents.html


move(1,X,Y,_) :-  
         write('Move top disk from '), 
         write(X), 
         write(' to '), 
         write(Y), 
         nl. 

move(N,X,Y,Z) :- 
         N>1, 
         M is N-1, 
         move(M,X,Z,Y), 
         move(1,X,Y,_), 
         move(M,Z,Y,X).
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark