Towers of Hanoi: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added DO-END labels, compressed sourse somewhat, removed superflous blanks. -- ~~~~) |
m (→simple text moves: replaced solid right arrow glyph. -- ~~~~) |
||
Line 1,639: | Line 1,639: | ||
/*─────────────────────────────DSK subroutine───────────────────────────*/ |
/*─────────────────────────────DSK subroutine───────────────────────────*/ |
||
dsk: move=move+1 |
dsk: move=move+1 |
||
say 'step' right(move,length(moves))": move disk " arg(1) ' |
say 'step' right(move,length(moves))": move disk " arg(1) '──►' arg(2) |
||
return</lang> |
return</lang> |
||
{{out}} |
{{out}} |
||
Line 1,673: | Line 1,673: | ||
The minimum number of moves to solve a 4 ring Tower of Hanoi is 15. |
The minimum number of moves to solve a 4 ring Tower of Hanoi is 15. |
||
</pre> |
</pre> |
||
===pictorial moves=== |
===pictorial moves=== |
||
This version pictorially shows the moves for solving the Town of Hanoi. |
This version pictorially shows the moves for solving the Town of Hanoi. |