Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let adjacentStates = List.map (fun x ->
- let containsX list = List.exists (fun (b,g,f) -> b = x) list
- if (not (List.exists (fun elem -> elem = x) CS)) && (not (containsX removedCurrent))
- then
- let newGS = GS + 1
- let newFS = newGS + totalManhattanDistance x goal
- Some(x, newGS, newFS)
- else None) adjacentBoards
- let newCS = currentBoard::CS
- let newOS = List.sortBy (fun (b,g,f) -> f) (List.append removedCurrent adjacentStates) //problem here is it affects the type here and i get an error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement