16 std::stack<int> mDisks;
19 Rod(std::string name,
int capacity);
20 void push(
int diskValue);
36 void moveDisk(
Rod &src,
Rod &dest, std::ostream &out);
37 void printState(std::ostream &out);
40 Hanoi(
int disks,
bool printState);
41 void execute(std::ostream &out = std::cout);
Hanoi is a class that takes the action of moving disks between rods. It does this by encapsulates Rod...
Definition: hanoi.h:31
Hanoi(int disks, bool printState)
Initializes a Hanoi class with the size of the problem and whether we want to know state.
Definition: hanoi.cpp:54
void execute(std::ostream &out=std::cout)
A function that executes the number of disk moves and reports the move set.
Definition: hanoi.cpp:128
Rod is a class to maintains state about disk positions.
Definition: hanoi.h:13
bool isAtCapacity()
Checks if we have met the capacity limit.
Definition: hanoi.cpp:21
void push(int diskValue)
Definition: hanoi.cpp:25
Rod(std::string name, int capacity)
Initializes a Rod with a name and a capacity.
Definition: hanoi.cpp:13
bool isEmpty()
Definition: hanoi.cpp:23
int pop()
If the stack is not empty we will pop off the top disk.
Definition: hanoi.cpp:38