Build a maze with Python
Some months ago I failed an interview question from Google that required me to write a program to navigate a maze in the least amount of steps, it is by no means a small task since a very popular book on AI ( AI a modern approach ) devotes a lot of pages to this subject, but what I got stumped with and found more interesting was the code needed to make a maze ( which wasn’t provided ) and since I like GUIs and games I thought it would be a cool little thing to learn about, so without much ado, here we go, we’ll be making a basic maze game in python !
Here's the code snippets in Repo form if you prefer...https://github.com/KenoLeon/Medium-Mazes
Step 1. The first thing we need is a canvas/data structure where we can draw structured data, a numpy backed grid fits the bill nicely, I am using PySimpleGui + numpy but you can use another GUI library if you wish, I will also be using and modifying some grid functions from a previous post on Grids ( but you can skip reading it if the code makes sense to you ) :