Sudoku Py / C++11 / D?
Era Scarecrow
rtcvb32 at yahoo.com
Sun Aug 19 12:45:27 PDT 2012
On Sunday, 19 August 2012 at 09:39:53 UTC, maarten van damme
wrote:
> Great, I tried to get rid of the dynamic array "possibilities"
> by representing it using a static array of bools. This approach
> made it 4 times faster :)
>
> When I have a solid wifi connection I'm going to install dmd
> 2.60 to compile timon's code. In the meantime I've started
> beautifying the source so I can follow the logic.
>
> I still have a few questions however:
> - era claims his code takes 12 seconds on the hardest supplied
> puzzle yet it enters an infinite loop when the puzzle isn't
> solvable. Is he talking about a different puzzle?
The one supplied:
.....6....59.....82....8....45........3........6..3.54...325..6..................
The infinite loop is likely the brute force actually brute
forcing. I'm sure most other programs will lock up too until they
can prove it won't work. I can re-check my code, but if it can't
solve it it should tell you as it throws an exception. On ones
filled with a lot more numbers it will take a lot less time.
> -is it normal that const ref is slower then ref?
Ummm... No? I don't see why it would be.
More information about the Digitalmars-d-learn
mailing list