Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: tower hanoi problem (Mike Meyer)
2. Re: tower hanoi problem (YCH)
3. Getting "Discrete Mathematics Using a Computer" code to run
(Lawrence Bottorff)
4. Re: tower hanoi problem (Roelof Wobben)
5. Re: tower hanoi problem (Roelof Wobben)
6. Re: tower hanoi problem (YCH)
7. Re: tower hanoi problem (Roelof Wobben)
----------------------------------------------------------------------
Message: 1
Date: Sat, 14 Feb 2015 15:51:17 -0600
From: Mike Meyer <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID:
<CAD=7U2Bo_UrHan9NbD_Cc=k9kcp-wnrq7ihpvvphehjmlre...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Do you want to see the list for those two cases? Because in either the
recursive or iterative solution, there's only two cases.
The 2-disk moves are: [(a, c), (a, b), (c, b)]
The 3-disk moves are: [(a, b), (a, c), (b, c), (a, b), (c, a), (c, b), (a,
b)]
On Sat, Feb 14, 2015 at 3:40 PM, YCH <[email protected]> wrote:
> 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" <[email protected]>?? ??:
>
>> 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 <[email protected]> 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
>> [email protected]http://www.haskell.org/mailman/listinfo/beginners
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150214/13330d93/attachment-0001.html>
------------------------------
Message: 2
Date: Sun, 15 Feb 2015 06:53:11 +0900
From: YCH <[email protected]>
To: haskell-beginners <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID:
<CAPtM4g=+0xw7pMaDFKMX=OOX37h=9_q8eqegjlukrwgd7u6...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
> You can put the first disk on the second or the thirth peg.
Think a, b, c as 'src, target, temp'
So if you have only one disk on src peg, it has to go target peg. But if
you have two or more discs, you cannot put first peg on target peg.
hanoi 1 1 2 3 = [ (1, 2) ]
hanoi 2 1 2 3 = [ ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150215/c67c13d9/attachment-0001.html>
------------------------------
Message: 3
Date: Sat, 14 Feb 2015 17:30:13 -0500
From: Lawrence Bottorff <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Getting "Discrete Mathematics Using a
Computer" code to run
Message-ID:
<cafahfsv89qbkmg+8c-bavy4wgcumqhi1tm7rot-halwb6a+...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Saw this message:
Error Loading Stdm.lhs in Haskell platform 2012
*Iwan Awaludin* awaludin at gmail.com
<beginners%40haskell.org?Subject=Re%3A%20%5BHaskell-beginners%5D%20Error%20Loading%20Stdm.lhs%20in%20Haskell%20platform%202012&In-Reply-To=%3CCAHd5so7N7nX%3Ddiyk9Sv3%2B553gvqmXhWqGfgcHmAh%3D5XR0nHp8w%40mail.gmail.com%3E>
*Tue Sep 4 07:08:20 CEST 2012*
and that helped past that error. But now I get
[1 of 1] Compiling Stdm ( .../Discrete/Stdm02142015.lhs,
interpreted )
.../Discrete/Stdm02142015.lhs:1036:40-46:
Not in scope: `catch'
.../Discrete/Stdm02142015.lhs:1048:40-46:
Not in scope: `catch'
Failed, modules loaded: none.
This is on ghci 7.6.3
lb
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150214/55bcc4bb/attachment-0001.html>
------------------------------
Message: 4
Date: Sun, 15 Feb 2015 09:23:33 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150215/ded04dca/attachment-0001.html>
------------------------------
Message: 5
Date: Sun, 15 Feb 2015 09:29:45 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150215/966c4baf/attachment-0001.html>
------------------------------
Message: 6
Date: Sun, 15 Feb 2015 17:45:24 +0900
From: YCH <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID:
<captm4gnszwtvg8xiexwue5m36smfb3uwud97japd+joyd6o...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
How about if I say "Actually target was c not b and here is one more
disc. I put it on a. Now you should move all to c"
On Sun, Feb 15, 2015 at 5:29 PM, Roelof Wobben <[email protected]> wrote:
> Roelof Wobben schreef op 15-2-2015 om 9:23:
>
> YCH schreef op 14-2-2015 om 22:53:
>
>> You can put the first disk on the second or the thirth peg.
>
> Think a, b, c as 'src, target, temp'
>
> So if you have only one disk on src peg, it has to go target peg. But if you
> have two or more discs, you cannot put first peg on target peg.
>
> hanoi 1 1 2 3 = [ (1, 2) ]
> hanoi 2 1 2 3 = [ ?
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
> Hanoi 1 a b c - [ (a,b)]
>
> Hanoi 2 123 = [ ( a,b)]
> = [ (a,c) ]
> =[ (b,c) ]
>
>
> solved.
>
> Roelof
>
>
>
> Sorry, that one is wrong. Everything is on the 3th now.
>
> Another attempt.
>
> Hanoi 2 a b c = [ (a, c)]
> = [ (a, b)]
> = [ (c, b) ]
>
> Roelof
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
------------------------------
Message: 7
Date: Sun, 15 Feb 2015 09:51:52 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
YCH schreef op 15-2-2015 om 9:45:
> How about if I say "Actually target was c not b and here is one more
> disc. I put it on a. Now you should move all to c"
>
>
Hanoi 1 a b c
A -> C
Hanoi 2 a b c
A -> B
A -> C
B -> C
Hanoi 3 a b c
A -> C
A -> B
C -> B
A -> C
B -> A
B -> C
A -> C
Roelof
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 80, Issue 28
*****************************************