Jump to content

Towers of Hanoi: Difference between revisions

→‎Python: Graphic: Replaced left and right arrows with 'from' and 'to'
m (→‎Python - Graphic: (Updated caption positions and arrows directions))
(→‎Python: Graphic: Replaced left and right arrows with 'from' and 'to')
Line 3,558:
def go(ab):
a, b = ab
return [labels[a], ' ->to ', labels[b]] if a < b else [
labels[b], ' <-from ', labels[a]
]
return lambda ab: go(ab)
Line 3,687:
______
________________________
left ->to right
 
____
______ __
________________________
left ->to mid
 
______ ____ __
________________________
mid <-from right
 
__
______ ____
________________________
left ->to right
 
__
____ ______
________________________
left <-from mid
 
__ ____ ______
________________________
mid ->to right
 
____
__ ______
________________________
left ->to right
 
__
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.