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! |
As organizations integrate software into every aspect of business, they are constantly pressured to deliver faster, better, and cheaper results. Unfortunately, a “dis-integrated” software delivery approach reduces returns while increasing costs. This IBM Rational White Paper shows how Integrated Requirements Management aligns organizations around maximizing value and keeping pace with change. FREE! Go There Now!
|
|
|
|
Explore how Rational and WebSphere software enable enterprise documentation in SOA environments. Specifically, a new integration between IBM WebSphere® Business Modeler and IBM Rational® Method Composer software can help technical writers more easily keep enterprise operations manuals in sync with changes that are made to business processes, resulting in more accurate and timely documentation that benefits the entire enterprise. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download the latest trial version of IBM Data Studio V1.1 at no cost. IBM Data Studio is a comprehensive data management solution that helps you effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life cycle utilizing a consistent and integrated user interface. Unlike other client-side data management solutions that focus on only one aspect of the application lifecycle or database administration, Data Studio complements the Rational Software Delivery platform, providing unparalleled flexibility for a heterogeneous data server environment across platforms. FREE! Go There Now!
|
|
|
|
Join this Rational Talks to You teleconference on December 6 at 1:00 pm ET to participate in an agile application development discussion and get your questions answered on using IBM Rational Method Composer in a distributed environment.Get your questions answered! 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!
|
|
|
|
Join this webcast to learn how IBM Rational's Functional Testing solution enables you to implement automation your way, at your pace, with your existing staff. In this webcast, you’ll learn how you can eliminate redundancy of manual test scripts, reduce errors, and increase test coverage through test automation. After this presentation you will understand how IBM Rational Functional Testing solution can streamline your manual testing and make test automation easily attainable. 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!
|
|
|
|
Because access to government information continues to be an area of concern for many U.S. citizens with disabilities, the U.S. government enacted Section 508 of the Rehabilitation Act in 2001 to ensure that government agencies create accessible Web content, enabling all citizens to access the information they need. A fully accessible Web site makes Web content accessible to all individuals, including those with disabilities, who may be accessing Web content via a variety of user agents. Common user agents include standard Web browsers, text-only browsers, assistive devices and mobile devices such as cell phones or personal digital assistants (PDAs). FREE! Go There Now!
|
|
|
|
In this tutorial, you can learn how to install and configure the IBM Rational Asset Manager Eclipse client, explore the different views in the Asset Management perspective, learn various search techniques, work with existing assets, and submit a new asset. FREE! Go There Now!
|
|
|
|
As businesses grow increasingly dependent upon Web applications, these complex entities grow more difficult to secure. Most companies equip their Web sites with firewalls, Secure Sockets Layer (SSL), and network and host security, but the majority of attacks are on applications themselves – and these technologies cannot prevent them. This paper explains what you can do to help protect your organization, and it discusses an approach for improving your organization’s Web application security. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |