Test 3 Preparation
import Data.List (transpose) type Maze = [String] sample1 :: Maze sample1 = [“*********”, “* * * *”, “* * * * *”, “* * * * *”, “* * *”, […]
import Data.List (transpose) type Maze = [String] sample1 :: Maze sample1 = [“*********”, “* * * *”, “* * * * *”, “* * * * *”, “* * *”, […]
solveMaze x = let all = concat[[(row, colum, char)|(colum, char)<-zip [0..]line] |(row, line )<-zip [0..] x ] (start_r, start_c, _)=head (filter (test ‘s’) all) (end_r, end_c, _)=head (filter (test ‘e’) […]
–Question: –Modify the BFS algorithm to return a list of all reachable points from the start position (1, 1) in the following maze: — Write a function reachablePoints :: Maze […]