Recursive Maze Solver

Login or Sign Up to Vote

Language Used / Topic: Python | Post By: JonPizza | Votes: 3 | Comments: 2 | Views: 769

An python algorithm that solves mazes with a recursive function!

Share on: Twitter | Facebook | LinkedIn | Reddit

Recursive Maze Solver

maze solving algorithm gif

recursive-maze-solver chat

This is a recursive maze solver that was made (ironically) at the recurse center!

How it works

The solver works by reading in a ".png" file which contains only black or white pixels using Pillow: a Python Image Library. After reading it in, I first print out the image using ansi escape codes (thanks to Doron Rasis.)

The function then calls itself (like a recursive function should do...) and moves down, then moves right, then left, then up, determines which move works best and continues on. After each decision, the image will get printed out again, but with the path it has traveled in red.

By JonPizza

Star it on GitHub

By JonPizza - Rep: 819

JonPizza avatar

I am THE JonPizza. Not to flex or anything but I am kinda EPIC. (just a btw)

Donate Ravencoin: RUsyTNkpHdcSeGFEtLsDoMtHQTVvuQcBbG

Contribute to Jon's Network

Share news and tutorials with your fellow developers!

Comments (2):





You Must Login or Signup to Reply

Share on: Twitter | Facebook | LinkedIn | Reddit

Recent Posts:

How to use @property in Python! (Correctly)

How javascript was invented

EPIC Flappy Bird in Python!!

Jon's Network

Find and Share Computer Programming Articles & Tutorials • • TwitterYouTubeWebRing: