15 Commits

Author SHA1 Message Date
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
072c3db45b Save results to file instead of checking puzzles while solving 2022-11-24 18:18:49 +00:00
d7394181ba Remove uneeded braces in init() 2022-11-24 12:09:55 +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
e2838d89e3 Remove gen() function 2022-11-23 23:46:18 +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
37e7c6481a Make fill proportion a parameter to gen() 2022-11-23 17:56:12 +00:00
39d417f2bc Implement check() function to verify solver results 2022-11-23 14:37:10 +00:00
d6b9f3e2e5 Make generator always produce possible puzzles 2022-11-21 19:23:30 +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