Singapore’s Prime Minister Shares Code For His Sudoku Solver

froggyboy604

Well-Known Member
Staff member
Manager
Full GL Member
Credits
23,428
Mature Board Viewing
Unlock full profile styling
Prime Ministers while having huge responsibilities and roles to play are only human too, which also means that apart from running the country, they are just like us and have a myriad of hobbies. Recently we reported that Singapore’s Prime Minister Lee Hsien Loong had a hobby and that hobby was coding.
 
In fact he even coded his own Sudoku solver program using C++ which is pretty admirable and a commendable effort. That being said for those who are wondering how he did it, you might be pleased to learn that the Prime Minister has decided to be generous and share his code via his Facebook page which also linked to a public Google Drive folder.
 
According to the description of his code, “The program is pretty basic: it runs at the command prompt, in a DOS window. 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.”
 
Read More
 
I heard C++ is a harder programming language to learn. I bet, Singapore's Prime Minister is one of the most tech savvy Prime Ministers in the world.
 
alakazam said:
I wonder if he didn't actually hire a programmer to code it for him, as some sort of publicity stunt... to make him stand out in the media...
I think this is a possibility. The Sudoku program may also be made by a family member, or friend to avoid a programmer from leaking his secret about hiring someone else to code for him. 

At least, this seems like a better attempt of being Tech Savvy than other Government officials and celebrities in the US who say they will join an online coding website, or learn how to code by themselves at home which is sometimes less believable because many people never finish those free online coding website tutorial, or finish reading and doing all the tutorials on those programming books since they are sometimes too hard to understand.
 
not often you hear of leaders knowing coding like C++
 
Indeed, it is not often that you hear leaders knowing C++.

It is also impressive that his program is a Sudoku Solver instead of a simpler program like a digital clock which is generally easier to program because clocks are one of the programs which C++ beginners learn how to program before programming more advance programs like 2D games.
 
Back
Top