问题:
下面一段代码是javascript递归实现汉诺塔的方法,其中代码我有些不清楚(红色标注的),
谁可以帮忙解释下,详细点
代码如下:
//disc为圆盘编号,src为原始位置,dst为最终位置,aux为辅助位置var hanoi=function(disc,src,aux,dst){
   if(disc>0){
    hanoi(disc-1,src,dst,aux);
    document.writeln('Move disc '+disc+' from '+src+' to '+dst+'<br>');
    hanoi(disc-1,aux,src,dst);
   }
}
hanoi(3,'Src','Aux','Dst');圆盘数量为3时它返回这样的解法:
Move disc 1 from Src to Dst
Move disc 2 from Src to Aux
Move disc 1 from Dst to Aux
Move disc 3 from Src to Dst
Move disc 1 from Aux to Src
Move disc 2 from Aux to Dst
Move disc 1 from Src to Dst