| | |
Towers of hanoi
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 5
Reputation:
Solved Threads: 0
'Hello everyone i was wondering if you can help me with this program, the problem is that i have already calculated the amount of moves by using the recursion method but i need also to display were should the disks should be moved. Thank you' 'This is my code'
Function Hanoi(ByVal howmany As Long) As Long
If (howmany = 1) Then
Return 1
Else
Dim imovs As Long
imovs += Hanoi(howmany - 1)
imovs += Hanoi(1)
imovs += Hanoi(howmany - 1)
Return imovs
End If
Function Hanoi(ByVal howmany As Long) As Long
If (howmany = 1) Then
Return 1
Else
Dim imovs As Long
imovs += Hanoi(howmany - 1)
imovs += Hanoi(1)
imovs += Hanoi(howmany - 1)
Return imovs
End If
•
•
Join Date: Apr 2008
Posts: 5
Reputation:
Solved Threads: 0
Hello, is that i am making a program related to a game call the towers of hanoi that you have a set ring that you have to past thru 3 towers but the problem is that you have only transfer one ring at a time and the ring should not be larger that one below it,they can only be relocated on the third tower bigger rings first to smaller rings in order, the code that i have made is to determine how many moves would be required to relocate all the rings to the third tower using the rules,The problem that i have is that the program can calcuate the number of moves needed to solve the game but i need also display instructions like move first tower to second towers for example,thank you for your attention, here is more information how the game is played http://en.wikipedia.org/wiki/Tower_of_hanoi
![]() |
Similar Threads
- Towers of Hanoi(Recursion) (C)
- Recursivity (C++)
- Help, i suppose (C++)
- Tower Of Hanoi (C++)
- Towers of Hanoi (C++)
Other Threads in the VB.NET Forum
- Previous Thread: Help with files
- Next Thread: DateTimePicker
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic binary bing button buttons center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist excel file-dialog firewall folder ftp google hardcopy image images insert isnumericfuntioncall listview login math memory mobile ms navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port print problemwithinstallation project reports" save savedialog searchbox serial soap sorting string table tcp temp text textbox timer toolbox trim update updown upload useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





