1. Running Totals

Accumulators

An algorithm is a step-by-step recipe. The simplest one keeps a running total: start at a number, add to it each time around the loop, and use it as you go.

Lesson 1: a rhythm built from the gaps between kicks.

gaps = [2, 3, 2]
b = 1
kick(b)
for g in gaps:
    b += g
    kick(b)
The beat it plays
kick
1234
5678
…and in RockBlocks
Bass Drum
🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:Gaps between kicks: gaps = [2, 3, 2]. Start at b = 1, play kick(b), then for each gap add it to b and play kick(b).

Goal
kick
1234
5678