icon

The Omnifarium - Sudoku/19.html

Notice

I am no longer posting new puzzles to this blog. For all of my Sudoku puzzles, old and new, please visit Sudoku in another section of this website. I will still create and offer new puzzles, in batches of a couple of hundred, once a week or so.

Sudoku #19

Category: Sudoku
Mon, 11 Jul 2005, 10:24

I got a bit impatient with the performance of my first Sudoku program written in Python. It often took hours for that program to output a good challenging puzzle. And so, looking for something to keep my mind off an upcoming visit to the hospital, I decided to rewrite the program in C.

(If you're not interested in computer programming, just skip ahead to todays puzzle.)

Python is a fabulous language, and perhaps my favorite programming tool. Using Python, I can crank out working code a lot faster than in any other programming language. But since it's an interpreted language, it's not necessarily the best choice for compute-intensive applications, like generating Sudoku puzzles.

Up until a year ago, most of my professional computer programming was done in C. It too is a fine programming language, ideal for systems programming, or for any compute-intensive application. Although I hadn't written any C code in the past 12 months, and although the Sudoku program ended up twice as big in C as the Python original, I had my new, much faster program up and running in no time.

This brings up an advantage of Python. It was very easy to get my original program running using Python. When it came time to rewrite into C, I already had the algorithms worked out and debugged. Debugging the C program turned out to be a lot easier than if I had started in C.

I'd like to bring up just one more point in todays rant. Some programmers like to think that they're able to do any programming task using just one programming language. While it certainly is possible to program almost any task using practically any language, in most cases there are languages better suited to particular tasks than others. For all programmers, it is vitally important to know multiple programming languages. For the case of Sudoku programming, although Python was a great choice as a prototyping language, the compute-bound nature of the problem made C the better choice for the final, production program.

With my new program, I can churn out Sudoku puzzles about 50 times faster than before. This means I can choose from more puzzles, and post the toughest of the tough. Todays puzzle is from the first batch of puzzles from my new program. It may well be the most challenging puzzle I've posted so far.

Hans

    7
     
9   5
    6
7 1  
    2
     
5    
    8
2   1
3    
     
     
     
     
     
    6
7   9
5    
    9
     
6    
  2 1
5    
9   4
     
3    

path: /Sudoku | permanent link to this entry

triangle