<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>Puzzle: 100 Monkeys (More prizes update)</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Because O'Reilly has given us so many excellent books, I'm going to add another prize category to this month's puzzle.</FONT>
</P>

<P><FONT SIZE=2>First prize:&nbsp; fastest</FONT>
<BR><FONT SIZE=2>Second prize: shortest</FONT>
</P>

<P><FONT SIZE=2>*&nbsp; There will be 2 winners (no single person can get 1st and 2nd)</FONT>
<BR><FONT SIZE=2>** I will not be participating for a prize</FONT>
</P>

<P><FONT SIZE=2>And again, because I forgot to update it in the text below. The prize is the winner's choice of one of the following:</FONT>
</P>

<P><FONT SIZE=2>o&nbsp; Computer Science &amp; Perl </FONT>
<BR><FONT SIZE=2>o&nbsp; Creating Web Applications with Mozilla </FONT>
<BR><FONT SIZE=2>o&nbsp; Designing Embedded Hardware </FONT>
<BR><FONT SIZE=2>o&nbsp; Perl CD Bookshelf, Version 3.0 </FONT>
<BR><FONT SIZE=2>o&nbsp; Perl Graphics Programming </FONT>
<BR><FONT SIZE=2>o&nbsp; Perl in a Nutshell, 2nd Edition </FONT>
<BR><FONT SIZE=2>o&nbsp; Programming Web Services with Perl </FONT>
</P>
<BR>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100 Monkeys </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2003-01-14 </FONT>
<BR><FONT SIZE=2>Note: This puzzle came to me unattributed by way of a </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; co-worker. If anyone chances by the source, please </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let me know so I can give credit. </FONT>
</P>

<P><FONT SIZE=2>There are 100 doors, all closed.&nbsp; In a nearby cage are 100 </FONT>
<BR><FONT SIZE=2>monkeys.&nbsp; The first monkey is let out, and runs along the </FONT>
<BR><FONT SIZE=2>doors opening every one.&nbsp; The second monkey is then let out, </FONT>
<BR><FONT SIZE=2>and runs along the doors closing the 2nd, 4th, 6th,...&nbsp; all </FONT>
<BR><FONT SIZE=2>the even-numbered doors.&nbsp; The third monkey is let out.&nbsp; He </FONT>
<BR><FONT SIZE=2>attends only to the 3rd, 6th, 9th,... doors (every third </FONT>
<BR><FONT SIZE=2>door, in other words), closing any that is open and opening </FONT>
<BR><FONT SIZE=2>any that is closed.&nbsp; The fourth monkey does the same for the </FONT>
<BR><FONT SIZE=2>4th, 8th, 12th, 16th,... doors, opening the closed ones and </FONT>
<BR><FONT SIZE=2>closing the open ones.&nbsp; The fifth monkey does the same to </FONT>
<BR><FONT SIZE=2>the 5th, 10th, 15th,... doors, and so on.&nbsp; After all 100 </FONT>
<BR><FONT SIZE=2>monkeys have done their work in this way, which doors are </FONT>
<BR><FONT SIZE=2>left open? </FONT>
</P>

<P><FONT SIZE=2>Format:&nbsp;&nbsp; m/^\d+(?:\s\d+)*$/ # scalar must match this regex </FONT>
</P>
<BR>

<P><FONT SIZE=2>Goal:</FONT>
<BR><FONT SIZE=2>o&nbsp; fastest script to calculate the answer</FONT>
<BR><FONT SIZE=2>o&nbsp; shortest script to calculate the answer</FONT>
</P>
<BR>

<P><FONT SIZE=2>Prize:&nbsp;&nbsp;&nbsp; Your choice of O'Reilly book </FONT>
</P>

<P><FONT SIZE=2>o&nbsp; Computer Science &amp; Perl </FONT>
<BR><FONT SIZE=2>o&nbsp; Creating Web Applications with Mozilla </FONT>
<BR><FONT SIZE=2>o&nbsp; Designing Embedded Hardware </FONT>
<BR><FONT SIZE=2>o&nbsp; Perl CD Bookshelf, Version 3.0 </FONT>
<BR><FONT SIZE=2>o&nbsp; Perl Graphics Programming </FONT>
<BR><FONT SIZE=2>o&nbsp; Perl in a Nutshell, 2nd Edition </FONT>
<BR><FONT SIZE=2>o&nbsp; Programming Web Services with Perl </FONT>
</P>

<P><FONT SIZE=2>Deadline: Answers must be submitted at least 24 hours </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; before the next kc.pm meeting (February 11th) </FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Garrett Goebel </FONT>
<BR><FONT SIZE=2>IS Development Specialist </FONT>
<BR><FONT SIZE=2>ScriptPro&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Direct: 913.403.5261 </FONT>
<BR><FONT SIZE=2>5828 Reeds Road&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Main: 913.384.1008 </FONT>
<BR><FONT SIZE=2>Mission, KS 66202&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax: 913.384.2180 </FONT>
<BR><FONT SIZE=2>www.scriptpro.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; garrett at scriptpro dot com </FONT>
<BR><FONT SIZE=2>&nbsp; </FONT>
</P>

</BODY>
</HTML>