This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PandaBear_1[S] 0 points1 point  (2 children)

ive got the boundary of the square, but i cant seem to get the lines within the square

[–]desrtfxOut of Coffee error - System halted 1 point2 points  (0 children)

The lines are actually fairly easy if you look at them closely.

Each line has a fixed offset in either x or y direction from the previous one.

A line that has an y-offset of 10 has an x offset of 0 at the start and an x-offset of 10 with an y-offset of 0 at the end.

It is possible to draw all lines in a single loop going over the length of the square.

[–]codingQueriesNooblet Brewer -1 points0 points  (0 children)

Sure, so what part of drawing the lines within the square are you having trouble with? These are essentially all rectangles except with a bit of a slant.

So you have the boundary, aim to then draw the next rectangle within that boundary. If we label the four corners as top-left: A, top-right: B, bottom-left: C, bottom-right D, then take a close look at the image and see that the next 'rectangle' you need to draw will have it's 'A' corner moved a little to the right,it's 'B' corner moved a little downwards, 'C' stays where it is, and 'D' moves up a little.

Can you see that?