Microsoft MakeCode

Mazes extension

Now that production and beta have been bumped to newer versions, as promised in a previous thread, I am releasing my mazes extension. You can use this extension to generate random mazes with a variety of algorithms. The algorithms come from Jamis Buck’s book.[1]

Extension URL (for importing into your own projects):

API documentation is available here:

See it in action below. Press A to generate a new maze. In the JavaScript version, you also can press B to switch between the tile map and an image of the whole maze with its solution.

I made a simple game in Blocks that uses the playgrounds as a premise. At the start of the game, the duck is trapped in a cell. Press A to build a maze and to start the clock. You have 60 seconds to get the duck to its home in the swamp. Snacks appear when you have 30 seconds left to help you. If you’re running low on time and want to cheat, just press A to generate a new map. :slight_smile:

The sample game runs fine on hardware as-is. If you move to a larger tile map, you may need to switch the game to “hardware mode,” which disables the breadcrumb sprites. (The breadcrumbs still appear; you just don’t get any points for them.) Hardware can handle tile maps up to a grid size of 15x15 when the pathway is two tiles wide. If you switch to one-tile pathways, the path gets really tight to navigate, but you should be able to use a larger grid.

Happy Monday! Have fun!

[1] Buck, J. (2015). Mazes for programmers: Code your own twisty little passages. Dallas, Texas: Pragmatic Programmers

See all of my MakeCode Arcade games and extensions here!

I highly recommend Jamis Buck’s book. Advanced students will be able to explore these algorithms to create their own projects. The book is light on the math and analysis of the algorithms (by intention), but the book also shares plenty of additional resources for students who want to dive more deeply into the algorithms. Definitely check it out!

Also, see the original thread (linked at the bottom of the main post above) to see some work that @jwunderl shared from his days as a lead TA at UW. Thanks again for sharing, Joey!

Sorry about the flurry of activity: Three games and four extensions over the weekend. I’ve had an inspired week. :smile: