We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Break Entrance and Exit

Now you should have a full grid drawn on the screen, like this.

Now it's time to start removing ("breaking") some walls so that we have an actual maze. We'll start with the entrance and exit.

Assignment

    • Remove the top wall of the top-left cell by setting has_top_wall = False (the entrance)
    • Remove the bottom wall of the bottom-right cell (the exit)
    • Call self._draw_cell() after each removal to update the display

If you run your code graphically, it won't appear to actually remove any walls. That's because they were already drawn to the canvas, and removing the wall in memory doesn't update the canvas. Let's fix that.