Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 1.05 KB

README.md

File metadata and controls

25 lines (16 loc) · 1.05 KB

DFS-with-Pygame

This repo solves the question below creating with Pygame animation. We found all possible ways to ending square and display it on the Pygame UI

Question

You are given an m × n integer array grid where grid [i][j] could be:

  • 1 representing the starting square. There is exactly one starting square.
  • 2 representing the ending square. There is exactly one ending square.
  • 0 representing empty squares we can walk over.
  • -1 representing obstacles that we cannot walk over. Return the number of 4-directional walks from the starting square to the ending square, that walk over every non-obstacle square exactly once.
Ekran.Kaydi.2023-07-04.21.13.53.mov

Usage

Before running the main code, you can give specific 2D matrix.

python main.py

Contributing

Feel free to contribute. I am working on creating a WebAssembly script that will enable displaying output in the browser. In next, I will add other path-finding and search algorithms with animations.