[Haskell-beginners] tower hanoi problem

Mike Meyer mwm at mired.org
Tue Feb 17 16:57:14 UTC 2015


On Feb 17, 2015 10:50 AM, "Roelof Wobben" <r.wobben at home.nl> wrote:
>
> N reprent the number of disk

So how does moving 0 disks happen? That is what your first case deals with.

> Roelof
>
>
> Mike Meyer schreef op 17-2-2015 om 17:47:
>>
>>
>> On Feb 17, 2015 10:18 AM, "Roelof Wobben" <r.wobben at home.nl> wrote:
>> >
>> > This part I understand well.
>> >
>> > So you could do something like this:
>> >
>> > hanoi n 1 2 3
>> >    | n = 0 -> moves the last disk to the goal peg
>> >    | n != 0 -> moves all the other disk to the spare peg or to the
moves n -1 to the goal peg
>>
>> What does n represent here?
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150217/4d054beb/attachment-0001.html>


More information about the Beginners mailing list