Small improvement to xs0's showgame.php. Adds ability to jump ahead or back 4 turns to easily track your script's progress. By : thaneemmitt <? $inputfile=file("boards.txt"); // END CONF $PHP_SELF=$_SERVER["PHP_SELF"]; $allmoves=sizeof($inputfile); if (isset($_GET["move"])) { $move=(int)$_GET["move"]; if ($move<0) $move=0; if ($move>=$allmoves) $move=$allmoves-1; } else { $move=0; } echo "<center><h1>Turn ".($move+1)."</h1><br><br>"; echo "<a href=\"$PHP_SELF?move=0\">Start</a> | "; echo "<a href=\"$PHP_SELF?move=".(max(0,$move-4))."\">Prev 4</a> | "; echo "<a href=\"$PHP_SELF?move=".(max(0,$move-1))."\">Prev</a> | "; echo "<a href=\"$PHP_SELF?move=".(min($move+1,$allmoves-1))."\">Next</a> | "; echo "<a href=\"$PHP_SELF?move=".(min($move+4,$allmoves-1))."\">Next 4</a> | "; echo "<a href=\"$PHP_SELF?move=".($allmoves-1)."\">Last</a>"; echo "<br><br>"; echo "<img src=\"showmap.php?board=".$inputfile[$move].(isset($inputfile[$move-1])?("&last=".$inputfile[$move-1]):"")."\">"; ?> | 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! | <a href="http://zeus.developershed.com/shonuff.php?blackbird=3853&zoneid=442&source=&dest=http%3A%2F%2Fwww.ibm.com%2Fdeveloperworks%2Fspaces%2Fjazz%3FS_TACT%3D105AGY31%26S_CMP%3DDEVSHED&ismap="><img src="http://images.devshed.com/corp/img/news/jazz01.gif" alt="developerWorks Jazz space" align="left"></a>You've heard the buzz about Jazz... want to know more about it from a developer's perspective? Check out the Jazz space on developerWorks. This space is an up-to-date resource for developers, including technical information about Jazz and products built on Jazz, like Rational Team Concert Express. The Jazz space includes content from a wide variety of sources, including links, feeds, and comments from experts. FREE! Go There Now!
| | | | CakePHP is a stable production-ready, rapid-development aid for building Web sites in PHP. This "Cook up Web sites fast with CakePHP" series shows you how to build an online product catalog using CakePHP. 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!
| | | | As systems increase in complexity, communication between systems and software teams becomes more and more difficult. Now, there’s a way to improve product quality and communication.<br />Read the “Model Driven Systems Development” white paper to see how. Also included in this kit are more educational white papers, customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems.<br /> FREE! Go There Now!
| | | | To create, test, and deploy a Web-based application or Web service rapidly, you need a proven relational database, a standards-compliant Web application server, and a flexible IDE. Ideally, all these software packages are production-tested, simple to obtain, easy to use, and well integrated with one another. This tutorial shows you how to use IBM-backed open source and free software to kick-start your Java Web-based application development. You'll learn exactly where to download such components, install them, and get them working for you today. FREE! Go There Now!
| | | | In this tutorial, Sean Walberg helps you prepare to take the Linux Professional Institute Senior Level Linux Professional (LPIC-3) exam. In this second in a series of six tutorials, Sean walks you through installing and configuring a Lightweight Directory Access Protocol (LDAP) server, and writing some Perl scripts to access the data. By the end of this tutorial, you'll know about LDAP server installation, configuration, and programming. FREE! Go There Now!
| | | | This tutorial presents an innovative use of the well-known Really Simple Syndication (RSS) format's associative properties to emulate the functionality of a simple relational database. It demonstrates using RSS channels to store contact information and meeting information -- much as a personal address book and calendar does. It uses RSS elements and attributes such as items and guids to create a neural-network-like mesh of related data. FREE! Go There Now!
| | | | Here's a fun way to learn about DB2! Learn or teach the basics of DB2 and relational database with an interactive game called The DB2 Detective Game. The game teaches relational database concepts and shows how technology can be applied to solving real-life problems (the game's theme is a crime investigation). This tutorial has been updated for DB2 9. FREE! Go There Now!
| | | | Get a free trial download of the latest version of IBM Rational Functional Tester V7.0.1. Rational Functional Tester is an automated functional and regression testing solution for QA teams concerned with the quality of their Java, Microsoft Visual Studio .NET, and Web-based applications. FREE! Go There Now!
| | | | User communities play an important role in communication and collaboration around products, solutions and other areas of special interest to members. Successful communities are able to provide the right mix of content and services to deliver a value proposition that resonates with each audience. Join Tom Inman, VP of Marketing for Information and Platform Solutions as he introduces the new LeverageINFORMATION community. During this webcast, learn about the value provided by the community and how customers and partners derive value from the community in addressing their own technical and business challenges. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |