Not an official ACM page
[1997 ACM Finals problem set | My ACM problem archive | my home page]

The Twenty-first Annual ACM International Collegiate

Programming Contest Visual Challenge

sponsored by

15 Puzzle

"15 Puzzle" is the official name of a puzzle consisting of a rectangular grid of 16 tiles with one blank tile and the remaining 15 tiles labeled with the letters 'A' through 'O'. Solving the puzzle means rearranging the tiles in order of their labels, with the blank tile in either the upper left or lower right corner of the grid. The only legal puzzle moves consist of exchanging the blank tile and any of its adjacent tiles (tiles that share a side with the blank tile). The picture below illustrates a simple 15 Puzzle that has been solved.

Your Visual Challenge is to create a 15 Puzzle in a graphical user interface. When the user clicks on a tile adjacent to the blank tile, that tile and the blank tile must exchange places. Initially the puzzle should be displayed in a solved state. In other words, the labels of the tiles must be in alphabetical order, with the blank tile in the upper left or lower right corner.

The judging of the visual challenge will be very subjective. Judges will be looking for the most interesting displays that solve the problem. Concentrate on the visual aspects of the solution. Applets that satisfy any of the following criteria are "acceptable," but the more of the criteria that are satisfied, the more favorably your work will be judged.

Applet displays:

  1. Rectangular grid of 16 tiles.
  2. Criterion a, plus all tiles are labeled with appropriate letters except the blank tile.
  3. Criterion b, plus clicking on a tile adjacent to the blank exchanges the blank and the clicked tile.
  4. Criterion c, plus any more graphical elements that might be desired such as colors for the tiles, a quit button, or the like. Let your imagination guide you.
  5. Criterion d, plus additional puzzle functionality such as a "scramble" button.
Your solution to this problem must be written as a Java applet named J. Do not create a standalone application. The code for your entire solution must be a single file named J.jav. Any additional files for your solution that are created by the AppletWizard, Resource Editor, or ResourceWizard must be incorporated into J.jav. (You may have to rename your source file before you submit it.) For judging, your applet will be imbedded in the following HTML code:
    <applet code=J width=400 height=400> </applet>

This page maintained by Ed Karrels.
Last updated November 6, 1997