Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to solve hanoi tower ?

1 view
Skip to first unread message

zadkiel

unread,
Oct 31, 2000, 11:13:25 AM10/31/00
to
Hi every !
I have trouble to solve the hanoi tower problem.
can anyone help me ?
---------------------------
Jess> <== f-1 (move-a-stack (size 3) (from 1) (to 3) (other-peg-being 2)
(in-state 0))
==> f-2 (move-a-stack (size 2) (from 2) (to 3) (other-peg-being 1)
(in-state 1))
==> f-3 (move-a-stack (size 1) (from 1) (to 3) (other-peg-being 2)
(in-state 1))
==> f-4 (move-a-stack (size 2) (from 1) (to 2) (other-peg-being 3)
(in-state 1))
<== f-4 (move-a-stack (size 2) (from 1) (to 2) (other-peg-being 3)
(in-state 1))
==> f-5 (move-a-stack (size 1) (from 3) (to 2) (other-peg-being 1)
(in-state 2))
==> f-6 (move-a-stack (size 1) (from 1) (to 2) (other-peg-being 3)
(in-state 2))
==> f-7 (move-a-stack (size 1) (from 1) (to 3) (other-peg-being 2)
(in-state 2))
Move from peg 1 to peg 3
<== f-7 (move-a-stack (size 1) (from 1) (to 3) (other-peg-being 2)
(in-state 2))
Move from peg 1 to peg 2
<== f-6 (move-a-stack (size 1) (from 1) (to 2) (other-peg-being 3)
(in-state 2))
Move from peg 3 to peg 2
<== f-5 (move-a-stack (size 1) (from 3) (to 2) (other-peg-being 1)
(in-state 2))
Move from peg 1 to peg 3
<== f-3 (move-a-stack (size 1) (from 1) (to 3) (other-peg-being 2)
(in-state 1))
<== f-2 (move-a-stack (size 2) (from 2) (to 3) (other-peg-being 1)
(in-state 1))
==> f-8 (move-a-stack (size 1) (from 1) (to 3) (other-peg-being 2)
(in-state 2))
==> f-9 (move-a-stack (size 1) (from 2) (to 3) (other-peg-being 1)
(in-state 2))
==> f-10 (move-a-stack (size 1) (from 2) (to 1) (other-peg-being 3)
(in-state 2))
Move from peg 2 to peg 1
<== f-10 (move-a-stack (size 1) (from 2) (to 1) (other-peg-being 3)
(in-state 2))
Move from peg 2 to peg 3
<== f-9 (move-a-stack (size 1) (from 2) (to 3) (other-peg-being 1)
(in-state 2))
Move from peg 1 to peg 3
<== f-8 (move-a-stack (size 1) (from 1) (to 3) (other-peg-being 2)
(in-state 2))
10
Jess> EOF
Jess>


glauber

unread,
Oct 31, 2000, 2:13:26 PM10/31/00
to
In article <8tmr3g$jed$1...@gemini.ntu.edu.tw>,

"zadkiel" <zad...@pchome.com.tw> wrote:
> Hi every !
> I have trouble to solve the hanoi tower problem.
> can anyone help me ?


Emacs comes with one.

--
Glauber Ribeiro
thegl...@my-deja.com http://www.myvehiclehistoryreport.com
"Opinions stated are my own and not representative of Experian"


Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages