V
V
Valery Makarov2013-12-19 04:50:34
Algorithms
Valery Makarov, 2013-12-19 04:50:34

Is there an implementation in any programming language of a slightly modified Tower of Hanoi puzzle?

We need an implementation in any programming language of a slightly modified puzzle "Tower of Hanoi" . The only difference from the classics is that all disks are located on the first rod before moving, but they are not ordered by diameter, they can be in any order. That is, the condition "initially smaller disks are located higher than larger ones" is not necessarily satisfied .
The rest of the rules are the same: moving from rod to rod, you need to assemble disks on one of them in an ordered state. In this case, larger ones cannot be placed on smaller ones, only 1 disk is allowed to be transferred at a time, there are only 3 rods.
Unfortunately, I did not find anything in RuNet. I tried to google on foreign sites, but due to my poor English, these searches were unsuccessful. It is also impossible to create a program on your own. Who will tell you where to find it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2013-12-20
@valemak

I'm not sure about the optimal solution, but at least it gives correct results: https://gist.github.com/jcmvbkbc/8050585

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question