Mazes in Python: Build and Visualize (Recap)
So far, you’ve successfully built your maze using an object-oriented approach, and you’ve visualized it using scalable vector graphics (SVG). You’ve written a lot of code and should feel a sense of accomplishment!
In the first half of the course, you’ve learned how to:
- Use an object-oriented approach to represent the maze in memory
- Visualize the maze and its solution using scalable vector graphics (SVG)
In the second half of the course, you’ll define a specialized binary file format to store the maze on disk, transform the maze into a traversable weighted graph, and use graph search algorithms in the NetworkX library to find the solution.
If you’d like to dive deeper into the features that you’re using in this course series, then check out these video courses:
- Python Assignment Expressions and Using the Walrus Operator
- Binary, Bytes, and Bitwise Operators in Python
- OOP Method Types in Python:
@classmethod
vs@staticmethod
vs Instance Methods - Using Data Classes in Python
- Writing Clean, Pythonic Code With
namedtuple
- Python Type Checking
You might also enjoy reading about the following topics:
00:00 Summary. Well done. You’ve completed the first part of this two-part course. You’ve started the maze solver project, first by looking at what’s needed for a maze solver.
00:13 You’ve then looked at the first two important elements of the project: firstly, representing the maze using objects, and then how to visualize the maze.
00:22 You’ve created the foundations for the project and built out two of the major elements that are needed. You’ve written a significant amount of code and should feel a sense of accomplishment if you’ve got this far. In this part of the course, you’ve learned how to approach a problem by defining appropriate constraints, use an object-oriented approach to represent the maze in memory, visualize each block of the maze using scalable vector graphics, and visualize the entire maze and its solution.
00:54 In the second part of the course, you’ll complete the project by creating a binary storage format for mazes and look at solving them using NetworkX.
01:05 We hope you found this first installment of the course useful, and we’ll see you again soon at realpython.com for the second part.
Darren Jones RP Team on July 11, 2023
Thank you! Part 2 is released today, so hopefully you’ll find it as useful!
tschwa24 on July 11, 2023
Great! Looking forward to it!
Become a Member to join the conversation.
tschwa24 on July 8, 2023
This was a very nice intro to SVG and a good refresher/practice session for OO. When can we expect to see Part 2?