math - Alternate plain English algorithm for Towers of Hanoi -
there 4 plain english algorithms towers of hanoi puzzle available on wikipedia, when first solving puzzle, came algorithm different of solutions have seen.
wikipedia algorithms:
- iterative solution
- simpler statement of iterative solution
- equivalent iterative solution
- recursive solution
of course results of algorithms same, , different ways of thinking same thing, talking plain english ways of describing process.
my process goes this:
- never move same tile twice in row(obviously)
- prioritize moving right
- when moving right, move closest pole can legally moved to.
- when moving left, move farthest pole can legally moved to.
..
these rules differ other descriptions of algorithm in that:
the initial stack can placed on of 3 pillars , still work without adjustment rules needed.(unlike solutions 2 , 3 , 4)
i have tested programmatically, , solved puzzle in (2^n)-1
moves n
number of rings.
it seems me description different other plain english descriptions have found. has 1 seen description before? if so, please show reference.
i think description pretty same iterative solution. imagine posts arranged around circle or triangle, mod 3 style. instructions , wikipedia's instructions translate same thing in way of viewing things.
Comments
Post a Comment