Advertisement
Guest User

Untitled

a guest
May 1st, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. (* type wall = (int * int * int * int) *)
  2.  
  3. (* type case = (int * *)
  4.  
  5. type wall = (int * int * int * int) (* *)
  6.  
  7. type case = (int * wall array)
  8.  
  9. type tlabyrinthe = (int * int * case array array)
  10.  
  11. let create w h c =
  12. print_endline "Created laby";
  13. (w, h, c)
  14.  
  15. let set_heigh new_h (h, _, _) = let h = new_h in ()
  16. let set_width new_w (_, w, _) = let w = new_w in ()
  17. let set_color_from_pos x y new_color (_, _, c) = let (_, k) = c.(x).(y) in c.(x).(y) <- (new_color, k)
  18.  
  19. let get_color_from_pos x y (_, _, c) = let (k, _) = c.(x).(y) in k
  20.  
  21. let set_open_wall x y wall_pos value (_, _, case) =
  22. let (color, wall) = case.(x).(y) in
  23. let matching =
  24. match wall_pos with
  25. 1 -> let (_, b, c, d) = wall in case.(x).(y) <- (color, (value, b, c, d))
  26. | 2 -> let (a, _, c, d) = wall in case.(x).(y) <- (color, (a, value, c, d))
  27. | 3 -> let (a, b, _, d) = wall in case.(x).(y) <- (color, (a, b, value, d))
  28. | 4 -> let (a, b, c, _) = wall in case.(x).(y) <- (color, (a, b, c, value))
  29. in ()
  30.  
  31. let left_wall () = 1
  32.  
  33. let right_wall () = 2
  34.  
  35. let top_wall () = 3
  36.  
  37. let bottom_wall () = 4
  38.  
  39. let print tLabyrinthe =
  40. print_endline "Function aff"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement