<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD> <TITLE>Programmer's Challenge</TITLE>
<META NAME="Description" CONTENT="www.mactech.com is the global entry point for technology information for the Apple Macintosh. Find links to all Apple Macintosh technology content here.">
<!-- END MT_NAVBAR INCLUDE --> <!-- End NavBar --> </TD> <!--BEGIN DROP SHADOW--> <TD VALIGN=TOP> <IMG SRC="http://www.mactech.com/images/left_side.jpg" ALT=""> </TD> <!--END DROP SHADOW--> <TD VALIGN=TOP WIDTH="100%" BGCOLOR="#FFFFFF"> <TABLE width="95%" align="CENTER"> <TR> <TD><!--<form action="http://macte.ch/" method="post"><script language="JavaScript" type="text/javascript">--><!--document.write("<input name=\"fullurl\" type=\"hidden\" value=\""+document.location+"\" />");document.write("<input type=\"hidden\" name=\"rnd\" value=\""+Math.round(Math.random()*99999999)+"\" />");//--><!--</script><h5><center>Follow MacTech now on <a href="http://www.twitter.com/mactech">Twitter</a>. Also, <a href="http://www.twitter.com/mactechwire">MacTech News Releases on Twitter as well</a>.<BR>Generate a short URL for this page: <input type="submit" class="submit" value="Get Link!" /><HR width=80%><center></h5></form>--><!-- END MT_HEADER INCLUDE --><P></P><H2 ALIGN=CENTER>The Programmer's Challenge</H2><H3>About the Challenge</H3><P>Here's how it works: Each month we present a new programming challenge. First, write some code that solves the challenge. Second, optimize your code (a lot). Then, submit your solution to MacTech Magazine. We choose a winner based on code correctness, speed, size, and elegance (in that order of importance)as well as the submission date. In the event of multiple equally desirable solutions, we'll choose one winner (with honorable mention, but no prize, given to the runner up). The prize for each month's best solution is a $100 credit for <A HREF="http://www.devdepot.com/">DeveloperDepot</A>, split between the winner and the best-placing entry from someone who hasn't won recently. You can share in the prize even if you don't win, so try your hand at the Challenge.</P><H3>Current Challenge</H3><UL> <LI>The current Challenge is over. </LI></UL><HR WIDTH="66%"><H4>Previous Challenges:</H4><UL> <LI><A HREF="2002_10_Challenge.html">Area</A> (October 2002)</LI> <LI><A HREF="2002_09_Challenge.html">PhotoMosaic</A> (September 2002)</LI> <LI><A HREF="2002_08_Challenge.html">EndGame</A> (August 2002)</LI> <LI><A HREF="2002_07_Challenge.html">One Time Pad</A> (July 2002)</LI> <LI><A HREF="2002_06_Challenge.html">Matchsticks</A> (June 2002)</LI> <LI><A HREF="2002_05_Challenge.html">Jigsaw Puzzles</A> (May 2002)</LI> <LI><A HREF="2002_04_Challenge.html">Disk Defragmenter</A> (April 2002)</LI> <LI><A HREF="2002_03_Challenge.html">Megaminx</A> (March 2002)</LI> <LI><A HREF="2002_02_Challenge.html">S*xChart</A> (February 2002)</LI> <LI><A HREF="2002_01_Challenge.html">TriMinesweeper</A> (January 2002)</LI></UL><UL> <LI><A HREF="2001_12_Challenge.html">Parent-Teacher Conferences</A> (December 2001)</LI> <LI><A HREF="2001_11_Challenge.html">Seega</A> (November 2001)</LI> <LI><A HREF="2001_10_Challenge.html">Programmers Assistant</A> (October 2001)</LI> <LI><A HREF="2001_09_Challenge.html">Nassi-Schneiderman</A> (September 2001)</LI> <LI><A HREF="2001_08_Challenge.html">Caribbean Cruising</A> (August 2001)</LI> <LI><A HREF="2001_07_Challenge.html">Down-N-Out</A> (July 2001)</LI> <LI><A HREF="2001_06_Challenge.html">Dots</A> (June 2001)</LI> <LI><A HREF="2001_05_Challenge.html">Basic Klondike</A> (May 2001)</LI> <LI><A HREF="2001_04_Challenge.html">Crossword II</A> (April 2001)</LI> <LI><A HREF="2001_03_Challenge.html">DragSort</A> (March 2001)</LI> <LI><A HREF="2001_02_Challenge.html">Trilite</A> (February 2001)</LI> <LI><A HREF="2001_01_Challenge.html">Tetris</A> (January 2001)</LI></UL><UL> <LI><A HREF="2000_12_Challenge.html">Crutches</A> (December 2000)</LI> <LI><A HREF="2000_11_Challenge.html">FreeCell</A> (November 2000)</LI> <LI><A HREF="2000_10_Challenge.html">What Bills did they Pay?</A> (October 2000)</LI> <LI><A HREF="2000_09_Challenge.html">Busy Beavers</A> (September 2000)</LI> <LI><A HREF="2000_08_Challenge.html">Longest Word Sort</A> (August 2000)</LI> <LI><A HREF="2000_07_Challenge.html">RAID 5+</A> (July 2000)</LI> <LI><A HREF="2000_06_Challenge.html">Rub*k Rotation</A> (June 2000)</LI> <LI><A HREF="2000_05_Challenge.html">BigNum Math</A> (May 2000)</LI> <LI><A HREF="2000_04_Challenge.html">Text Compression</A> (April 2000)</LI> <LI><A HREF="2000_03_Challenge.html">Sum of the Powers</A> (March 2000)</LI> <LI><A HREF="2000_02_Challenge.html">Latin Squares</A> (February 2000)</LI> <LI><A HREF="2000_01_Challenge.html">Peg Triangles</A> (January 2000)</LI></UL><UL> <LI><A HREF="9912Challenge.html">Costas Arrays</A> (December 1999)</LI> <LI><A HREF="9911Challenge.html">Putting Green</A> (November 1999)</LI> <LI><A HREF="9910Challenge.html">SuperDuperGhost</A> (October 1999)</LI> <LI><A HREF="9909Challenge.html">Playfair Decipher</A> (September 1999)</LI> <LI><A HREF="9908Challenge.html">3D FlyBy</A> (August 1999)</LI> <LI><A HREF="9907Challenge.html">C to HTML</A> (July 1999)</LI> <LI><A HREF="9906Challenge.html">Tetraminx</A> (June 1999)</LI> <LI><A HREF="9905Challenge.html">Piper</A> (May 1999)</LI> <LI><A HREF="9904Challenge.html">Shortest Network</A> (April 1999)</LI> <LI><A HREF="9903Challenge.html">Terrain Traversal</A> (March 1999)</LI> <LI><A HREF="9902Challenge.html">Chinese Checkers</A> (February 1999)</LI> <LI><A HREF="9901Challenge.html">Sphere Packing</A> (January 1999)</LI></UL><UL> <LI><A HREF="9812Challenge.html">Word Neighbors</A> (December 1998)</LI> <LI><A HREF="9811Challenge.html">Rendezvous and Docking</A> (November 1998)</LI> <LI><A HREF="9810Challenge.html">Hearts</A> (October 1998)</LI> <LI><A HREF="9809Challenge.html">Big Baby</A> (September 1998)</LI> <LI><A HREF="9808Challenge.html">Block Buster</A> (August 1998)</LI> <LI><A HREF="9807Challenge.html">Elevator Control</A> (July 1998)</LI> <LI><A HREF="9806Challenge.html">Blackjack</A> (June 1998)</LI> <LI><A HREF="9805Challenge.html">EggLob</A> (May 1998)</LI> <LI><A HREF="9804Challenge.html">Mancala</A> (April 1998)</LI> <LI><A HREF="9803Challenge.html">Help Peter Get Home</A> (March 1998)</LI> <LI><A HREF="9802Challenge.html">Image Decoder</A> (February 1998)</LI> <LI><A HREF="9801Challenge.html">Cell Selection</A> (January 1998)</LI></UL><UL> <LI><A HREF="9712Challenge.html">Clueless Crosswords</A> (December 1997) </LI> <LI><A HREF="9711Challenge.html">Pente</A> (November 1997)</LI> <LI><A HREF="9710Challenge.html">Who Owns the Zebra?</A> (October 1997)</LI> <LI><A HREF="9709Challenge.html">Image Locator</A> (September 1997)</LI> <LI><A HREF="9708Challenge.html">Stratego</A> (August 1997)</LI> <LI><A HREF="9707Challenge.html">Disambiguator</A> (July 1997)</LI> <LI><A HREF="9706Challenge.html">Turing Machine</A> (June 1997)</LI> <LI><A HREF="9705Challenge.html">Equation Evaluator</A> (May 1997)</LI> <LI><A HREF="9704Challenge.html">Projection</A> (April 1997)</LI> <LI><A HREF="9703Challenge.html">HEX</A> (March 1997)</LI> <LI><A HREF="9702Challenge.html">Othello</A> (February 1997)</LI> <LI><A HREF="9701Challenge.html">BeSORT</A> (January 1997)</LI></UL><UL> <LI><A HREF="9612Challenge.html">Tangrams</A> (December 1996)</LI> <LI><A HREF="9611Challenge.html">Router Rules</A> (November 1996)</LI> <LI><A HREF="9610Challenge.html">DNA Match</A> (October 1996)</LI> <LI><A HREF="9609Challenge.html">Bytecode Interpreter</A> (September 1996)</LI> <LI><A HREF="9608Challenge.html">A-Maze-ing</A> (August 1996)</LI> <LI><A HREF="9607Challenge.html">Connect IV</A> (July 1996)</LI> <LI><A HREF="9606Challenge.html">Postman's Sort</A> (June 1996)</LI> <LI><A HREF="9605Challenge.html">Edge Detector</A> (May 1996)</LI> <LI><A HREF="9604Challenge.html">Mutant Life</A> (Apr 1996)</LI> <LI><A HREF="9603Challenge.html">Words the Reverse</A> (Mar 1996)</LI> <LI><A HREF="9602Challenge.html">Intersecting Rectangles</A> (Feb 1996)</LI> <LI><A HREF="9601Challenge.html">Sliding Tiles</A> (Jan 1996)</LI></UL><UL> <LI><A HREF="9512Challenge.html">Find Again and Again</A> (Dec 1995)</LI> <LI><A HREF="9511Challenge.html">Enclosing Bounds</A> (Nov 1995)</LI></UL><HR WIDTH="66%"><P>The Challenge is distributed to participant through the mailing list and the MacTech web site. This way, contestants all over the world are assured that they will receive the Programmer's Challenge in a timely manner.</P><H3>Rules</H3><P>Unless stated otherwise in the problem statement, the following rules apply: All solutions must be in ANSI compatible C. Use only pure C code. We disqualify entries with any assembly in them (except for challenges specifically stating otherwise). You may call any Macintosh Toolbox routine (e.g., it doesn't matter if you use NewPtr instead of malloc). We test entries with compiler options set to disable FPU use (for 680x0 code) and to enable all available speed optimizations. The compiler to be used and the target instruction set (680x0 or PowerPC) will be stated in the problem. Limit your code to 60 characters per line; this helps with e-mail gateways and page layout.</P><P>We publish the solution and winners for each month's Programmer's Challenge two months later. All submissions must be received by the 1st day of the month printed on the front cover of this issue.</P><P>Mark solutions "Attn: Programmer's Challenge Solution" and send it to<A HREF="mailto:progchallenge@mactech.com">progchallenge@mactech.com</A>. Include the solution, all related files, and your contact info.</P><P>MacTech Magazine reserves the right to publish any solution entered in the Programmer's Challenge. Authors grant MacTech Magazine the exclusive right to publish entries without limitation upon submission of each entry. Authors retain copyrights for the code.</P><H3>Mailing List</H3><P>Though it's not required, if you plan to enter the Challenge, you should subscribe to the Programmer's Challenge Mailing Lists. Everyone should subscribe to the announcement list, Challenge-A. The latest Programmer's Challenge, and updates to the Challenge are posted to this list.</P><P>People who want to discuss the latest Challenge can join the discussion list, Challenge-D.</P><P>You can get a head start on the Challenge by reading the Programmer's Challenge mailing list. It will be posted to the list on or before the 12th of the preceding month. To join, send an email to <A HREF="mailto:listserv@listmail.xplain.com">listserv@listmail.xplain.com</A>with the subject "subscribe challenge-a" for announcments or "subscribe challenge-D" for discussion.</P><H3>FTP Site</H3><P>An ftp area has been set up for you so that you can download test data, share solutions, and exchange code. To upload or download from this archive, just anonymous ftp to <A HREF="ftp://ftp.mactech.com/challenge/">ftp.mactech.com</A> in the directory /challenge/.</P><!-- BEGIN MT_FOOTER INCLUDE -->
<BR><P>All contents are Copyright 1984-2008 by <a href="http://www.xplain.com">Xplain Corporation</a>. All rights reserved.</P><P></P>MacTech is a registered trademark of <a href="http://www.xplain.com">Xplain Corporation</a>. <a href="http://www.xplain.com">Xplain</a>, <a href="http://www.video-depot.com">Video Depot</a>, <a href="http://www.movie-depot.com">Movie Depot</a>, <a href="http://www.palmosdepot.com">Palm OS Depot</a>, <a href="http://www.explainit.com">Explain It</a>, <a href="http://www.mactech.com/news/?p=1000036">MacDev, MacDev-1</a>, <a href="http://www.thinkreference.com">THINK Reference</a>, <a href="http://www.netprofessional.com">NetProfessional</a>, <a href="http://www.netprofessional.com">NetProLive</a>, <a href="http://www.mactech.com/articles/mactech/ Vol.13/13.06/BuildingBeans">JavaTech</a>, <a href="http://www.mactech.com/articles/mactech/ Vol.16/16.01/IntrotoWebObjects">WebTech</a>, BeTech,LinuxTech, <a href="http://www.appleexpo.com">Apple Expo</a>, <a href="http://www.mactechcentral.com">MacTech Central</a>and the <a href="http://www.mactech.com">MacTutorMan</a> are trademarks or servicemarks of <a href="http://www.xplain.com">Xplain Corporation</a>. Sprocket is a registered trademark ofeSprocket Corporation. Other trademarks and copyrights appearing in thisprinting or software remain the property of their respective holders.</P></font><BR></FONT>
</P>
</CENTER>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");