개발 아카이브/코드 저장소
하노이탑 코드 저장
운클라우드
2020. 10. 31. 17:59
반응형


function hanoi(num, from, to ,other){
if(num == 0) return;
hanoi(num-1, from, other, to);
console.log(`${num}을 ${from}에서 ${to}로 보낸다`);
hanoi(num-1, other, to, from);
}
hanoi(5,'A','B','C');반응형