TowerOfHanoi
Tower of Hanoi Overview

Introduction to Tower of Hanoi

The TowerOfHanoi module prints out the move set required to solve the Hanoi puzzle. It can solve a puzzle with any number of disks. It can also print out a visual state of each step.


Tower of Hanoi Classes

  • Rod - A class that Represents the rod in the classic Hanoi problem as a stack.
  • Hanoi - A class that encapulates all the movement of disks in the Hanoi problem.

Example Usage - print the move set and states to solve Tower of Hanoi with two disks.

#include "lib/hanoi.h"
int main() {
Hanoi hanoi(2, true);
hanoi.execute();
return 0;
}
Hanoi is a class that takes the action of moving disks between rods. It does this by encapsulates Rod...
Definition: hanoi.h:31