Towers of Hanoi: Difference between revisions
Content added Content deleted
m (→Python - Graphic: (Updated caption positions and arrows directions)) |
(→Python: Graphic: Replaced left and right arrows with 'from' and 'to') |
||
Line 3,558: | Line 3,558: | ||
def go(ab): |
def go(ab): |
||
a, b = ab |
a, b = ab |
||
return [labels[a], ' |
return [labels[a], ' to ', labels[b]] if a < b else [ |
||
labels[b], ' |
labels[b], ' from ', labels[a] |
||
] |
] |
||
return lambda ab: go(ab) |
return lambda ab: go(ab) |
||
Line 3,687: | Line 3,687: | ||
______ |
______ |
||
________________________ |
________________________ |
||
left |
left to right |
||
____ |
____ |
||
______ __ |
______ __ |
||
________________________ |
________________________ |
||
left |
left to mid |
||
______ ____ __ |
______ ____ __ |
||
________________________ |
________________________ |
||
mid from right |
|||
__ |
__ |
||
______ ____ |
______ ____ |
||
________________________ |
________________________ |
||
left |
left to right |
||
__ |
__ |
||
____ ______ |
____ ______ |
||
________________________ |
________________________ |
||
left |
left from mid |
||
__ ____ ______ |
__ ____ ______ |
||
________________________ |
________________________ |
||
mid |
mid to right |
||
____ |
____ |
||
__ ______ |
__ ______ |
||
________________________ |
________________________ |
||
left |
left to right |
||
__ |
__ |