Slashdot Mirror


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.'

6 of 230 comments (clear)

  1. Put in context by Anonymous Coward · · Score: 5, Informative

    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.

    1. Re: Put in context by Anonymous Coward · · Score: 5, Informative

      Wiki link to those who aren't across Cambridge lingo

      http://en.m.wikipedia.org/wiki/Senior_Wrangler_%28University_of_Cambridge%29

      The Senior Wrangler is the top mathematics undergraduate at Cambridge University in England, a position once regarded as "the greatest intellectual achievement attainable in Britain."

  2. Re:It may have a .cpp extension but it's all C cod by AuMatar · · Score: 4, Informative

    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?
  3. The actual code by Anonymous Coward · · Score: 5, Informative

    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...

  4. Re:Lead By Example?! by antiperimetaparalogo · · Score: 4, Informative

    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!
  5. Re: Technically C++ by Sique · · Score: 4, Informative

    I guess, Angela Merkel knows. At least she wrote a program to simulate electron movements for her PhD thesis.

    --
    .sig: Sique *sigh*