Article View: a.bsu.programming
Article #86747Re: Towers of Hanoi (nonrecursive)
From: Martijn van Buul
Date: Fri, 10 Oct 1997 00:00
Date: Fri, 10 Oct 1997 00:00
33 lines
2329 bytes
2329 bytes
It occurred to me that MidNight wrote: > One day, "Chris Lomont" <clomont@omni.cc.purdue.edu> decided to write: > > > >Deniz Tortop wrote in message > ><61etj1$4eu@dfw-ixnews3.ix.netcom.com>... > >>Desperately looking for the iterative version of the Towers of Hanoi > >>algorithm. Pseudo code or any programming language is more than > >enough. > >> > >>Any references you could think of would be great help. > >>Please send a reply to my e-mail address. > >> > > > >What, is this a homework assignment? > > Sounds like it to me. I've been wondering how to do it, but never had > the time to figure it out, so this is pretty interesting. I always thought that "Towers of Hanoi" was one of the best examples for a coding task to be quite easy using recursion, and a pain in the ass when done iterative.. (Unless you meen something like 10 print "Move stone from left stock to middle stock" 20 print "Move stone from left stock to right stock" 30 print "Move stone from middle stock to right stock" etcetera. Excuse me for using BASIC :) -- Martijn van Buul, martijnb@stack.nl
Technical Details
Message-ID:
<slrn63rl1l.3l2.martijnb@mud.stack.nl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<61etj1$4eu@dfw-ixnews3.ix.netcom.com> <61h5i2$roo@mozo.cc.purdue.edu> <61k124$sda$1@walter.acs.nmu.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fe306,5b0c24fabb02a1d7 X-Google-Attributes: gidfe306,public X-Google-Thread: f5380,5b0c24fabb02a1d7 X-Google-Attributes: gidf5380,public X-Google-Thread: 125116,5b0c24fabb02a1d7 X-Google-Attributes: gid125116,public X-Google-Thread: 108717,5b0c24fabb02a1d7 X-Google-Attributes: gid108717,public X-Google-Thread: ffead,5b0c24fabb02a1d7 X-Google-Attributes: gidffead,public X-Google-Thread: 105753,5b0c24fabb02a1d7 X-Google-Attributes: gid105753,public X-Google-Thread: 107d8b,5b0c24fabb02a1d7 X-Google-Attributes: gid107d8b,public X-Google-Thread: ff2b1,5b0c24fabb02a1d7 X-Google-Attributes: gidff2b1,public From: martijnb@mud.stack.nl (Martijn van Buul) Subject: Re: Towers of Hanoi (nonrecursive) Date: 1997/10/10 Message-ID: <slrn63rl1l.3l2.martijnb@mud.stack.nl> X-Deja-AN: 279138756 References: <61etj1$4eu@dfw-ixnews3.ix.netcom.com> <61h5i2$roo@mozo.cc.purdue.edu> <61k124$sda$1@walter.acs.nmu.edu> Organization: M.C.G.V. Stack Reply-To: martijnb@stack.nl Newsgroups: a.bsu.programming,adass.iraf.programming,comp.programming,comp.sys.be.help,comp.sys.be.programmer,comp.sys.cbm,netcom.programmers,rec.games.programmer