~shreyasminocha/maze-solver

shitty maze solver for silly ctf challenges
880b7871 — Shreyas Minocha 1 year, 1 month ago
Add usage instructions
e085720d — Shreyas Minocha 1 year, 1 month ago
Add tests
e55fb595 — Shreyas Minocha 1 year, 1 month ago
Add license

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~shreyasminocha/maze-solver
read/write
git@git.sr.ht:~shreyasminocha/maze-solver

You can also use your local clone with git send-email.

Need a shitty maze solver for a CTF? Well here you go.

#Usage

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