Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Tower of hanoi
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Viper




PostPosted: Fri Oct 21, 2005 7:38 am   Post subject: Tower of hanoi

http://www.cut-the-knot.org/recurrence/hanoi.shtml

i need help making this i know i have 2 use recursion but i could still use a few pointers plz n thx Razz
Sponsor
Sponsor
Sponsor
sponsor
StarGateSG-1




PostPosted: 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




PostPosted: 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


tower.t
 Description:

Download
 Filename:  tower.t
 Filesize:  4.6 KB
 Downloaded:  162 Time(s)

beard0




PostPosted: 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




PostPosted: Mon Oct 31, 2005 9:22 am   Post subject: (No subject)

thx all (sry bout the spam:))
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: