I've been a zone leader with DZone since 2008, and I'm crazy about community. Every day I get to work with the best that JavaScript, HTML5, Android and iOS has to offer, creating apps that truly make at difference, as principal front-end architect at Avego. James is a DZone Zone Leader and has posted 639 posts at DZone. You can read more from them at their website. View Full User Profile

Thursday Code Puzzler: Solve The 15 Puzzle

  • submit to reddit

It's Thursday already, so time for another code puzzler. The idea is simple: solve the coding problem as efficiently as you can, in any language or framework that you find suitable.

Note: Even though there really is nothing stopping you from finding a solution to this on the internet, try to keep honest, and come up with your own answer.  It's all about the participation!

Solve the 15 Puzzle 

You might call them sliding puzzles, mystic squares or one of the many other names. The idea is that you are presented with a jumble of numbers in a grid of 16 spaces, with 15 subsequent numbers and one blank space. An example of a solved puzzle looks like this: 

Today's challenge is to write  a program that will solve such a puzzle, sliding one number at a time in order to get the numbers displaying in order as above.

Catch up on all our previous puzzlers here


Thamizh Thomas replied on Wed, 2013/05/15 - 11:15pm

 The example is not visible. Please make it visible

Zaakir Mungrue replied on Mon, 2013/06/17 - 12:16pm

its been one month and its still not visible, ihate these kind of wesites that just a waste of bloody time!!


James Sugrue replied on Wed, 2013/06/19 - 1:46am in response to: Thamizh Thomas

Sorry - you should be able to see the image now. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.