[Haskell-beginners] tower hanoi problem

KC kc1956 at gmail.com
Sat Feb 14 21:23:14 UTC 2015


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 at 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20150214/040efe50/attachment-0001.html>


More information about the Beginners mailing list