[chbot] Draw algorithm
Charles Manning
manningc2 at actrix.gen.nz
Wed May 18 01:07:40 BST 2011
On Tuesday 17 May 2011 08:37:04 Marshland Engineering wrote:
> Hi all
>
> I'm a bit stumped with this one. I can't seem to work out the algorithm I
> need.
>
> I need to draw a picture of a bit of computer code.
>
> The verbal description is
>
> 1 Drill a hole
> 2 Repeat step1 5 times, each time adding 5 mm going the left
> 3 Repeat 1 and 2 2 times, each time add 5 mm going up.
> Now you should have 18 holes.
> 4 Repeat 1 to 3 2 times, each time adding 100 mm to the left
> 5 Repeat 1 to 4 1 times, each time adding 200 mm to the top.
>
> If I have my sums correct, that is 6 sets of 18 holes.
>
> Any suggestions ?
I would start by drawing it out on graph paper. From there the computer code
should be obvious.
More information about the Chchrobotics
mailing list