Monday, April 14, 2014

Day 9

Learned about Variables and Functions. Completed all 10 puzzles on Stage 15. This was the last lines of code I wrote today.

var length2;
var counter;

function draw_a_square(length2) {
  for (var count = 0; count < 4; count++) {
    moveForward(length2);
    turnRight(90);
  }
}

function draw_a_triangle(length2) {
  for (var count2 = 0; count2 < 3; count2++) {
    moveForward(length2);
    turnRight(120);
  }
}

No comments:

Post a Comment