First move everything except the bottom one to the spare peg.
"everything except the bottom one" refers to(n - 1)disks
Move the bottom one to the goal peg.
"the bottom one" refers to 1 disk
Move everything else from the spare peg to the goal peg.
"everything else" refers to(n - 1)disks
Joel Neely schreef op 17-2-2015 om 13:05:
Let's tweak your answers just a bit, calling the three pegs the "source", "goal", and "spare" pegs:
On Tue, Feb 17, 2015 at 5:23 AM, Roelof Wobben <r.wobben@home.nl> wrote:
- Where do I move the bottom (largest disk) ?
To the last peg, which do not contain any disk then .
From the source peg to the goal peg, which will/mustnot contain any disks.
- What must happen before I can move the bottom disk ?
I have to move the disk which above that disk.
Move everything else from source to sparel peg.
- What must happen after I move the bottom disk ?
All the other disk must be placed above that disk.
Move everything else from spare to goal.
So more questions/hints:
- How do you fill in the blanks?
- How do you put the three statements in order?
- How many disks does each statement talk about?
-jn-
1. I did already.
2. First move everything except the bottom one to the spare peg.
Move the bottom one to the goal peg.
Move everything else from the spare peg to the goal peg.
3. Only 2
Roelof
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners