Fifteen


[Description]   [Instructions]   [Java Source]   [Dave's Home Page]   [Next Demo]


Classic Fifteen A Variation
You are using a browser that is not enabled to view Java applets. In order to view this applet, you need a Java-enabled browser, such as Netscape 2.0 for Windows 95/NT/UNIX, or Netscape 3.0 for the Macintosh. Just so you don't feel too left out, however, here's a snapshot what the applet looks like when it's running.
You are using a browser that is not enabled to view Java applets. In order to view this applet, you need a Java-enabled browser, such as Netscape 2.0 for Windows 95/NT/UNIX, or Netscape 3.0 for the Macintosh. Just so you don't feel too left out, however, here's a snapshot what the applet looks like when it's running.


Description

Fifteen is an applet that uses Java's AWT Button components as a means to display and control this classic puzzle-game. As simple as it is, it demonstrates some important Java concepts such as the use of synchronization, threads, and interfaces. It also demonstrates the separation of model classes from view and controller classes; the class that models the puzzle has no knowledge of the user-interface classes, such as the button grid and the flashing message. It could just as easily be hooked up to any other view or controller.

There is a notable flaw in this program. The simplistic shuffling algorithm does not take into account the fact that some configurations of tiles are in fact unsolvable. That's why a "Cheat" button is provided; to allow for easier demonstration of the behavior of the program.


[Top]   [Description]   [Instructions]   [Java Source]   [Dave's Home Page]   [Next Demo]


Instructions

Oh, come on! Figure it out, you're a smart person. Bear in mind, however, that some configurations are unsolvable, and this program does not filter those out. You might need to "Cheat." :)


[Top]   [Description]   [Instructions]   [Java Source]   [Dave's Home Page]   [Next Demo]


Java Source

Fifteen.java


[Top]   [Description]   [Instructions]   [Java Source]   [Dave's Home Page]   [Next Demo]