In order to use the offline tester / visualizer tool for testing your solution locally, you'll have to modify your solution
by adding the main method that interacts with the tester / visualizer via reading data from standard input and
writing data to standard output. As long as you do not change the implementation of method makeTurn, this
doesn't affect the way your solution works when submitted to our server.
Here are example solutions for different languages, modified to be executed with visualizer. They all implement the same approach: find colors of pixels adjacent to currently controlled area which would make a valid turn; if such color(s) exsits, return a random of them, otherwise return a random valid color.
- You may modify and submit these example solutions.
- Solutions in different languages are not equivalent due to different random number generators used, and may produce different results.
- The visualizer provides timing based on wall clock time. The results of local runs with default time limit will differ from submissions on TopCoder servers. You can control time limit used for local runs with -timelimit option.
To run the tester with your solution, you should run:
java -jar Tester.jar -exec "<command>" -seed <seed>
Here, <command> is the command to execute your program,
and <seed> is seed for test case generation.
If your compiled solution is an executable file, the command
will be the full path to it, for example, "C:\TopCoder\solution.exe" or
"~/topcoder/solution". In case your compiled solution is to be run
with the help of an interpreter, for example, if you program in Java,
the command will be something like "java -cp C:\TopCoder Solution".
Additionally you can use the following options:
Finally, you can print any debug information of your solution to standard error,
and it will be forwarded to the standard out of the tester.
-manual (also enabled if no executable is provided): turn on manual play mode. To pick a color to switch to on your move, click on any cell of that color, either on the board or on the palette beside the board.
-timelimit 20 : set time limit of your solution, in seconds.
-novis : turn off visualization.
-sz 20 : set cell size for visualization.
-delay 50 : set the delay between turns to 50 ms.
-debug : print debug information during test run.