I'm looking to create a version of the url=http://en.wikipedia.org/wiki/Tower_of_Hanoi]towers of hanoi[/url] problem using C++. If your unfamiliar with the game, it involves moving hoops from one peg to another, without placing larger hoops on top of smaller hoops.
I am not looking for a program that will solve it automatically.
But I am having difficulty on deciding the best way to handle the logic behind the problem. I am going to do it with 3 hoops at first. But I need to decide how to represent these hoops being on each peg.
I was thinking of using 3 instances of a class something like this:
But thought that this could lead to far too many conditional statements for all the possible moves.
bool hoopA, hoopB, hoopC;
} Peg1, Peg2, Peg3;