Towers of Hanoi: Difference between revisions

m
No edit summary
Line 213:
Alternatively, to dispense with a mutating global variable, we could write:
 
<lang applescript>on run
map(hanoi(3, "left", "right", "mid"), arrows)
-- {"left -> right", "left -> mid", "right -> mid",
-- "left -> right", "mid -> left", "mid -> right", "left -> right"}
end run
 
 
-- n -> s -> s -> s -> [(s, s)]
Line 224 ⟶ 231:
end if
end hanoi
 
 
-- DISPLAY FUNCTION
9,659

edits