
Write a program that prints the moves solving the Tower of Hanoi for the disk count given as its single argument, one move per line.
./hanoi_moves 1 | cat -eA C$./hanoi_moves 2 | cat -eA B$
A C$
B C$./hanoi_moves 3 | cat -eA C$
A B$
C B$
A C$
B A$
B C$
A C$./hanoi_moves 0 | cat -e./hanoi_moves 3 2 | cat -ewrong number of arguments$hanoi_moves.catoiwrite
Run the tests to grade your code
Write a program that prints the moves solving the Tower of Hanoi for the disk count given as its single argument, one move per line.
./hanoi_moves 1 | cat -eA C$./hanoi_moves 2 | cat -eA B$
A C$
B C$./hanoi_moves 3 | cat -eA C$
A B$
C B$
A C$
B A$
B C$
A C$./hanoi_moves 0 | cat -e./hanoi_moves 3 2 | cat -ewrong number of arguments$hanoi_moves.catoiwrite
Run the tests to grade your code
Memory will appear here