⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hanoi1.bak

📁 人工智能课程学习中的作业
💻 BAK
字号:
constants
l="left column"
m="center column"
r="right column"
predicates
hanoi(integer)
move(integer,string,string,string)
inform(integer,string,string)
clauses
hanoi(N):-move(N,l,m,r).
move(0,_,_,_):- !
move(N,A,B,C):- M = N-1,
	move(M,A,C,B),
	inform(N,A,B),
	move(M,C,B,A).
inform(N,X,Y):-write(" move disc "),write(N),nl,
               write(" from "),write(X),
	       write(" to the "),write(Y),nl.
	       
goal
write("please input the number you want to hanoi:"),readint(N),nl,
hanoi(N).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -