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
developerWorks - FREE Tools! |
Join this webcast, to learn how the Rational Process Library can help with compliance issues, drive process improvement, and assist in service-oriented architecture (SOA) or Agile development. We will take a peek into the Rational Process Library with content around software and systems engineering (including RUP), operations and systems management, program and portfolio management, and asset and SOA governance. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download a free trial version of Lotus Quickr 8.0, which enables collaboration by transforming the way everyday business content such as documents, rich media, photos, and video can be shared. Lotus Quickr makes it faster and easier to share content of all types (not just documents) within virtual teams. It is designed to make it easier to collaborate across organizational boundaries, while continuing to work within the context of familiar desktop applications. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download IBM DB2 Express-C 9.5, a no-charge version of DB2 Express 9 database server. DB2 Express-C offers the same core data server base features as other DB2 Express editions and provides a solid base to build and deploy applications developed using C/C++, Java, .NET, PHP, and other programming languages. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download a free trial of the latest release of IBM Lotus Sametime Standard V8.0. Lotus Sametime Standard V8.0 is a platform for unified communications and collaboration that combines security features with an extensible, open solution including integrated Voice over IP, geographic location awareness, mobile clients, and a robust Business Partner community offering telephony and video integration. FREE! Go There Now!
|
|
|
|
IBM Enterprise Modernization solutions help organizations evolve core IT systems towards modern architectures and technologies—reducing the burden of maintenance and freeing up resources to develop new business requirements and capabilities. With the IBM Enterprise Modernization Sandbox for System z you can evaluate IBM Enterprise Modernization solutions focused on five key areas: Assets, Architectures, Skills, Processes and Infrastructures, and Investment. Each solution is based upon real customer experiences and offers a proven path to get you started with your modernization projects. FREE! Go There Now!
|
|
|
|
Rational Modeling Extension for Microsoft .NET enhances usability for code generation supporting a more intelligent refactoring. The latest enhancements enable organizations with Java and .NET systems and software development maintain architectural integrity across heterogeneous platforms. FREE! Go There Now!
|
|
|
|
Get a free trial download of IBM Lotus Forms V3.0 (formerly Workplace Forms), which provides a zero-footprint eForms solution to help you automate and move forms-based business processes off the desktop and onto the Web. With Lotus Forms, you can extend applications beyond the firewall by creating a single electronic form document ready for use in both thick and Web 2.0 thin client format. FREE! Go There Now!
|
|
|
|
You can now evaluate IBM Rational Asset Manager V7.0 online without installing or configuring it on your own system! Rational Asset Manager helps create, modify, govern, find, and reuse any type of development assets, including SOA and systems development assets. Rational Asset Manager helps you reduce software development costs and improve quality by facilitating the reuse of all types of software development-related assets. Visit developerWorks to learn more about this product and register to explore its capabilities online. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to try the IBM SOA Sandbox for people. The SOA Sandbox for people provides a trial environment with the necessary tooling and components required to enable consistent human and process interaction and collaboration, showing how you can improve user experience and business productivity. FREE! Go There Now!
|
|
|
|
Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |