[Haskell-beginners] tower hanoi problem

YCH dontdieych at gmail.com
Sat Feb 14 21:40:45 UTC 2015


Would you mind show code for only two cases? Just think about two cases.

hanoi 2 a b c
hanoi 3 a b c
2015. 2. 15. 오전 6:35에 "Roelof Wobben" <r.wobben at home.nl>님이 작성:

>  I know.
>
> Eveyone says there is a pattern but I do not see it at the moment.
>
> Maybe I do the wrong first move with more then 2 disk.
>
> You can put the first disk on the second or the thirth peg.
>
> Roelof
>
>
> Mike Meyer schreef op 14-2-2015 om 22:30:
>
>
>
> On Sat, Feb 14, 2015 at 3:27 PM, Roelof Wobben <r.wobben at home.nl> wrote:
>
>> KC schreef op 14-2-2015 om 22:23:
>>
>>>
>>> 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
>>>
>>>
>>>
>> Check if I can do another step or check if the end case all disk are on
>> the last peg.
>>
>> Im very curious what the interesting way is
>>
>
>  I suspect it's the iterative version that was already mentioned here.
> You were close to discovering it when worked through the problem on paper.
>
>
> _______________________________________________
> Beginners mailing listBeginners at haskell.orghttp://www.haskell.org/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> 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/20150215/12ad8d7a/attachment.html>


More information about the Beginners mailing list