Challenge 7 - More Stars and Squares


The idea of a variable is a powerful one.

Spend some time trying to see what the variable does. Perhaps you can introduce variables of your own to different procedures?

The procedure for a ring of squares might look something like:

TO RINGSQ :N
REPEAT 8 [SQ :N FD :N RT 90 FD :N LT 45]
END


I think this could be more elegant with a procedure that dealt with the relocation of the turtle before drawing the next square (the messy bit inside the REPEAT brackets with FDs and turns)..

Part of the challenge is to produce elegant solutions to any problems asked or any replications that you attempt. Where elegance implies simplicity within the program(s) and procedures devised.

The numbers are related to powers of 2. These whould help with scaling your squares - this is where variables are useful. Your LOGO program may support surds, MSWLogo includes SQRT <number>, for example SQRT 2 - this might be useful!

Alternatively you may like to explore the following procedure:

TO NESTSQ :SIDE
IF :SIDE < 2 [STOP]
REPEAT 4 [ NESTSQ :SIDE/3 FD :SIDE RT 90]
END


Perhaps instead of squares you might like to vary the number of repeats and the angle turned through.