Jump to content

Towers of Hanoi: Difference between revisions

→‎{{header|newLISP}}: added NewLISP version. Almost the same as Common LISP.
(→‎{{header|newLISP}}: added NewLISP version. Almost the same as Common LISP.)
Line 658:
Move disk 2 from 1 to 2
Move disk 1 from 3 to 2</lang>
=={{header|newLISP}}==
<lang>
(define (move n from to via)
(if (> n 0)
(move (- n 1) from via to
(print "move disk from pole " from " to pole " to "\n")
(move (- n 1) via to from))))
 
 
(move 4 1 2 3)
</lang>
 
=={{header|Objective-C}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.