JavaScript汉诺塔问题解决方法
本文实例讲述了JavaScript汉诺塔问题解决方法。分享给大家供大家参考。具体实现方法如下:
<script language="javascript"> var han=function (disc,src,aux,dst){ if(disc>0){ han(disc-1,src,dst,aux); document.writeln("move disc "+disc+" from "+src+" to "+dst+"<br/>"); han(disc-1,aux,src,dst); } }; han(10,"src","aux","dst"); </script>
希望本文所述对大家的javascript程序设计有所帮助。
相关推荐
蜗牛慢爬的李成广 2020-04-07
ericxieforever 2020-03-28
shawsun 2020-03-01
蜗牛慢爬的李成广 2019-12-08
HLW0 2012-02-01
sxyyu 2019-07-01
LITElric 2019-07-01
wangxiaohua 2010-05-30
wuxiaosi0 2019-03-13
cyjsky 2017-05-20
MrA 2018-07-05
jiayuqicz 2018-04-18
yancey木易的blog 2018-03-19
tiewen 2019-02-18
HTML学堂码匠 2016-05-17
danwenxuan 2014-07-23
jiayuqicz 2018-09-27
不羈 2008-05-02