-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
Uncaught SyntaxError C:\Users\Owner\Documents\TS\HelloWorlds\HelloHanoi\hanoi.ts:19
height: number,
^
function moveTower(
height: number,
fromPole: string,
toPole: string,
withPole: string
): void {
if (height >= 1) {
// Move tower of height-1 to an intermediate pole, using the destination pole.
moveTower(height - 1, fromPole, withPole, toPole);
// Move the remaining disk to the destination pole.
console.log(`Move disk from ${fromPole} to ${toPole}`);
// Move the tower of height-1 from the intermediate pole to the destination pole using the source pole.
moveTower(height - 1, withPole, toPole, fromPole);
}
}
// Call the function with the initial parameters.
moveTower(3, "A", "C", "B");
MartinJohns
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code