org.jscience.computing.game.puzzle
Class TilePuzzleSamples

java.lang.Object
  extended by org.jscience.computing.game.puzzle.TilePuzzleSamples

public final class TilePuzzleSamples
extends java.lang.Object

class with static methods to provide standard configurations for TilePuzzle games. Simply use the return values for the constructor of a TilePuzzle game. Example:
TilePuzzle game = new TilePuzzle("Number Puzzle 3x3", TilePuzzle.getNumberPuzzle(3));

See Also:
TilePuzzle

Method Summary
static java.lang.Integer[][] getAIClassPuzzle()
          provides the standard 3x3 AI class number puzzle
static javax.swing.ImageIcon[][] getImagePuzzle(javax.swing.ImageIcon image, int splitNumber)
          Returns a customized image puzzle that is derived from the given image; each tile will be an ImageIcon fraction of the original image; the number of tiles is determined by splitNumber (puzzle size is splitNumber x splitNumber).
static javax.swing.ImageIcon[][] getImagePuzzle(javax.swing.ImageIcon image, int width, int height, int splitNumber)
          Returns a customized image puzzle where the original image is scaled to fit the given height and width
static java.lang.Integer[][] getNumberPuzzle(int size)
          returns a number puzzle of variable size (size x size)
static javax.swing.ImageIcon[][] getSFPuzzle(int splitNumber)
          calls getImagePuzzle() with a San Francisco skyline picture
static javax.swing.ImageIcon[][] getUSFlagPuzzle(int splitNumber)
          calls getImagePuzzle() with a sample US flag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAIClassPuzzle

public static java.lang.Integer[][] getAIClassPuzzle()
provides the standard 3x3 AI class number puzzle

Returns:
DOCUMENT ME!

getNumberPuzzle

public static java.lang.Integer[][] getNumberPuzzle(int size)
returns a number puzzle of variable size (size x size)

Parameters:
size - DOCUMENT ME!
Returns:
DOCUMENT ME!

getImagePuzzle

public static javax.swing.ImageIcon[][] getImagePuzzle(javax.swing.ImageIcon image,
                                                       int splitNumber)
Returns a customized image puzzle that is derived from the given image; each tile will be an ImageIcon fraction of the original image; the number of tiles is determined by splitNumber (puzzle size is splitNumber x splitNumber).

Parameters:
image - DOCUMENT ME!
splitNumber - DOCUMENT ME!
Returns:
DOCUMENT ME!

getImagePuzzle

public static javax.swing.ImageIcon[][] getImagePuzzle(javax.swing.ImageIcon image,
                                                       int width,
                                                       int height,
                                                       int splitNumber)
Returns a customized image puzzle where the original image is scaled to fit the given height and width

Parameters:
image - DOCUMENT ME!
width - DOCUMENT ME!
height - DOCUMENT ME!
splitNumber - DOCUMENT ME!
Returns:
DOCUMENT ME!

getUSFlagPuzzle

public static javax.swing.ImageIcon[][] getUSFlagPuzzle(int splitNumber)
calls getImagePuzzle() with a sample US flag

Parameters:
splitNumber - DOCUMENT ME!
Returns:
DOCUMENT ME!

getSFPuzzle

public static javax.swing.ImageIcon[][] getSFPuzzle(int splitNumber)
calls getImagePuzzle() with a San Francisco skyline picture

Parameters:
splitNumber - DOCUMENT ME!
Returns:
DOCUMENT ME!