~shreyasminocha/maze-solver

880b787166d672699bc461fb9654f4af7fc703f1 — Shreyas Minocha 9 months ago e085720 main
Add usage instructions
1 files changed, 42 insertions(+), 0 deletions(-)

M README.md
M README.md => README.md +42 -0
@@ 1,1 1,43 @@
Need a shitty maze solver for a CTF? Well here you go.

## Usage

```py
from maze import solve_maze

original = """
    #############################
    #@..#.........#...#.........#
    ###.#####.#.#.#.#.###.#####.#
    #.#.....#.#.#...#.#...#...#.#
    #.#####.#.#.#####.#.#####.#.#
    #.....#.#.#...#...#.....#.#.#
    #.#####.#####.#.###.###.#.#.#
    #.......#.....#...#.#...#...#
    #.#######.#######.#.#.###.###
    #.#.....#.#.....#.#.#...#...#
    #.###.#.#.#.###.#.#.###.###.#
    #.....#.#.#.#...#.#...#...#.#
    #######.#.###.###.#######.###
    #.#.....#...#...#.......#...#
    #.#.#####.#.###.#######.#.#.#
    #...#.....#...#...#.....#.#.#
    #.###########.###.#.#######.#
    #.......#.....#...#.#.......#
    #######.#.#####.#.#.###.###.#
    #...#...#...#...#.#.....#.#.#
    #.#.#.###.#.#.###########.#.#
    #.#...#...#.#.........#.....#
    #.#####.###.#.###.#.###.#####
    #...#.#.#.#.#.#...#.#...#...#
    ###.#.#.#.#.#.#.#.###.###.#.#
    #...#.....#.#.#.#.#...#...#.#
    #.#########.#.#.###.###.###.#
    #...........#.#.........#...#
    #########################*###
"""
maze = [row.strip() for row in original.strip().split("\n")]

solution = solve_maze(maze, "@", "*", "#")
print("".join(map(lambda d: d.value, solution)))  # eesseeeesssswww...
```