home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / doslogo.zip / LOGOLIB.ZIP / HANOIHLP.LG < prev    next >
Text File  |  1990-06-11  |  467b  |  19 lines

  1. to hanoihlpr :number :from :to :other
  2. !
  3. ! Called by HANOI. Contains the actual recursive Towers of Hanoi algorithm
  4. !
  5. local "tcf 
  6. local "tct
  7. if equalp :number 0 [stop]
  8. hanoihlpr :number-1 :from :other :to
  9. make "tcf towercnt :from
  10. make "tct towercnt :to
  11. towerset :from :tcf - 1
  12. putdisk :from :number "temp
  13. putdisk :to :number "temp
  14. putdisk :from :number "erase
  15. putdisk :to :number "final
  16. towerset :to :tct + 1
  17. hanoihlpr :number-1 :other :to :from
  18. end
  19.