IN THE STORY
Christine plans the route through a fictional floor plan. The playable maze adds walls, Tony and an exit; this short activity teaches the movement first.
The idea
State is the information a program remembers at a moment. Here x is a column and y is a row, counted from zero. Moving east adds one to x. Moving south adds one to y. Each loop iteration updates the position. This small example supports only E and S; the complete game handles four directions and checks walls.
Your mission
Complete the south step. Later, run tonys_exit.py from Build Game One to try the full maze.
Replace ____ with the missing expression, then choose Run code. Match the expected output before trying your own changes.
Before you run it
Where will the route EESS end if it starts at column zero, row zero?
A little help?
Hint 1: a nudge
A south step changes the row, not the column.
Hint 2: a closer look
Increase y by one: y + 1.
How the answer works
The position is column 2, row 2. elif means “otherwise, if”. In the full game, reaching the exit before finding Tony does not count as success.
This replaces the code in the editor. Save your version first if you want to keep it.
Make it yours
Add N and W rules to your copy. In the full game, trace each step of EESSEEESS and explain why it succeeds.