i need help making this i know i have 2 use recursion but i could still use a few pointers plz n thx
Sponsor Sponsor
StarGateSG-1
Posted: Fri Oct 21, 2005 9:42 am Post subject: (No subject)
All I can say is Good Luck, and post what you have and we can help you, you need to be very forward when asking for help.
Pointer #1:
Read that site, it tells you wnat you need, then look in the help file.
Viper
Posted: Fri Oct 21, 2005 11:10 am Post subject: (No subject)
this is what i have so far this version allows you to play the tower but i need the computer 2 b able to solve it im in the middle of changing it rite now so in order for you 2 play you might have 2 delete incomplete stuff
Posted: Fri Oct 21, 2005 11:35 am Post subject: (No subject)
Here is a solving procedure I made that you can adapt:
code:
procedure move (nblocks : int, p1, p2, p3 : string (1)) % P1 is name of start pin, P2 is name of destination pin, P3 is the name of the other pin
if nblocks = 1 then
% Move top from P1 to P2
else
move (nblocks - 1, p1, p3, p2)
move (1, p1, p2, p3)
move (nblocks - 1, p3, p2, p1)
end if
end move
Viper
Posted: Mon Oct 31, 2005 9:22 am Post subject: (No subject)