|
c02p108.cpp File Reference
Detailed Description
The Towers of Hanoi
- Date:
- 29 May 2006
- Chapter:
- Chapter 2
- Page:
- Page 108
- Version:
- 5.0
Definition in file c02p108.cpp.
Go to the source code of this file.
|
Functions |
void | solveTowers (int count, char source, char destination, char spare) |
Function Documentation
void solveTowers |
( |
int |
count, |
|
|
char |
source, |
|
|
char |
destination, |
|
|
char |
spare |
|
) |
|
|
|
Produces a solution to the Towers of Hanoi puzzle. - Precondition:
- count is nonnegative.
- Postcondition:
- None.
- Parameters:
-
| count | is the number of disks on the source pole before starting to solve the puzzle. |
| source | represents the pole holding all count disks before starting to solve the puzzle. |
| destination | represents the pole where all count disks will end up after solving the puzzle. |
| spare | represents the extra pole that is used while moving disks from source to destination. |
Definition at line 27 of file c02p108.cpp. |
|