Email
Password
Remember meForgot password?
    Log in with Twitter

article imageSingapore Prime Minister publishes his code for his Sudoku solver

By James Walker     May 5, 2015 in Technology
In a rather unusual technology story, Singapore's Prime Minister has posted the code for his C++ Sudoku solving program onto his Facebook page and then asked members of programming communities to help him to debug the source he wrote a few years ago.
Prime Minister Lee Hsien Loong, who graduated from Cambridge University with a mathematics degree and computer science diploma, first revealed the existence of the program in a speech he made to IT industry leaders on April 20th. He explained that he knows how to code, saying: "The last program I wrote was a Sudoku solver in C++ several years ago, so I'm out of date."
Since then, many people have asked to see the mentioned Sudoku solver in action. He has been praised by programmers worldwide for possibly being the only world leader ever to have written a functioning program.
Yesterday, Mr Lee honored these requests, publishing the entire source code for the program on Facebook. He also published a public link to a folder on Google Drive which contains the code available for download, a compiled Windows version of the program and a text file showing a few sample runs of the program and its output.
Praise for Singapore Prime Minister Lee Hsien Loon has been pouring in after he revealed he knows ho...
Praise for Singapore Prime Minister Lee Hsien Loon has been pouring in after he revealed he knows how to code
Ars Technica reports that the Prime Minister described the program as "pretty basic", asking readers to notify him "if they found any bugs". He also set a sophisticated technical challenge to knowledgeable programmers, asking "if x is an (binary) integer, what does (x & -x) compute?"
He revealed the answer an hour ago as being an old coding trick in which "the least significant '1' bit of x, i.e. the highest power of two that divides x", showing an extraordinary understanding of technology that has led residents of other countries to criticise their own leaders for not also possessing such vital modern-age skills.
The BBC notes how Mr Lee has transformed Singapore into a technically advanced nation designed to attract new innovations in technology. A coding Prime Minister is sure to help that image and has led to global admiration from populations increasingly appreciative of the virtues of knowing how to code.
More about Program, Programmer, Code, C, Solve