Commit Graph

29 Commits

Author SHA1 Message Date
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
abc98edac9 Create project skeleton 2022-11-21 13:00:20 +00:00