•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 363,445 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,234 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 763 | Replies: 19 | Solved
![]() |
•
•
Join Date: May 2008
Location: Infinte Castle, below Beltline
Posts: 182
Reputation:
Rep Power: 1
Solved Threads: 10
•
•
Join Date: May 2008
Location: Infinte Castle, below Beltline
Posts: 182
Reputation:
Rep Power: 1
Solved Threads: 10
for windows development, i use the Microsoft Visual C compiler. The "Express Edition" is completely free, and its the industry standard if you're developing PC apps. you can get previous versions (like 2005) if the 2008 doesnt work with your machine.
GCC would be the one for linux/unix
i mean, but hey, if you've got a project due, and you're allowed to use non-portable non-standard libraries like CONIO and BIOS... and you're used to workign with them, then dont change right now
just be aware, that these libraries will continue to haunt you and eat your soul until you exorcise them from your life.
as for my code, its working now just fine. and solves the Knight's Tour from any position on an 8x8 board in a few seconds .. would be a lot faster, but i display the board and moves to a terminal display, and that slows it down a lot.
but i can't just go and give it to you. that would defeat the point of you learning how to write your own code to solve problems.
all i did was use the old Warnsdorff's Algorithm. the algorithm itself is pretty simple, and has been around for some 200 years, to solve this exact problem.
.
GCC would be the one for linux/unix
i mean, but hey, if you've got a project due, and you're allowed to use non-portable non-standard libraries like CONIO and BIOS... and you're used to workign with them, then dont change right now
just be aware, that these libraries will continue to haunt you and eat your soul until you exorcise them from your life.
as for my code, its working now just fine. and solves the Knight's Tour from any position on an 8x8 board in a few seconds .. would be a lot faster, but i display the board and moves to a terminal display, and that slows it down a lot.
but i can't just go and give it to you. that would defeat the point of you learning how to write your own code to solve problems.
all i did was use the old Warnsdorff's Algorithm. the algorithm itself is pretty simple, and has been around for some 200 years, to solve this exact problem.
.
Last edited by jephthah : May 4th, 2008 at 5:22 am.
its hard for me to understand exaclty what you're doing.
are you trying to solve the knight's tour, once for each of the 64 starting positions?
does it matter whether the solution is open or closed? what exactly are you storing and recovering in the text files?
because there are literally trillions (million-millions) of closed solutions. i cant imagine you needing to provide more than one solution for each starting square.
if it helps any, each 64-round "tour" should be easily solved by the computer program in less than 5 seconds, and thats just overhead for various I/O. without printing to screen, should be much less than 1 second.
if it's hanging on you, you've got some major problem(s) somewhere, probably an infinite loop.
are you trying to solve the knight's tour, once for each of the 64 starting positions?
does it matter whether the solution is open or closed? what exactly are you storing and recovering in the text files?
because there are literally trillions (million-millions) of closed solutions. i cant imagine you needing to provide more than one solution for each starting square.
if it helps any, each 64-round "tour" should be easily solved by the computer program in less than 5 seconds, and thats just overhead for various I/O. without printing to screen, should be much less than 1 second.
if it's hanging on you, you've got some major problem(s) somewhere, probably an infinite loop.
•
•
Join Date: May 2008
Location: Infinte Castle, below Beltline
Posts: 182
Reputation:
Rep Power: 1
Solved Threads: 10
I find the algorithm Interesting, thank you.
I'll soon work with it after my semester exams are over.
Just now I have installed Win XP after the virus attack. I learned my lesson. Ill never download softwares in college. I will install Visual studio soon & learn visual C.
About recover.txt, I was tempted to find answers exhaustively, & I knew, there must be lots & lots of answers, So I used recover.txt to save the progress of the program & then when I run it back, it would continue with next answers.
I'll soon work with it after my semester exams are over.
Just now I have installed Win XP after the virus attack. I learned my lesson. Ill never download softwares in college. I will install Visual studio soon & learn visual C.
About recover.txt, I was tempted to find answers exhaustively, & I knew, there must be lots & lots of answers, So I used recover.txt to save the progress of the program & then when I run it back, it would continue with next answers.
theres no "learning" visual c. if you're using the free MSVC compiler, it's still just C...
MS compiler and libraries still has non-ANSI portability problems compared to GCC (linux) but given MS history, it could be a lot worse.
it at least doesnt introduce addtional problems such as what Borland does.
sorry about your virus problems. i doubt it has anything to do with college.
i still don't quite understand what you were trying to do... were you trying to solve "EVERY" possible solution from each of the 64 squares? the closed solutions alone number around 26,000,000,000,000 solutions.
i dont think you're going to get that accomplished anytime soon on your old Dell PC.
MS compiler and libraries still has non-ANSI portability problems compared to GCC (linux) but given MS history, it could be a lot worse.
it at least doesnt introduce addtional problems such as what Borland does.
sorry about your virus problems. i doubt it has anything to do with college.
i still don't quite understand what you were trying to do... were you trying to solve "EVERY" possible solution from each of the 64 squares? the closed solutions alone number around 26,000,000,000,000 solutions.
i dont think you're going to get that accomplished anytime soon on your old Dell PC.
•
•
Join Date: May 2008
Location: Infinte Castle, below Beltline
Posts: 182
Reputation:
Rep Power: 1
Solved Threads: 10
o i see. that's gotta suck. i guess i remember now, back in early 2000's, when a particularly nasty virus went around our university (a major state research institution) .... it really wreaked havoc on everyone for a good month or so. the good thing was, they finally got some competent security people in the sys admin department after that.
so this exercise of yours wasn't a homework assignement? just a personal project?
oh, and thanks for the comment.
.
so this exercise of yours wasn't a homework assignement? just a personal project?
oh, and thanks for the comment.

.
Last edited by jephthah : May 5th, 2008 at 10:27 am.
hey prabkar
i posted my attempt at solving the Knights Tour. code and Windows-based executable are here
http://www.daniweb.com/forums/post60...tml#post609519
i posted my attempt at solving the Knights Tour. code and Windows-based executable are here
http://www.daniweb.com/forums/post60...tml#post609519
I drink your milkshake.
•
•
Join Date: May 2008
Location: Infinte Castle, below Beltline
Posts: 182
Reputation:
Rep Power: 1
Solved Threads: 10
I read the program & I understood. It is a nice & Thanks a lot.
I want to write the same in windows based, and I will try & soon after I finish, I will ask for improvements. Ofcourse this would be my first windows based program.
And also I have never ever used enum before because I dint know where to use it. you have just shown me a way of using it, thanks for that too.
I want to write the same in windows based, and I will try & soon after I finish, I will ask for improvements. Ofcourse this would be my first windows based program.
And also I have never ever used enum before because I dint know where to use it. you have just shown me a way of using it, thanks for that too.
Last edited by Prabakar : May 19th, 2008 at 4:38 pm.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
- Word Association Game (Posting Games)
- The Vending Machine Game (Posting Games)
- ATi's 8500 still a work horse (Monitors, Displays and Video Cards)
Other Threads in the C Forum
- Previous Thread: Use of double pointer in functions
- Next Thread: Simple Fork code


Linear Mode