02 Loop

1 Four Corners

 举一隅不以三隅反,则不复也。
       --《论语·第七章·述而篇》

子曰:“不愤不启,不悱不发。举一隅不以三隅反,则不复也。”孔子在这一章中提出了教学和学习的关键在于”启发“出“独立”思考的能力,反对“填鸭”式的机械逻辑。要求学习时能够做到举一反三,触类旁通。这才是学习和教学的基本规律。

Watch this corner picture and talk about how it was created by LOOP code?

Read the code below to see if it was the same as what you thought.

function setup() {
  createCanvas(400, 400);
}
function draw() {
  background(220);
  for (let j = 0; j < 400; j++) {
    line(0, j * 10, j * 10, height)
  }
}

Now make your own verion of corners like these:

Or make a symmetrical picutre:

You can add colors. You make other different line picutres. Just use your imagination!