汉诺塔
function hanoi(n:number,from:number,to:number):void{ if(n === 1){ console.log(`${form} move to ${to}`) return } let temp = 6 - from - to hanoi(n - 1, from, temp) console.log(`${form} move to ${to}`) hanoi(n - 1, temp, to)'}
原创
2021-04-04 14:32:28 ·
90 阅读 ·
0 评论