Stage 3 · Kiln Mouth
Loops & range
“Round and round the kiln turns. Where does it stop?”Kiln Archmage
Scrolls on the trail
These are the 4 lore scrolls you'll find in Kiln Mouth, in the order the lesson teaches them. The comment after each print shows what it outputs.
Lore scroll · Loops & range
The Loop Rune
laps = []
for i in range(3):
laps.append(i)
print(laps) # [0, 1, 2]range(3) counts 0, 1, 2. It stops before the number you give it.
Lore scroll · Loops & range
Start, Stop, Step
print(list(range(2, 6))) # [2, 3, 4, 5]
print(list(range(1, 9, 3))) # [1, 4, 7]
print(list(range(3, 0, -1))) # [3, 2, 1]range(start, stop, step) begins at start, adds step, and stops before stop.
Lore scroll · Loops & range
Gathering Embers
total = 0
for n in [3, 4, 5]:
total += n
print(total) # 12Start the total before the loop, then add to it on every pass.
Lore scroll · Loops & range
Loops That Wait
heat = 1
while heat < 20:
heat *= 3
print(heat) # 27while repeats until its condition is False. It checks before every pass.
The stage puzzle: The loop lift
The kiln wall is ten tiles of sheer brick. At its foot, an iron lift runs a for loop and rises one notch for every lap, and a gauge on the wall numbers the notches. Three forge blocks each load a different range into the lift. Stand on the plate to run the loop and watch i count off each lap. You need four notches to jump onto the wall.
for i in ?:
lift.rise() # one notch
A: range(1, 9, 3)
B: range(4)
C: range(10, 13)Show the answer
range(4) runs four laps: 0, 1, 2, 3. The other two have bigger numbers but only three laps each: 1, 4, 7 and 10, 11, 12. Count the laps, not the size of the numbers.
Practice the Kiln Archmage's trial
In the game, the Kiln Archmage duels you in a sealed arena. His question shows across the top of the screen, and you answer by jumping up into the lettered block, A to D, while you dodge his spells. You need 3 right answers to banish him. These are his questions, drawn from all 9 in his bank. The hints work the same as in the game: ask once for his riddle, and ask again for him to rule out a wrong answer.