Tuesday, May 05, 2015

Prime Minister of Singapore shares his C++ code for Sudoku solver...

There are few national leaders who can say that they really understand technology. Even fewer of them have written actual programming code. But Singapore's Prime Minister Lee Hsien Loong has outdone them all by posting the source code for a program he wrote to Facebook today. The PM asked for bug reports to boot.

Lee mentioned the program in a speech he gave at a reception on April 20 before IT industry leaders. "The last program I wrote was a Sudoku solver in C++ several years ago, so I’m out of date," he said. "My children are in IT, two of them—both graduated from MIT. One of them browsed a book and said, 'Here, read this.'" It was a textbook on the Haskell programming language, Lee recounted. "One day that will be my retirement reading."

After the speech, Lee received a number of requests to see the code for his program. So today he posted a screenshot of the code along with a link to a Google Drive folder containing the source code, a sample of its output, and a compiled Windows (well, DOS command line) executable to his public Facebook page. "The program is pretty basic: it runs at the command prompt, in a DOS window," he wrote. "Type in the data line by line (e.g. 1-3-8---6), then the solver will print out the solution (or all the solutions if there are several), the number of steps the program took searching for the solution, plus some search statistics."

"Hope you have fun playing with this," he concluded. "Please tell me if you find any bugs!" Source...

Related posts:
  1. Singapore prime minister's salary is greater than the combined salaries of...
  2. The day I passed maths...
  3. Bride in India walks out of wedding as groom fails simple math test!!!
  4. How a brain injury turned an average Joe into a math genius...
  5. Iraqi teenager in Sweden cracks centuries old maths puzzle...

No comments:

Post a Comment