Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About

I was learning about the Rat in Maze problem on competitive coding platforms that is solved with recursion and backtracking.

Then I thought it would be fun if we could visualize it happening in front of our eyes.

That's why I wrote this program.

What it Does

This program will help visualize the Rat In Maze problem just through command prompt and by live changes in matrix.

Visualization

  • This is the maze that the rat will traverse in this input

RatInMaze

  • Here is the video of the Rat in action!
RatInMaze.mp4

main.cpp

Contains the driver code and the input.

pathFinder.h

Contains the functions :-

  • findPath() - which have main code to find path with recursion and backtracking

  • isSafe() - to check for 3 conditions to find out if that way to go is safe or not.

Do check code for more insight...

Quickstart

Compile it

	gcc main.cpp -o main

Run it

	./main

Note

  • You can use this program to study about how backtracking works and how it is visually seen!

  • You can use this code for your learning pupose or to teach someone about this problem.

Enjoy! 😋

~ @aliqyan21

About

Rat in maze problem of Recursion and Backtracking

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages