Advertisement
Guest User

Sboub2

a guest
Sep 30th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #use "graphes.ml"
  2.  
  3. (* Alias pour les fonctions provenant de graphes.ml *)
  4. let estBut x = estBut1 x ;;
  5. (* let estBut x = estBut1bis x ;; *)
  6. (* let estBut x = estBut1ter x ;; *)
  7. let etatsSuivants x = etatsSuivants1 x ;;
  8.  
  9. let rec print_list_string = function
  10. | [] -> print_string ".\n";
  11. | t :: q -> print_string t; print_string " "; print_list_string q;;
  12.  
  13. let rec profondeurBeta queue = match queue with
  14. | [] -> failwith "Aucun but trouvé"
  15. | t :: q -> if (estBut t)
  16. then t
  17. else profondeurBeta ((etatsSuivants t) @ q) ;;
  18.  
  19.  
  20. profondeurBeta ["A"];;
  21.  
  22.  
  23. print_list_string [ "Aa" ; "BBb" ; "C" ; "D" ];;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement