Advertisement
Guest User

Untitled

a guest
May 13th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.85 KB | None | 0 0
  1.             let adjacentStates = List.map (fun x ->
  2.                                             let containsX list = List.exists (fun (b,g,f) -> b = x) list
  3.                                             if (not (List.exists (fun elem -> elem = x) CS)) && (not (containsX removedCurrent))
  4.                                                 then
  5.                                                     let newGS = GS + 1
  6.                                                     let newFS = newGS + totalManhattanDistance x goal
  7.                                                     Some(x, newGS, newFS)
  8.                                                 else None) adjacentBoards
  9.             let newCS = currentBoard::CS
  10.             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