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! |
You'll get answers to many questions and more from David Barnes, Lead Evangelist for IBM Emerging Internet Technologies. David will discuss aspects of Web 2.0 that bring value to corporations, academia, and government. He'll also discuss IBM's vision around Web 2.0, including the importance of remixability and consumability. The discussion will culminate with examples of various IBM Software Group solutions you can use to get ahead of the Web 2.0 adoption curve. FREE! Go There Now!
|
|
|
|
In this five-part "Building a grid system using WS-Resource Transfer" series, we look at the use of WS-Resource Transfer (WS-RT) in different areas of the grid environment -- from using it as a method for storing and recovering general information about grid-to-grid monitoring and management, and security. We also examine how WS-RT can be used for the distribution and division of work. In any grid, there is a huge amount of metadata about the grid that needs to be stored and distributed. Using WS-RT makes sharing the information, especially the precise information required by different systems in the grid, significantly easier. Here in Part 4, we look at both sides of the security session, both in terms of using WS-RT as an aid to the authorization process and at combining WS-Security with WS-RT for secure resource exchange. 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!
|
|
|
|
This Fall, IBM Rational talks to you directly through a special teleconference series giving you access to the best minds in IBM Rational - product experts and market thought leaders who will answer your questions during these pre-scheduled telephone conference calls. Register today! FREE! Go There Now!
|
|
|
|
Join this Rational Talks to You teleconference on December 11 at 1:00 pm ET to get tips on building your own plugins with Rational Method Composer. Get your questions answered! FREE! Go There Now!
|
|
|
|
This paper is about the critical role that a discipline called integrated requirements management can play in helping to ensure that your business goals and IT investments are continuously aligned—whether you are sourcing, integrating, building or maintaining software. It also looks at ways that automated IBM Rational® products can work together to help you use requirements in the very best way. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Tester for SOA Quality V7.0.1, a functional and regression testing tool that enables the creation, comprehension, modification and execution of testing GUI-less Web services. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly. FREE! Go There Now!
|
|
|
|
It's a good time to be a Web developer. You've never had more choices in terms of technologies. There are so many great open source Web servers, databases, programming languages, and development frameworks. No matter what combination of technologies you prefer to work with, there is an integrated development environment (IDE) that can increase your productivity: Eclipse. In this tutorial, Part 1 of a three-part "Web development with Eclipse Europa" series on how to use Eclipse for Web development with Java technology, PHP, and Ruby, we'll see how the latest release of Eclipse -- Europa -- can be used to rapidly develop Java Web applications. We'll use Java Platform, Enterprise Edition 5 (Java EE) for Eclipse to build a Web application for tracking and calculating baseball statistics. FREE! Go There Now!
|
|
|
|
IBM Lotus Notes 8 provides a wide range of developers the ability to provide customized, integrated user interfaces via composite applications and via custom sidebar and toolbar plug-ins. This webcast provides you with tips and techniques to use with out-of-the-box capabilities of Lotus Notes 8, and survey how you can share useful components within your own company and within a larger community. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |