JoC #32: Pretty pictures with while loops

      90% Rule of Project Schedules: “The first 90% of the task takes 90%
      of the time, and the last 10% takes the other 90%.”
            — (source unknown) 

One more time, discussions of loops.

Loops are such an important concept, and there are so many variations, that it is really important to get practice with them and get them properly into your head. To this end, we’re looking one more time at loops here before moving on to some new concepts in the next episode.

Today, we’re using a really important, fundamental loop pattern: A while loop with a simple loop counter. It looks like this:

    int i = 0;
    while (i < NUMBER)
    {
        doSomething();
        i = i + 1;
    }

Watch the video, and try to memorize this pattern. It will come in handy later!

Download video

Concepts discussedloops, while loop

Download (scenario as of beginning of this episode): breakout-v6.zip

JoC #31: More loopiness

      The First Law of Programmer Creativity: “The cost of software maintenance 
      increases with the square of the programmer’s creativity.”
            — (source unknown) 

We continue with our breakout scenario, an also with our investigation of loops. Jumping right ahead, I show you both how to write a nested loop, and why and how never to do it.

Download video

Concepts discussedloops, while loop

Download: breakout-v5.zip

JoC #30: Introduction to loops

      Whatever begins, also ends.
            — Seneca
      (Seneca obviously didn’t know about getting your loop condition wrong …  — mik)

Today, we are introducing a new concept: loops. Or, if you want to know more precisely: the while loop.

But, as always, we’re not doing this by just talking about the theory in a vacuum – we actually need it to progress with one of our projects, the Breakout game that we have seen before.

Loops are a concept fundamental to all programming, so if you are a learner, pay close attention. You will need this again later!

Download video

Concepts discussedloops, while loop