home *** CD-ROM | disk | FTP | other *** search
- to hanoihlpr :number :from :to :other
- !
- ! Called by HANOI. Contains the actual recursive Towers of Hanoi algorithm
- !
- local "tcf
- local "tct
- if equalp :number 0 [stop]
- hanoihlpr :number-1 :from :other :to
- make "tcf towercnt :from
- make "tct towercnt :to
- towerset :from :tcf - 1
- putdisk :from :number "temp
- putdisk :to :number "temp
- putdisk :from :number "erase
- putdisk :to :number "final
- towerset :to :tct + 1
- hanoihlpr :number-1 :other :to :from
- end
-