Challenge: Recursive Towers of Hanoi
Apply what you’ve learned about recursion in the coding exercises in this lesson.
We'll cover the following...
Problem statement
Given 3 Pegs—A
, B
, and C
—and n
Disks, all on peg A, move all disks to Peg C
.
void move(int n, char sp, char ap, char ep);
📝 Note:
sp
will be the first peg,A
,ap
will be the second peg,B
, andep
will be the third peg,C
...