51 Commits

Author SHA1 Message Date
ee49b1f637 Fix eval target in Makefile 2024-07-31 11:27:08 +01:00
ad8c0dc9c4 Clear pvals when setting cell
This removes the need to check if a cell is determined in solve()
2022-11-26 14:29:44 +00:00
40c12c3458 Use LUT for group indexes instead of calculating on-the-fly 2022-11-26 14:27:34 +00:00
09a9f95740 Detect errors in evaluation program
Errors here meaning where a value is filled in but not correct (as
opposed to simply missing).
2022-11-26 02:21:16 +00:00
d9c416ffe0 Restructure solver to go cell-by-cell 2022-11-26 02:13:33 +00:00
38ce9d0abb Add step to solve() to check if cells have only one possible value 2022-11-26 01:12:50 +00:00
98a99ac340 Run 8 solving threads in parallel 2022-11-25 00:13:19 +00:00
516c9f5f55 Write program to evaluate results 2022-11-25 00:04:05 +00:00
08924e49d2 Add Makefile rule to extract puzzle solutions 2022-11-25 00:00:38 +00:00
025f6fd408 Statically link binary 2022-11-24 18:54:02 +00:00
3976206679 Generate results file in a portable way 2022-11-24 18:49:30 +00:00
a624030558 Mark Makefile as POSIX 2022-11-24 18:19:03 +00:00
da89556776 Flesh out readme 2022-11-24 18:18:49 +00:00
dc93517909 Add test data files to .gitignore 2022-11-24 18:18:49 +00:00
c461bfd0e8 Add profiling output to .gitignore 2022-11-24 18:18:49 +00:00
072c3db45b Save results to file instead of checking puzzles while solving 2022-11-24 18:18:49 +00:00
810ad45669 Add CFLAGS for profiling (commented out) to Makefile 2022-11-24 18:18:49 +00:00
050e770bb9 Add Makefile target to run solver 2022-11-24 18:18:49 +00:00
b48f0d6748 Add Makefile target for results file prep 2022-11-24 18:18:49 +00:00
93336c18fb Add target for puzzles pre-processing to Makefile 2022-11-24 18:18:44 +00:00
d7394181ba Remove uneeded braces in init() 2022-11-24 12:09:55 +00:00
d67f5571a4 Change compilation flags to improve optimization 2022-11-24 01:38:49 +00:00
7c6efa125e Remove uneeded branches in update()
Now that the value and possible values are independent, it doesn't
matter if we clobber the possible values of a cell that's been
determined.
2022-11-24 01:37:48 +00:00
1a84d900f2 Remove assert() from update() 2022-11-24 01:35:56 +00:00
f51e9a06b0 Use uint16_t instead of struct for cell state
- Bits 0-8 are the possible values
- Bits 9-12 is the concrete value
- Bit 15 is 1 if the cell is determined
2022-11-24 00:38:25 +00:00
4a2cfb392f Cast NSUD to double when calculating solved percentage 2022-11-24 00:01:42 +00:00
e2838d89e3 Remove gen() function 2022-11-23 23:46:18 +00:00
2ca91dec99 Run puzzles from file in main() 2022-11-23 23:44:39 +00:00
3d7a40cc58 Remove validity check from update() 2022-11-23 22:31:39 +00:00
f7d132397f Add filled() function as a faster alternative to check() 2022-11-23 22:30:26 +00:00
9bc49daf4c Add load() for loading sudokus from text 2022-11-23 22:17:54 +00:00
0ca01985cd Add steps to test columns and segments back
Turns out these are needed for some of them... I guess the way I was
generating them was somehow avoiding tricky ones being created?
2022-11-23 21:42:23 +00:00
5622e2ec9f Remove printing from runbench() 2022-11-23 18:14:20 +00:00
3fa089e4af Pass benchmark results out via pointer 2022-11-23 18:07:54 +00:00
37e7c6481a Make fill proportion a parameter to gen() 2022-11-23 17:56:12 +00:00
71db045c9f Seperate logic in main() into genpuzzles() and runbench() 2022-11-23 17:45:17 +00:00
a1c71f8f06 Reduce number of puzzles in benchmark 2022-11-23 17:14:47 +00:00
6ce468bb0d Remove additional newline from seed printout 2022-11-23 17:14:01 +00:00
27d7f3f01b Remove all the indirection 2022-11-23 16:26:55 +00:00
5aea129dc9 Only apply rules to rows
It goes faster this way.
2022-11-23 15:50:20 +00:00
119270c89b Apply rules to segments as well as rows and columns 2022-11-23 15:46:47 +00:00
d74b5410b6 Add number of passes to benchmark output 2022-11-23 15:46:21 +00:00
07c1fc7a0f Only report success rate and average time in benchmark summary 2022-11-23 15:23:11 +00:00
14eb8533e6 Add timing to benchmarks 2022-11-23 15:19:06 +00:00
ef7f0f0f73 Alter main() to run benchmark instead of single puzzle 2022-11-23 14:54:42 +00:00
39d417f2bc Implement check() function to verify solver results 2022-11-23 14:37:10 +00:00
4feaedf1a3 Create basic, rule-based solver 2022-11-21 19:24:34 +00:00
d6b9f3e2e5 Make generator always produce possible puzzles 2022-11-21 19:23:30 +00:00
5ae7a18227 Get seed from /dev/urandom instead of using time(2) 2022-11-21 19:22:16 +00:00
512580ab27 Implement basic generation and printing
I expect this will probably generate some impossible puzzles, but I'll
deal with that later.
2022-11-21 14:07:53 +00:00