The Ultimate Jigsaw Puzzle

Introduction:
The 'Ultimate Jigsaw Puzzle' is the very first applet, I wrote as part of my Java learning
process. This on-line version of the Jigsaw puzzle deviates from the conventional board game
in several respects. It allows U to specify the Image to be used for the puzzle and lets U
define the complexity of the game by specifying how many pieces U want to break the image
into.
Players Guide:
The game interface is quite intuitive, as U would have already discovered by now. If U do
not see any images when U first load this page, do not despair, my good friend. Help comes
in the form of the Refresh button. Click on it and lo & behold, the images will appear on
the applet, mysteriously. The second option is to click on Solve and then on Scramble. As we R dealing with a lot of images, sometimes the applet loading
is faster than the image loading. U will see that initially the puzzle is already
scrambled("Oh! So that explains the disabled Scramble button"). U can start moving the
pieces around by clicking to select, dragging and dropping them. As U R playing, any of the
following events could be triggered:
- U get tired
- Frustrated
- Lose patience
- Get a call from Ur wife, girlfriend, mom, or Ur
dog, asking U wot U have been doing so late in the office/school
- Feel like trash for
failing to solve a simple 12 piece jigsaw puzzle or
- All of the above.
Anticipating the possibility of such a situation, and to save U from the dangers of a severe nervous breakdown, I have also
provided a Solve button. Ain't I sweet? Click on it, sit back and enjoy the small ballet,
performed by the pieces as they slide back home. This, folks, is exactly wot we mean when we say - Poetry in motion.
Click on the Scramble button and watch the pieces disperse and get ready for another game
'But wot about the button in the center?' U may ask. Ah, U noticed. That, my dear, is the
current local time, to remind U that how time flies when U R having a Blast with The Ultimate Jigsaw Puzzle. If U R wondering, wot the Sky-Diving image in the puzzle, is all about go ahead and read the whole story about my Sky-Diving experience.
Technical Stuff:
This applet uses Image processing logic and image filter APIs heavily to accomplish its
task. Crude artificial-intelligence techniques R used to identify, if all pieces R in the
correct relative positions. If so, then the applet takes over the job of completing the
puzzle for U. The cool animation sequence that U see in the end when the jigsaw puzzle is
magically solved, relies upon the multi-threading features of Java, to simultaneously move
all pieces to their final locations.
The image source and the number of pieces to break it into can be specified by defining the IMAGE, ROWS and COLUMNS parameters in the HTML page that contains the applet. Of course, if U R too lazy, U can skip these parameters and just
use the default parameters defined within the Java code:
- Image = "fall100.gif" (which means that U have to call Ur default image by the same name
if U plan to use the .Class file directly)
- Rows = 3
- Columns = 4
Security Considerations and Limitations:
- Bear in mind that the 'Ultimate Jigsaw Puzzle' is run as an applet, on the web, and not
as a normal Java application. Which in turn means that, it does not have the rights to
access any of the images not residing on the internet server, hosting the web page. Hence
all images that U wish to use for the puzzle have to be present on the same server (and in
the same directory as the applet class - UltimateJigsaw.class, if U decide to ignore the PARAMETER tag in the HTML document.
- This applet runs best under Microsoft Explorer. Check the configuration to ensure that it
allows execution of all applets. All my attempts to make it run with Netscape's Navigator
have failed. I would appreciate any help in this regard.
- The applet may not be displayed if U R behind a firewall/proxy server.
Feedback:
Alrighty then! U have had enuff time to ogle at the beauty, flexibility and the capabilities
of the 'Ultimate Jigsaw Puzzle'. If U have any questions, suggestions or feedback regarding anything
even remotely connected to this, please send me a mail at [email protected]
Another Java application that U may find interesting is the Network Tic-Tac-Toe.
Back to the Main Page