Finite loops are a bit hard to flowchart-out, but here&#39;s some c code:<div><br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
void DrillHoles(startx, starty){<br><span class="Apple-tab-span" style="white-space:pre">        <br></span><span class="Apple-tab-span" style="white-space:pre">        </span>int xoffset = startx;<br><span class="Apple-tab-span" style="white-space:pre">        </span>int yoffset = starty;<br>
<span class="Apple-tab-span" style="white-space:pre">        <br></span><span class="Apple-tab-span" style="white-space:pre">        </span>for (a = 0; a &lt; 2; a++)<br><span class="Apple-tab-span" style="white-space:pre">        </span>{<br>
<span class="Apple-tab-span" style="white-space:pre">                </span>if(a != 0)<br><span class="Apple-tab-span" style="white-space:pre">                        </span>yoffset += 200;<br><span class="Apple-tab-span" style="white-space:pre">                </span>for (b = 0; b &lt; 3; b++)<br>
<span class="Apple-tab-span" style="white-space:pre">                </span>{<br><span class="Apple-tab-span" style="white-space:pre">                        </span>if(b != 0)<br><span class="Apple-tab-span" style="white-space:pre">                                </span>xoffset -= 100;<br>
<span class="Apple-tab-span" style="white-space:pre">                        </span>for (c = 0; c &lt; 3; c++)<br><span class="Apple-tab-span" style="white-space:pre">                        </span>{<br><span class="Apple-tab-span" style="white-space:pre">                                </span>if(c != 0)<br>
<span class="Apple-tab-span" style="white-space:pre">                                        </span>yoffset += 5;<br><span class="Apple-tab-span" style="white-space:pre">                                </span>for (d = 0; d &lt; 6; d++)<br><span class="Apple-tab-span" style="white-space:pre">                                </span>{<br>
<span class="Apple-tab-span" style="white-space:pre">                                        </span>if(d != 0)<br><span class="Apple-tab-span" style="white-space:pre">                                                </span>xoffset -= 5;<br><span class="Apple-tab-span" style="white-space:pre">                                        </span>HoleDriller_DrillHole(xoffset, yoffset);<br>
<span class="Apple-tab-span" style="white-space:pre">                                </span>}<br><span class="Apple-tab-span" style="white-space:pre">                        </span>}<br><span class="Apple-tab-span" style="white-space:pre">                </span>}<br><span class="Apple-tab-span" style="white-space:pre">        </span>}<br>
}</blockquote><div><br></div><div>If you want to see what that would look like, go to <a href="http://raphaeljs.com/playground.html">http://raphaeljs.com/playground.html</a> and paste this in the box:</div><div><br></div>
<div><div>var xoffset = 900;</div><div>var yoffset = 200;</div><div><br></div><div>for (a = 0; a &lt; 2; a++)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if(a != 0)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>yoffset += 200;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>for (b = 0; b &lt; 3; b++)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if(b != 0)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>xoffset -= 100;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>for (c = 0; c &lt; 3; c++)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>if(c != 0)</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>yoffset += 5;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>for (d = 0; d &lt; 6; d++)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>if(d != 0)</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>xoffset -= 5;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>console.log(&quot;crcl&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>paper.circle(xoffset/1.5, yoffset/1.5, 1)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div>}</div></div><div><br></div><div><br></div><div>--</div><div><br></div><div>Simon</div><div><br></div><div><br></div><div>On Tue, May 17, 2011 at 8:37 AM, Marshland Engineering <span dir="ltr">&lt;<a href="mailto:marshland@marshland.co.nz">marshland@marshland.co.nz</a>&gt;</span> wrote:</div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">





<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Hi all</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">I&#39;m a bit stumped with this one. I can&#39;t seem to 
work out the algorithm I need.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">I need to draw a picture of a bit of 
computer code.  </font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">The verbal description is </font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">1 Drill a hole</font></div>
<div><font size="2" face="Arial">2 Repeat step1  5 times, each time adding 
5 mm going the left </font></div>
<div><font size="2" face="Arial">3 Repeat 1 and 2   2 times, each time add 
5 mm going up.</font></div>
<div><font size="2" face="Arial">        Now you 
should have 18 holes. </font></div>
<div><font size="2" face="Arial">4 Repeat 1 to 3  2 times, each time adding 100 
mm to the left </font></div>
<div><font size="2" face="Arial">5 Repeat </font> <font size="2" face="Arial">1 to 
4  1 times, each time adding 200 mm to the top. </font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">If I have my sums correct, that is 6 sets of 
18 holes. </font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Any suggestions ?</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Thanking you<br>Wallace Weideman<br>Marshland 
Engineering<br>704 Marshland Road<br>Christchurch<br>New Zealand</font></div>
<div> </div>
<div><font size="2" face="Arial">Ph 03 3237449 Fax 03 3235449<br><a href="http://www.marshland.co.nz/" target="_blank">http://www.marshland.co.nz/</a></font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">  </font></div>
<div><font size="2" face="Arial"></font> </div></div>
<br>_______________________________________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
<a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
Web site: <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a><br>
Meeting Time and Location uncertain while Science Alive is out of action.<br>
<br>
When replying, please edit your Subject line to reflect new content.<br></blockquote></div><br></div>