Stage 1 · Amber Hollow
Lists & Indexing
“Do you count as the scrolls count, little ember?”Ash Hexer
Scrolls on the trail
These are the 4 lore scrolls you'll find in Amber Hollow, in the order the lesson teaches them. The comment after each print shows what it outputs.
Lore scroll · Lists & Indexing
Counting from Zero
row = ["ash", "clay", "ember"]
print(row[0]) # ash
print(row[2]) # emberA list's first item lives at index 0, so the third item is row[2].
Lore scroll · Lists & Indexing
Counting Backwards
row = ["ash", "clay", "ember"]
print(row[-1]) # ember
print(len(row)) # 3Negative indexes count from the end: row[-1] is always the last item.
Lore scroll · Lists & Indexing
The Slice Spell
row = [10, 20, 30, 40]
print(row[1:3]) # [20, 30]
print("ember"[:3]) # embA slice [a:b] starts at a and stops just before b. Strings slice too.
Lore scroll · Lists & Indexing
Lists Can Change
row = [1, 2, 3]
row.append(4)
row[0] = 9
print(row) # [9, 2, 3, 4]append() adds to the end. Assigning to an index replaces that item.
The stage puzzle: The slice bridge
Near the end of the stage, a pit ten tiles wide is too far to jump. A ruler numbers its cells like a list, from 0 on the near edge to 11 on the far edge. Four slice blocks hang in front of it: 1:10, 1:11, 2:11 and :10. Bumping one lays planks on the cells that slice takes. A bridge holds only if it reaches both edges, so a slice that misses even one pit cell crumbles. (Over the start of the stage, a row of ? blocks under a slate reading row[2] hides a bonus scroll.)
bridge = planks[?]
# the pit is cells 1 to 10Show the answer
planks[1:11] takes cells 1 to 10, because a slice stops just before its second number. planks[1:10] stops at cell 9 and leaves a gap. For the bonus scroll, count from zero: row[2] is the third block.
Practice the Ash Hexer's trial
In the game, the Ash Hexer 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 10 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.