August 27, 2009 10:50 AM PDT

Lego robot solves Sudoku puzzles

by Tim Hornyak
  • Font size
  • Print
  • 4 comments
(Credit: Hans Andersson)

Lego Mindstorms are futuristic toys for creative kids. But who knew these DIY robots can get creative themselves and solve puzzles?

Swedish programmer Hans Andersson bought a programmable Mindstorms NXT kit for his two daughters and then began tinkering with it himself. The result: a toy that can autonomously solve Sudoku puzzles in what looks like a matter of minutes.

The Sudoku Solver scans the entire puzzle with a light sensor before determining the missing digits in each square. Its computer performs image processing with a thresholding algorithm to make sense of the sensor data. Recognizing the existing numbers in the puzzle seems to be the most difficult part of the process.

Solving for missing numbers is easy with a backtracking algorithm, according to Andersson. "But since the Mindstorms processor is rather slow, and since it doesn't allow for recursive functions, it took some care to optimize it," he writes. The toy can still do Sudoku better than me.

Andersson has also created a Mindstorms robot called Tilted Twister that can autonomously solve a Rubik's Cube in about six minutes.

Gotta love robots. Now they're playing with our toys; next they'll be playing with us!

Crave freelancer Tim Hornyak is the author of "Loving the Machine: The Art and Science of Japanese Robots." He has been writing about Japanese culture and technology for a decade. E-mail Tim.
Recent posts from Crave
Want to see Google's new phone on YouTube?
Photographers bless improved Canon autofocus
Gadgettes Podcast 168: The Web obviously-not-exclusive-at-all-anymore Episode
Report: Apple event to be held January 26
Job ad suggests Xbox Live headed for WinMo phones
Tivit streams Mobile DTV to your iPhone, BlackBerry, and PC
Notion Ink tablet first with Pixel Qi display
Long-awaited Bibble 5 raw photo editor arrives
Add a Comment (Log in or register) (4 Comments)
  • prev
  • 1
  • next
by THETACTICUS August 27, 2009 1:19 PM PDT
what happens if it gets to a hard puzzle in which you have to guess either this num or that num?

Not all sudokus can be solved logically
Reply to this comment
by goober_nut August 27, 2009 2:05 PM PDT
I've done a few 1000 Sudoku puzzles and never once have I had to guess.
by EvanSei August 27, 2009 2:25 PM PDT
I have built and programed these robots in my Advanced principals of technology class and they are really fun, a bit challenging to get them to do exactly what you want but that makes it all entertaining.
Reply to this comment
by sbowler1 August 29, 2009 7:32 AM PDT
Hello Evan...I teach in Australia and would love to ask you about the build and the code behind writing curved characters. This is great, but for the level of students I teach (grade 7-9), the idea of solving Sudoku might be too much for them to do. but, I am constantly surprised! If you care to share, please respond here.
Reply to this comment
(4 Comments)
  • prev
  • 1
  • next
advertisement

About Crave

The name says it all. Crave is our blog about gorgeous gadgets and other crushworthy stuff. If you would like to contact Crave with a tip or comment, please write to: crave@cnet.com

Add this feed to your online news reader

Crave topics

15 sites that went kaput in 2009

Web sites launch all the time, but they also shut their doors. We highlight 15 that bit the dust this year.

Top 10 news stories of the decade

Let the debate begin: Was the iPhone more important than iTunes? Was anything bigger than Google finding a great business model? CNET offers its list of the 10 most important stories of the '00s.