Git Product home page Git Product logo

ai_maze_visualizer's Introduction

AI_Maze_Visualizer

Intro

This repository serves as a tutorial on how to use my animate_maze() You might need to install ffmpeg or Pillow on your system in order to write to a gif file (tutorials are available online)

Functions available

paint_path(path,maze,value)

This function will paint the maze passed into it (NOTE THIS IS DONE IN PLACE NOT ON A COPY (PASS BY REFERENCE MAZE)) and accepts several things:

  • path: a list of tuples where the tuples are the (x,y) value of the node in any given path
    • Meaning if we wanted to paint a path between (0,0) and (5,0), we would pass [(0,0),(0,1),(0,2),(0,3),(0,4),(0,5)]
    • This would result in a horizontal line being painted on our maze
    • NOTE: this will overwrite walls if you let it
  • maze: a 2d numpy array representing the maze
    • This is the same thing that is returned by Dr. Hahsler's parse_maze() function
  • value: This is the character that you wish to paint on the path
    • '.' is used for the visited data structure
    • 'F' is used for the frontier data structure
    • 'P' is used for the final path of start->goal

animate_maze(mazes, fileName=None,repeat = False,goal_show_frames=5)

This function is for animimating a series of mazes into a gif file and saving it off and accepts several parameters:

  • mazes: a list of numpy arrays showing the painted mazes
  • fileName (optional): filepath to save the gif to (should end in .gif to view properly)
  • repeat: Boolean about whether or not to loop the animation that is returned
  • goal_show_frames (optional): int that describes how many frames to hold the last frame (leaving default is probably fine)

Additional Notes:

There is an example ipynb file included in this repo to show how to write all of the code and get it working together. Please feel free to reach out to my smu email address if you have any questions about using this

Results

Alt Text Alt Text Alt Text Alt Text Alt Text

ai_maze_visualizer's People

Contributors

alexshock66 avatar

Stargazers

Max Link avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.