O'Reilly logo

Learning Processing by Daniel Shiffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Loops

 

“Repetition is the reality and the seriousness of life.”

 
 --Soren Kierkegaard
 

“What’s the key to comedy? Repetition. What’s the key to comedy? Repetition.”

 
 --Anonymous

In this chapter:

  • The concept of iteration.

  • Two types of loops: “while,” and “for.” When do we use them?

  • Iteration in the context of computer graphics.

What is iteration? I mean, what is iteration? Seriously, what is iteration?

Iteration is the generative process of repeating a set of rules or steps over and over again. It is a fundamental concept in computer programming and we will soon come to discover that it makes our lives as coders quite delightful. Let’s begin.

For the moment, think about legs. Lots and lots of legs on our little Zoog. If we had only read Chapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required