Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] Towers of Hanoi Problem

Author
Message
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Jun 2007 05:31
The classic puzzle using 3 poles and 3 rings of decreasing size.
The objective is to move all 3 rings from the left pole to the far end pole by moving only one ring per turn and only placing a ring onto an empty pole or larger ring.
I found this problem in a computer science book as an example of a recursive function (one that calls itself). The book supplied me with pseudo-code for function so all i had to do was write it up in BASIC and work out how to display it on the screen.
I still don't quite understand the application for recursive functions but it is very clever.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jun 2007 06:34
OK? i didn't make a thread about this?
I've updated it now anyway, it sets itself a new target every time the puzzle is completed.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jun 2007 06:35
Might as well use up my noob posts on this thread. How many more do I need?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jun 2007 06:36
I hope im not a noob for much longer or my competition post might be late!!!
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 5th Aug 2007 02:18
Is no one interested in this?
I thought it was good.

Your signature has been erased by a mod because it was rubbish.
Insert Name Here
17
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 8th Aug 2007 20:42
That may be the longest string of needlessly double posts I've ever seen.
And just to annoy you, I won't comment on your program.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 9th Aug 2007 17:30
The program (which is btw also working in DBP without problems) seems to demonstrate the technique of recursive functions nicely, but I don't really understand the code. Maybe the whole thing would be more interesting if you took 8 "tower-parts", instead of 3...

Visit the DBPro - Speed up your game-Thread. http://forum.thegamecreators.com/?m=forum_view&t=88661&b=1

Login to post a reply

Server time is: 2024-11-22 18:42:00
Your offset time is: 2024-11-22 18:42:00