Re: Soduku

2006-02-15 Thread Jack Diederich
On Wed, Feb 15, 2006 at 06:56:56PM -0800, Raymond Hettinger wrote: > [Jack Diederich] > > Is my math off or does 27ms mean 0.027 seconds? On my laptop (1.3GHz) > > an empty python program takes 10ms to run (0.010 secs). I ask out of > > vanity, my own solver takes .15 seconds to run (20 seconds fo

Re: Soduku

2006-02-15 Thread Raymond Hettinger
[Jack Diederich] > Is my math off or does 27ms mean 0.027 seconds? On my laptop (1.3GHz) > an empty python program takes 10ms to run (0.010 secs). I ask out of > vanity, my own solver takes .15 seconds to run (20 seconds for a 16x16 grid). Comparisons for individual puzzles are likely to be meani

Re: Soduku

2006-02-15 Thread Mikael Olofsson
Jonathan Gardner wrote: > How do you have a 16x16 grid for soduku? Are you using 16 digits? 0-F? > > The one I am using has 9 digits, 9 squares of 9 cells each, or 9x9 > cells. What alphabet you use is irrelevant. Sudokus has really nothing to do with numbers. You can use numbers, as well as let

Re: Soduku

2006-02-14 Thread Atanas Banov
you dont measure single run, you measure multiple runs using the "timeit" module (for me 1000 repeats was about right). here are some results which i recorded when i was implementing Sudoku solver (on AMD Athlon 1.25GHz, using the sample shown on www.sudoku.com front page): brute: 10

Re: Soduku

2006-02-14 Thread Jonathan Gardner
27ms == 0.027s How do you have a 16x16 grid for soduku? Are you using 16 digits? 0-F? The one I am using has 9 digits, 9 squares of 9 cells each, or 9x9 cells. The least efficient part of the algorithm is that part to calculate what to put in a hole (as anyone might've guessed.) My algorithm cal

Re: Soduku

2006-02-14 Thread Jack Diederich
On Tue, Feb 14, 2006 at 05:32:48PM -0800, Jonathan Gardner wrote: > Here at my job, Python gets no respect. > > A programmer here wanted to see which language among Python, Perl, and > Java was better. So he wrote a Python, perl, and Java version. Except > the Python version was 20x slower than th

Re: Soduku

2006-02-14 Thread Felipe Almeida Lessa
Em Ter, 2006-02-14 às 17:32 -0800, Jonathan Gardner escreveu: > So, one more story on why Python is really good. I think, at least with > 2.4, we should start bragging about Python's speed. I mean, it beats > Java AND perl! Maybe the other implementations also have errors? Well, I'm not saying Pyt