 |
|
 |
I downloaded the source code and tried to compile it and as I might have expected the compilation failed. I virtually never use Microsoft Compilers for reasons that I wont go into here. So I then pulled down the Demo file and this does not appear to work either but gives a message "The application has failed to start because the application configuration is incorrect. Re installing the application may fix this problem" so what should the application configuration be ??
|
|
|
|
 |
|
 |
I believe you get that error when it is a Debug build of a .NET application. Unfortunately to resolve you need VS2K5.
|
|
|
|
 |
|
 |
I am fairly new to the codeproject so maybe I need some more learning.
I personally do not use MS compilers (I use Borland C++ Builder Enterpise Version) and know little about .NET applications. What is VS2K5 ? and where would I get it from ?
|
|
|
|
 |
|
 |
I see the text that should be a link to the source, but it isn't a link...
|
|
|
|
 |
|
 |
OOPS! I guess I made a mistake while modifying the article. Will make it proper now. Sorry for the trouble.
|
|
|
|
 |
|
 |
Now the link should work. Thanks for pointing out the mistake to me. Do give your valuable feedbacks after looking at the code.
|
|
|
|
 |
|
 |
This looks very interesting, but maybe you should provide a description of the source in you article?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
 |
|
 |
Sure, I am willing to give a description.
As I have already said the code uses backtracking.
I have included comments in the code.
If these are not sufficient, I would like to know particularly which area of the code u want a description for.
|
|
|
|
 |
|
 |
Articles make a much better read if you go trough the concepts and eplain why you made certain choices. An article like this is more useful from an achitectual point of view, compared to a functional.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
 |
|
 |
Thanks for the feedback.
I will include some info on why i chose backtracking.
|
|
|
|
 |
|
 |
Well now i've included some info on why i chose backtracking.
Is this sufficient?
|
|
|
|
 |
|
 |
Yes it is quite informative. I would like an example of the core code you use, but that is just because I cannot download the source....
Overall a very cool and interesting article, well done.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
 |
|
 |
Thanks. Here is a part of function evaluate() where backtracking is used. for(i=0;i<9;i++){ for(j=0;j<9;j++){ if(rq[i][j]){ do{ *m[i,j]=l[i][j].prel();//make next guess for m[i,j] if(!(*m[i,j])){//if no guess left, then backtrack if(!backtrack(i,j,rq,l)) return r; break; } //check to see if the last guess made leaves m in a valid state if(validsarr(de3=row(i),0)){ if(validsarr(de1=col(j),0)){ if(validsarr(de2=grd(grid(i,j)),0)){ delete[] de3; delete[] de1; delete[] de2; break;//last guess made leaves m in valid state } delete[] de2; } delete[] de1; } delete[] de3; }while(1); if(i==li&&j==lj){//if position just filled was last one to be filled to give a solution if(addtosoln()){//add present state of m to sol;if succesful in doing so r++; if(r==LIMIT) return LIMIT; if(!backtrack(i,j,rq,l)) return r; } else return -1;//indicate error(though more solutions exist then present in sol, and though number of solutions in sol is less than LIMIT,we could'nt add to sol,probably due to memory shortage) } } } }
|
|
|
|
 |
|
 |
That is a very inteligent way to handle it.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
 |