# Thread: This is a tough logic question

1. ## This is a tough logic question

OK we all know about the towers of hanoi right. If not the towers of hanoi is were you have three pegs with n amount of blocks on each peg with different sizes. well the object of the game is to beable to move all the blocks on to a different peg and have them in the same order. The rules though are that you can only move one block at a time and can not move block that are greater in size on top of blocks that are less in size.

We all know that this can be done pretty easily through the use of recursion.

But have any of you ever given the thought of trying to do this problem without recursion???

Do any of you know if it is truly possible??

If so how??

2. LOL. I have doubts that anyone will be able to answer that question. That is pretty tough without the use of recursion.

3. Here's one solution (it's implemented in C++, if you can't convert it do a search on google and you'll probably find something).

4. > Do any of you know if it is truly possible??
Of course it is - recursion is just a disguised loop.

True its likely to be a lot less consise than a recursive solution, but it would be possible.