I wrote a code snippet to draw a bit of 'abstract art':
yertle.penDown();yertle.forward(10);yertle.right(Math.PI/2);yertle.forward(10);yertle.right(Math.PI/2);yertle.forward(10);yertle.right(Math.PI/2);yertle.forward(10);yertle.right(Math.PI/2);yertle.left(Math.PI/2);yertle.forward(20);yertle.right(Math.PI/2);yertle.forward(20);yertle.right(Math.PI/2);yertle.forward(20);yertle.right(Math.PI/2);yertle.forward(20);yertle.right(Math.PI/2);yertle.left(Math.PI/2);yertle.forward(30);yertle.right(Math.PI/2);yertle.forward(30);yertle.right(Math.PI/2);yertle.forward(30);yertle.right(Math.PI/2);yertle.forward(30);yertle.right(Math.PI/2);yertle.left(Math.PI/2);yertle.forward(40);yertle.right(Math.PI/2);yertle.forward(40);yertle.right(Math.PI/2);yertle.forward(40);yertle.right(Math.PI/2);yertle.forward(40);yertle.right(Math.PI/2);yertle.left(Math.PI/2);yertle.penUp();
My instructor suggested I could get the same result from amuch shorter program, but I don't see how.
What should I write instead?
(Keep it concise, and don't include anything outside the scope ofthe question)