Sudoku Py / C++11 / D?

Era Scarecrow rtcvb32 at yahoo.com
Wed Aug 15 00:01:11 PDT 2012


On Tuesday, 14 August 2012 at 22:31:16 UTC, bearophile wrote:
> http://www.reddit.com/r/cpp/comments/y6gwk/norvigs_python_sudoku_solver_ported_to_c11/
>
> http://nonchalantlytyped.net/blog/2012/08/13/sudoku-solver-in-c11/
>
> His C++11 port is 316 lines long:
> https://gist.github.com/3345676
>
> How many lines for a (not golfed) D translation of the original 
> Python code?
>
> Bye,
> bearophile

  Not Golfed? I don't recognize that term. I don't see the python 
source off hand, but I don't understand python anyways.

  I've managed to make a full solver in about 187 lines (4.5k) in 
the last hour (although lacking a few unittests); It does 2 
methods to attempt to solve it (Only possible option & brute 
force). Unoptimized it takes 82 seconds with the hardest supplied 
puzzle; But when optimized it goes down to 12 seconds.


More information about the Digitalmars-d-learn mailing list