Advertisement
Guest User

Untitled

a guest
May 2nd, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. open Printf
  2.  
  3. let check_args_width_height number =
  4. if int_of_string number < 0 then failwith "Wrong arguments"
  5.  
  6. let () =
  7. Sdl.init [`VIDEO];
  8. Sdlvideo.set_video_mode 200 200 [];
  9. Sdltimer.delay 2000;
  10. Sdl.quit();
  11. print_endline (string_of_int (Array.length Sys.argv));
  12. try
  13. if Array.length Sys.argv != 3 then failwith "Wrong number arguments : ./step1 width height"
  14. with
  15. | Failure ex -> print_endline "Wrong number arguments : ./step1 width height"; exit(1);;
  16. try
  17. Arg.parse [] check_args_width_height "Wrong value : ./step1 width(int) height(int)"
  18. with
  19. | Failure ex -> print_endline "Wrong value : ./step1 width(int) height(int)"; exit(1);;
  20.  
  21. print_endline "[DEBUG] Parsing ok";
  22. print_endline "[DEBUG] Continue ..";
  23. let testMod = Labyrinthe.create 42 43 [| |] in
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement