01204212/homework/maze

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
This is part of 01204212

In this homework you will write a maze solver. The following is a sample maze. You start at O and your exit is at X.

11 17
#################
#O........#.....#
#########.#######
#...#...#.#.....#
#.#.#.#.#.##.##.#
#.#...#......#..#
#.#############.#
#..#....#.......#
#.##.#.##.#.#####
#....#....#....X#
#################

The output should be:

#################
#O>>>>>>>v#.....#
#########v#######
#...#...#v#.>>>v#
#.#.#.#.#v##^##v#
#.#...#..>>>^#.v#
#.#############v#
#..#....#..v<<<<#
#.##.#.##.#v#####
#....#....#>>>>X#
#################