A simple visualization tool is provided. It comes packaged as an executable jar, or you can download the source. As in the past, to use this tool you
must create an executable program out of your TopCoder submission. This
executable should read the image from standard in and write your segmentation
to standard out. You should first read an integer S, on a single line by
itself. The next S lines will then contain the S rows, as they would be
provided by the TopCoder interface. After reading this input, you should
write exactly S lines, each with S characters, representing the S elements of
your output. For example, you could implement the following wrapper for your
recognize method.
main()
S = int(nextLine())
for(i = 0; i<S; i++)
input[i] = nextLine()
output = recognize(input)
for(i = 0; i<S; i++)
writeLine(output[i])
To run your program, you should execute:
java -jar Textures.jar -seed <seed> -exec <exec>, where <seed> is the random number generator seed used create the test case
(the seeds in the examples are 1-10) and <exec> is the executable command
to run your program. For some languages this will simply be an executable
file. For others, such as Java, this is the command to execute your compiled
code. If <exec> contains spaces it must be surrounded by quotes. Thus,
if you compile your Java code into a class Main, you would run the second
example by doing:
java -jar Textures.jar -seed 2 -exec "java Main"
You may optionally add a '-novis' flag to run the test without displaying the
result. Furthermore, if you omit the -exec parameter, the test case will be
displayed but not run.
To assist in your debugging, anything you write to standard error will be
forwarded to standard error. Because you are writing your segmentation to
standard out, it is important that you not write anything else.
As a final note, be sure you flush your buffers after writing any output, to
ensure that the visualizer receives the data.