Sudoku Py / C++11 / D?

Era Scarecrow rtcvb32 at yahoo.com
Sun Aug 19 16:53:57 PDT 2012


On Sunday, 19 August 2012 at 21:24:26 UTC, maarten van damme 
wrote:
> The infinite loop was my mistake. I was looking at your outer 
> while loop but because you use exceptions instead of return 
> values it indeed throws an exception, my bad :)

  I have a revised version that only does 2 calls for the main 
solve now, but that's not that important.

> By replacing ref by const ref my program slowed down (looked 
> over a period of 10_000 runs). Not considerably but noticeable. 
> Compiled with -release -noboundscheck -O -inline. Anyone else 
> experiencing the same?

> Is copying a static arrays cheaper then recalculating the 
> lovation of collumns and squares btw?

  Are you using ref with it like int[9][9]? Or int[][]? It may be 
making extra calculations but i couldn't be entirely sure.

  Something to try, perhaps wrap the array into a struct and ref 
the struct. I did that in my revision (which also keeps track of 
possible choices within the struct).


More information about the Digitalmars-d-learn mailing list