Singapore's Prime Minister Shares His C++ Sudoku Solver Code
itwbennett writes: Several weeks ago, during a speech at the Founders Forum Smart Nation Singapore Reception, Singapore's prime minister Lee Hsien Loong said that he used to enjoy programming, and that the last program he wrote was a Sudoku solver in C++. To back that up, earlier today he announced (on Facebook and Twitter) that his code is available to download. He wrote on Facebook that he wrote the program 'several years ago' and that the code does 'a backtrack search, choosing the next cell to guess which minimises the fanout.'
Not C++.
I guess C++ just sounds higher tech.
The guy was a Senior Wrangler (top math undergrad) at Cambridge before going to governance. I would hope he'd have picked up some coding skills along the way.
Now with some other leaders, I'm impressed when they spell their names right.
Its also all legal C++. Just because it doesn't use the advanced features doesn't mean it isn't C++. I'd argue that for something this simple its even better code this way.
I still have more fans than freaks. WTF is wrong with you people?
How's about including a link to the actual code?
Here you go:
https://drive.google.com/folde...
OR:
https://github.com/Doppp/LHL-S...
While not utilizing any of c++'s features, it is still valid c++. I think he might call it this because he may usually program in c++, but maybe just for this one project he did it in c, and since it's still legal c++ he finds it easier to just label it as c++. I actually quite like it - could use a bit more commenting, but overall very clean and readable. Should compile with a decent c or c++compiler...
"Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
That's common knowledge.
Bit Twiddling Hacks
but our former prime-minister had a restaurant... our great Greek dinner with mousaka,
Which one? You'd have hoped with that experience he might have had some idea how to balance the books. Did his restaurant go broke?
It was mister Samaras, the one who just lost the elections - (he claims) his restaurant did just fine (he had it years ago, together with a business partner, while studing in USA - yes, one more Greek restaurant in the States!). To be fair he did a good job as a prime minister in the elimination of deficit, he not only balanced the books, but provided a (significant) surplus. Our new prime minister...well...!
Antisthenes: "Wisdom begins by examining the words/names." - excuse my English, i am (slightly...) better with my Greek!
I guess, Angela Merkel knows. At least she wrote a program to simulate electron movements for her PhD thesis.