In order to use the offline tester for testing your solution locally, you'll have to modify your solution by adding the main method that interacts with the tester via reading data from standard input and writing data to standard output. Since you do not change the implementation of methods init and placeTile, this doesn't affect the way your solution works when being submitted to our server.
To simulate a call to init, your program should read the following data from standard input in this exact order:
Once this data is read, just pass it to your implementation of init method.
To simulate a call to placeTile, your program should read integers tile[0], tile[1], ..., tile[7] from the standard input (all in the same line separated by spaces), pass tile to your implementation of placeTile, print the return value to the standard output and flush the standard output.
In other words, you should implement the following pseudocode in the main method of your solution:
N = getInt(stdin) for (i=0; i < 8; i++) firstTile[i] = getInt(stdin) init(N, firstTile) while (stdin has more data): for (i=0; i < 8; i++) tile[i] = getInt(stdin) ret = placeTile(tile); printLine(ret) flush(stdout)
In order to run the tester, you should use the following command:
java -jar Tester.jar -exec "<command>"
<command> is the command you would use to execute your solution. If your compiled solution is an executable file, the command will just 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 parameters (all are optional):
You can print any debug information of your solution to the standard error stream and it will be forwarded to the standard output of the tester.
For more information on using offline testers / visualizers, please check the following recipe draft from TopCoder Cookbook. Note that this is not a troubleshooting thread, please use the match forum for questions instead.