Giter VIP home page Giter VIP logo

maze's Introduction

Maze

This is a demonstration of maze generation and solution using randomized depth first search. This webapp is made using React.

The web app is hosted at maze.ozansap.com.

Features

  • - Variable width and height of the maze
  • - Complete the algorithm instantly
  • - Progress the algorithm one step at a time
  • - Play/pause the algorithm as an animation
  • - Variable animation speed
  • - Works on mobile

How does it work

Generation

  1. A grid is created with each cell having 4 walls around it
  2. Randomized depth first search starts from top left cell
  3. Visited cells are connected and added to a stack
  4. When the head has nowhere it can move to, it backtracks by popping the stack until a legal move is found
  5. Steps 3 and 4 repeat until the visited cell count reaches total cell count

Solution

  1. Randomized depth first search starts from the first selected cell. The head can only move to connected cells
  2. Visited cells are added to a stack
  3. When the head has nowhere it can move to, it backtracks by popping the stack until a legal move is found
  4. Steps 3 and 4 repeat until the head reaches second selected cell

Planned Features

  • - Adding more algorithms and comparing them
  • - Allowing the user to solve the maze on their own

Significance

This is my second webapp. I used this project to learn React and get into component based web development. React development process is a lot user friendlier and intuitive compared to vanilla web development. Components and Props are similar to classes and Object Oriented Programming and thus more coherent.

I also wanted this website to properly work on mobile. I had to learn responsive design techniques and how to properly make use of CSS. However, it was harder than I expected to convert my existing design to work responsively. I had to redesign the website a second time after learning responsive design techniques. I plan on making my next projects mobile first. Mobile first development will make it easier to create dynamic webpages.

Technologies Used

  • React to have a more streamlined development experience
  • create-react-app to generate and build the webpage
  • sass to have cleaner CSS files

maze's People

Contributors

ozansap 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.