[Haskell-beginners] Difficulty understanding the Towers of Hanoi exercise from CIS194

Kim-Ee Yeoh ky3 at atamo.com
Sun Aug 30 09:16:44 UTC 2015


On Sun, Aug 30, 2015 at 1:27 PM, John Del Rosario <john2x at gmail.com> wrote:

> So if I start with 5 discs, then for the first step I'll be moving 4 (n-1)
> discs? But
> can't I only move 1 disc at a time?
>

Yes, the problem description elides a few explanations.

The idea is that there are two kinds of moves: "atomic" moves where we move
1 disc at a time.

And then there's a "big" move, comprising a sequence of atomic moves. One
big move accomplishes one unified goal. An example of a big move is moving
4 discs from one peg to another.

In the problem text, whether a "move" refers to an atomic move or a big
move is something left for the reader to infer.

A shortcut is to take every mention of "move" to mean a sequence of one or
more atomic moves. But that clashes with the fact that Move is a type
synonym representing only atomic moves.

Result: confusion.

More precise wording of the problem will help. I have nothing to do with
CIS194, but allow me to thank you for the pedagogical bug report all the
same.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150830/70b75d52/attachment.html>


More information about the Beginners mailing list