Hint:

- think about what you need to do in each recursive step and in the base case

- there is also an interesting way of viewing the problem

--
--

Sent from an expensive device which will be obsolete in a few months! :D

Casey
   

On Feb 13, 2015 1:09 PM, "Roelof Wobben" <r.wobben@home.nl> wrote:
Hello,

After a short break I try to make the next assignment of the CIS 194 course.
I do self-study.

Lets say we have 1 disk with 2 pegs then we have this :


type Peg = String.
type Move = (Peg, Peg)
Hanoi :: Integer -> Peg -> Peg -> [Move]

So I can do this Hanoi 2 a b

How can I proceed further.

I do not see how I can tell that the disk can move from a to b
And I do not see what the base case will be . I think when a is empty and b has a value.

Can anyone shine a light on this matter without telling me the answer ?

Roelof

typ    


_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners