Singapore PM praised after sharing Sudoku-solver code

Singapore's Prime Minister Lee Hsien Loong has revealed his computer programming skills after sharing on Facebook a Sudoku puzzle-solver code he wrote.

Lee, 63, a first-class mathematics graduate from the University of Cambridge in Britain, posted a screenshot of the code written in the C++ .

Describing the programme as "pretty basic", Lee also posted a link which contained the full printout of the code and invited readers to tell him if there were bugs.

Lee first revealed his talent for coding in a speech at a technology convention last month.

"I used to enjoy this; it is a long time since I've done anything," he said at the event, referring to the Sudoku code written a few years ago.

The Facebook post on the code has been shared nearly 15,000 times and had more than 42,000 likes by Wednesday afternoon, along with many comments praising Lee.

"Wonder which other PM in the world does this?" said one Facebook user, Judith Oliver.

Miles Berry, a computing lecturer in Britain, tweeted that he would like "coding challenges for our leaders before we vote on Thursday", referring to the nation's upcoming election.

But a group called HackerFantastic posted a Twitter message to Lee saying there was a "vulnerability" to his as it has a "fixed sized buffer on stack" and used "scanf".

Lee took the feedback in his stride, saying he would "add input validation" in a subsequent version.

© 2015 AFP

Citation: Singapore PM praised after sharing Sudoku-solver code (2015, May 6) retrieved 18 April 2024 from https://phys.org/news/2015-05-singapore-pm-sudoku-solver-code.html
This document is subject to copyright. Apart from any fair dealing for the purpose of private study or research, no part may be reproduced without the written permission. The content is provided for information purposes only.

Explore further

Singapore PM finally taps into Facebook, Twitter

23 shares

Feedback to editors