Owl Teach Yourself Java 2 in 24 Hours, Second Edition
HOME / ORDER THE BOOK / OTHER BOOKS / THANKS / PREVIOUS HOUR / NEXT HOUR
ROGERS CADENHEAD

Hour 4: Understanding How Java Programs Work

the Puzzle applet

If your Web browser can handle Java applets, there should be a sliding-tile puzzle above this paragraph. The following HTML tags are used to put the applet on this page:

<APPLET CODE="Puzzle.class" CODEBASE="java" WIDTH="307" HEIGHT="216">
<PARAM NAME="img" value="../images/mug.jpg">
<PARAM NAME="rows" value=4>
<PARAM NAME="cols" value=4>
<PARAM NAME="scramble" value=25>
</APPLET>

As you can see, this applet takes four parameter. The IMG, ROWS, and COLS parameters determine the image that is shown and how many tiles it is divided into. The last parameter, SCRAMBLE, determines how many tiles should be moved when the game is initially scrambled.

The Puzzle applet was created by MIT student Christopher Vincent. His site is no longer online, but another programmer, Jeremiah McLeod, offers a similar slide puzzle applet with source code on his Web site.

Before visiting it, you should continue to the next applet.

HOME / ORDER THE BOOK / OTHER BOOKS / THANKS / PREVIOUS HOUR / NEXT HOUR

Workbench | Books | RSS Feed | RSS Spec | Copyright 2018 World Readable