Owl Teach Yourself Java in 24 Hours, Fifth Edition
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / THANKS
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 / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / THANKS

Search terms used to find this page: Java programming, teach yourself, 24 hours, how to, learn, Sams, Macmillan, Java2, JDK1.5, Java 1.5, JDK 1.5, SDK1.5, Java 2 SDK 1.5, SDK 1.5, Java 2 version 1.5, J2SE 1.5, J2SE 5, Java 2 Standard Edition 1.5, Java 2 Standard Edition 5, Java 2 SDK, Java SDK, Rogers Cadenhead, tutorial, hands-on, source code, code, javac, java, appletviewer, help, learning, applet, application, Java Plug-in, plugin, Swing, GUI, interface, Java2D, IO, Java Web Start, games, novice, beginner, neophyte, rookie

Valid HTML 4.01!

Valid CSS!