testing, or judging script used for 'Capture The Flag' contest
By : zombie
>>> update >>> i just attached the zip file, because i might remove it from the server...
because i used 5 php, 2 htm, 3 gif and one css file, i cant post it here (matt! smth to do?), so here is a link:
to fill up the space, i will just paste a README file that comes with ctf.zip...
(click on the 'Open in new window' link abowe, to read this properly)
project: Capture The Flag: php competition on codewalkers.com
file: README: detailing info on use of the judging script
author: zombie: Tomica Jovanovic <email@example.com>
disclaimer: this script is distributed in the hope that it will
be useful, but it is provided "AS IS" and WITHOUT
ANY WARRANTY, without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
more info: see: http://codewalkers.com/forum/?forum=php-contest
index.php if you want a quick star, just browse to this file
README this file
frames.htm left is grid, right is start, blah, blah...
start.htm asks you for the names of robot scripts
judge.php main judging script...
random/ example robot playing as white (going down + right)
rnd.red/ same thing, but for red (up + left)
*.gif and some bells and whistles
how to use:
name your robot scripts capture.php (as the rules say), place
them in DIFERENT dirs (as random/ and rnd.red/ ) and start from
the index.php. enter the names of the robot dirs in the text boxes,
and fire it up.
in the grid, white is represented as W, red as R, flags with
green, sticky traps with yellow and teleports with blue cells.
the button 'next' advances one STEP, not one turn. when you check
checkbox 'auto', and click on 'next', script goes in auto mode,
where it waits 1 sec after page gets loaded, and then advanced
to the next step. (if you want to change this pause, find and
change setTimeout() call in the judge.php function control());
the table below, show names of two robots (dir names), their
location, number of used sticky and teleport traps, death rays,
and enemy locators for each robot script.
last two rows show the move one robot made, and the response that
robot WILL receive on the NEXT turn (maybe i could do this the
opposite way, but this was logical to me)...
clicking on 'start over' below the grid gets you to the point
where you enter the names of robots to star over.
me some time, but now it is tested (and works) in
IE 6.0, Mozzila 1.0 and Opera 6.0 on Windows 2000.
it should work in NN 6.0+, and could in NN 4.0+
500 limit: there is NO limit to 500 turns, as the rules say,
because i wasn't going to make that kind off robots...
STUCK: the judging script shows as the robot IS called on the
turn when he is STUCK, but that is NOT the case, it
just looks like that (had to do it that way ;)
as it took me some time to recode this script to work in most
browsers (i was ashamed to release a script that doesn't), the
result is that maybe i am not going to have time to write a decent
robot, and thus, not win.
so, if you use this judging script, and you DO win, i would be
very happy if you would give me a 'php addict' t-shirt (the one
you will receive for winning) as that is all i need. ;)))
Click to Download File