View previous topic :: View next topic |
Author |
Message |
| kyriako
| Joined: 12 Jun 2008 | Posts: 16 | : | Location: Germany | Items |
|
Posted: Thu Jun 12, 2008 7:53 pm Post subject: Programming Nice Loops |
|
|
Hello,
I would like to program a function in C/C++ for solving Nice Loops.
Any idea?
Regards
Kyriakos. |
|
Back to top |
|
|
| Henk
| Joined: 13 Nov 2005 | Posts: 105 | : | | Items |
|
Posted: Fri Jun 20, 2008 9:37 pm Post subject: |
|
|
Hi,
Programming nice loops is hard... at least, it is hard to make the allgoritm fast and clean. I cannot post any code here, because my program uses a method for solving nice loops and other forcing chains that is over 10.000 lines of code.
The main idea is simple; just follow the chains in your code, save all of them in an array. Keep them in memory and when you want to solve single/dual/tripple/etx forcing chains, just cross them. You could also draw nice pictures whit this information!
I read some questions from you about undestanding forcing chains. You need to understand the basics before starting to program. If you do not understand the basics just google it.
http://www.intosudoku.com/Doc/NiceLoop.html
http://www.intosudoku.com/Doc/ForcingChain.html
This does not uses a lot of resources. My solver program uses this method and can generate over 25.000 puzzles a minute when using about 10Mb memory.
If you need more specific help for this, please let me know.
Henk _________________ Generate and solve Sudoku puzzles with Into Sudoku! |
|
Back to top |
|
|
| kyriako
| Joined: 12 Jun 2008 | Posts: 16 | : | Location: Germany | Items |
|
Posted: Tue Jul 01, 2008 6:48 pm Post subject: Programming Nice Loops |
|
|
Hello Henk,
thank you for your hints.
Meanwhile, I have implemented that method.
Download here:
http://homepages.compuserve.de/meinelg
kyriako. |
|
Back to top |
|
|
|