FP_BFS
Home Preparation For Test 3 – 2024 The task requires implementing a function makePath that calculates the shortest path in a maze using breadth-first search (BFS) and marks each step […]
All my articles from this category / You can change this description
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 […]