Anonymous user
Towers of Hanoi: Difference between revisions
m
added "versions" to two ruby entries.
m (→pictorial moves: used a template for the output section.) |
m (added "versions" to two ruby entries.) |
||
Line 3,759:
=={{header|Ruby}}==
===version 1===
<lang ruby>def move(num_disks, start=0, target=1, using=2)
if num_disks == 1
Line 3,808 ⟶ 3,809:
Move disk from 0 to 1 : [[], [5, 4, 3, 2, 1], []]
</pre>
===version 2===
<lang ruby># solve(source, via, target)
# Example:
|