Contest Code

  Home arrow Contest Code arrow Capture The Flag -- The JUDGE
CONTEST CODE

Capture The Flag -- The JUDGE
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2002-08-08

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    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:

    http://www.fazi.co.yu/z/ctf.zip

    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 <tomica00@mail.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

    \* */



    files:

    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...

    grid.php spits 30*30 grid with images and id's for javascript

    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
    global.css



    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.



    known issues:

    browsers: because of javascript, this was an issue, and it took
    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 ;)



    consequences:

    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



    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Contest Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    CONTEST CODE ARTICLES

    - Visual Map Editor And Generator
    - Corridors map generator
    - PHP-JAVA Class Code Generator
    - Risk - print_map($game, $some_array_of_size_...
    - Risk: The Original ShowGame/Map
    - Showgame2
    - Risk map output
    - CTF-Judge, better "auto" controls
    - Capture The Flag -- The JUDGE

    Developer Shed Affiliates

     



    © 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap