View previous topic :: View next topic |
Author |
Message |
| x.m.yu
| Joined: 07 Aug 2008 | Posts: 6 | : | | Items |
|
Posted: Thu Aug 07, 2008 12:08 pm Post subject: |
|
|
It depends how you write your codes. If there is no comments, no blank lines, no compact lines. I think 300 lines is farely enough. (in C++) |
|
Back to top |
|
|
| Sisophon2001
| Joined: 05 Mar 2008 | Posts: 32 | : | Location: Cambodia | Items |
|
|
Back to top |
|
|
| dmhayden
| Joined: 01 Aug 2007 | Posts: 16 | : | Location: Central New Jersey | Items |
|
Posted: Sun Oct 12, 2008 12:46 am Post subject: |
|
|
2322 lines of C++, including Borland C++Builder GUI. The code is written for readability, elegance, and speed, in that order. I have classes for Bitmap, Square and Board. Techniques are:
Naked singles
Hidden singles
Pointers
Pairs
Tuples (extension of pairs, where N squares have the exact same N
posibilities)
Naked Tuples
Hidden Tuples
Brute force
The algorithms are all contained within the Board class, which has 1264 lines of code. |
|
Back to top |
|
|
| briturner
| Joined: 14 Oct 2008 | Posts: 75 | : | | Items |
|
Posted: Mon Nov 03, 2008 12:14 am Post subject: |
|
|
My Bit Based solver is running around 715 lines of code. The program is a command line program, but the line count includes code for displaying instructions, getting timings, and displaying answers (using ascii graphics).
The actual solver code, including tables, is around 300 lines of c code.
brit |
|
Back to top |
|
|
| zerothbase
| Joined: 02 Nov 2008 | Posts: 17 | : | | Items |
|
Posted: Fri Nov 07, 2008 1:39 pm Post subject: |
|
|
about 206 lines of code http://tinyurl.com/6krpwl (comments and blank lines removed)
solves 2x2, 3x3, 4x4, or 5x5 puzzles with a compile time option. |
|
Back to top |
|
|
| hack2root
| Joined: 10 Jun 2009 | Posts: 1 | : | | Items |
|
Posted: Wed Jun 10, 2009 7:59 pm Post subject: {sudoku} |
|
|
12000
<1M
development of the site at w w w . s u d o k u - a r t . c o m |
|
Back to top |
|
|
| rurban
| Joined: 20 Aug 2009 | Posts: 1 | : | | Items |
|
Posted: Fri Aug 21, 2009 2:18 pm Post subject: solvers in perl |
|
|
LOC's of various perl solvers: (not lines of code, also included comments and docs)
1659 lines Games::Sudoku::Win32
my own unfinished solver
with 10 basic rules and Win32 GUI
682 lines Games::Sudoku::Lite
simple backtracking only
408 lines Games::Sudoku::CPSearch
3191 lines, 8 files Games::Sudoku::SudokuTk
2375 lines Games::Sudoku::Component
+ 1149 lines Games::Sudoku::Component::TkPlayer (UI)
768 lines Games::Sudoku::Solver
664 lines Games::YASudoku
2683 lines Games::Sudoku::General
generic constraints solver
549 lines Games::LogicPuzzle
generic backtracking solver with sudoku sample
568 lines Games::Sudoku::OO
broken and simple |
|
Back to top |
|
|
| x.m.yu
| Joined: 07 Aug 2008 | Posts: 6 | : | | Items |
|
Posted: Sun Dec 13, 2009 6:23 pm Post subject: |
|
|
Ha~.
300 lines (without counting blank lines) in C++ are fairly enough for sudoku solver. |
|
Back to top |
|
|
| sudoking
| Joined: 20 Oct 2009 | Posts: 40 | : | | Items |
|
Posted: Mon Dec 14, 2009 10:29 am Post subject: |
|
|
x.m.yu wrote: | Ha~.
300 lines (without counting blank lines) in C++ are fairly enough for sudoku solver. |
There's a difference between "solving" and brute force. |
|
Back to top |
|
|
|