Downloads
PieceMover.jar
PieceMover.java
Instructions
To use the visualizer, you must write a program that reads it's input from
standard in and writes to standard out. The elements of the array input will
simply be given to you, in order, one per line. You may deduce the value of N
from the length of the first line. You should write your moves in the same
format as you would return them, one per line, and the visualizer will display
them as you print them.
Any output you write to standard error will be sent to the console for
debugging purposes. You must be careful not to print debugging to standard
out.
To run the visualizer, you should execute the following command:
java -jar PieceMover.jar -exec <executable command> -seed <seed>
<executable command> should be the command to execute your program. For
Java users, this will be something like "java MyClass". <seed>, of
course, is the seed to the random number generator. In addition to these
parameters, there are optional -size, -speed and -novis parameters. -size sets
the size of the pieces, in pixels, while -speed sets the initial speed, in the
range from 0 (paused) to 100 (no delay).
-novis will run the program without the only printing your score. For
example, you might run:
java PieceMover -exec 'java Sol' -speed 50 -size 6 -seed 3
As a final note, you should be sure to flush your output buffer, to ensure
that the visualizer receives your instructions.