hanoi ( n from to other -- )


Vocabulary
rosetta-code.towers-of-hanoi

Inputs
nan object
froman object
toan object
otheran object


Outputs
None

Definition


:: hanoi ( n from to other -- )
n 0 > [
n 1 - from other to hanoi from to move n 1 -
other to from hanoi
] when ;