At least one world leader can code
Singapore’s prime minister dropped some coding knowledge Monday on Facebook.
Lee Hsien Loong posted a screenshot of a program he had written a few years back — ostensibly for fun — that solves Sudoku puzzles. Lee also included a link to the source code.
{mosads}The Southeast Asian leader mentioned during a speech two weeks ago that he had written the program in C++, a computer programming language.
Monday, the 63-year-old Lee backed it up on Facebook with some self-effacing commentary.
“The program is pretty basic,” Lee began, before proceeding with an explanation that would seem basic only to the digitally-savvy.
“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.”
For the serious coders, Lee then posed a question: “Here’s a question for those reading the source code: if x is an (binary) integer, what does (x & -x) compute? Hope you have fun playing with this. Please tell me if you find any bugs! – LHL”
The post had collected over 40,000 likes as of Tuesday afternoon, with scores of laudatory comments.
Lee is certainly one of the only world leaders who could pull off such a stunt. He learned his chops studying mathematics and computer science at the University of Cambridge.
A November review of the U.S. Congress found three lawmakers who could code.
President Obama memorably wrote one line of code using the programming language JavaScript, while meeting with middle school students at White House coding event in December.
He was the first U.S. president to ever write code, and has promoted the idea that all American students should become code literate.
Copyright 2024 Nexstar Media Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed..