Unzip the contents of the ttt.zip file into
the root directory associated with our PythonWebserver (the one that
contains webserver.sh and webserver.bat).
Also copy your competitor python file into the same
directory. For the examples below, we'll be testing the
TTT-Random.py competitor, which was developed in python3, so
python3 will be the interpreter. In the place of
TTT-Random.py, you should be testing your own competitor program in the
same way as below, and getting results formatted in exactly the same way.
Let's test the program with a variety of appropriate command-line arguments:
python3 TTT-Random.py
result_prefix=fred id=1
(this will print: )
fred
author=P. Brooks
title=Random Mover
python3 TTT-Random.py result_prefix=fred id=1
result_file=george.txt
(this will create the george.txt file with the same contents as above)
python3 TTT-Random.py result_prefix=harry
result_file=george.txt board=__x______
(this will create or overwrite george.txt with some random move
formatted as below). However, instead of the silly commentary
("(pretty random, though)") , you should provide the Best move
also in English and a projection for the rest of the game, as in "Best
move: upper-left. Draw in 4 moves" :
harry
move=0
(pretty random, though)
Now we have to test it with the TimeDriver-py3.py
program, which will be the parent program running your competitor:
Copy your program into the cgi-bin directory containing the TimeDriver-py3.py program (TTT-Random.py should be there already). Then run the test below, substituting your program filename for TTT-Random.py.
python3 TimeDriver-py3.py
progfile=TTT-Random.py result_file=george.txt
result_prefix=what cutoff_time=4 board=__x______
(this will actually print something like)
what
move=6
(pretty random, though)
All right. It's showtime. Let's try your
program in its intended habitat...
Copy your own program file into the root directory of the PythonWebServer (if it's not there already).
Bring up the PythonWebServer.
In your browser, go to the URL: localhost:8000/startup.py
It will allow you to enter the name of your competitor program file (just the filename, no path is required)...
...and, hopefully, things will work... (though this rarely happens).
The first test is to press the Check Program button and see if you get your name and program title. If so, happy sailing....