하노이탑 코드 저장
·
개발 아카이브/코드 저장소
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');