let main () =
       let cave_x = ref 75 in
       let cave_y = ref 30 in
         Arg.parse
           [("-x"Arg.Set_int cave_x, "width of cave");
            ("-y"Arg.Set_int cave_y, "height of cave")]
           (fun _ -> ())
           "Usage: pathvisual [options]";
         let window = Curses.initscr () in
         let window_top = Curses.newwin 7 75 0 0 in
         let window_cave = Curses.newwin (!cave_y+3) (!cave_x+3) 7 0 in
           Random.self_init ();
           at_exit Curses.endwin;
           ignore (Curses.noecho ());
           ignore (Curses.keypad window true);
           let cave = Cave.makecave2 !cave_y !cave_x in
           let xy = Cave.getvalidxy cave in
           let s = {window       = window_top;
                    window_cave  = window_cave;
                    cave         = cave;
                    cursor       = xy;
                    src          = xy;
                    dst          = xy;
                    path         = [];
                    alg          = 0;
                    auto_path    = true;
                    dist_alg     = 0;
                    path_opt_alg = 0;
                    map_type     = 0;
                    cave_x       = !cave_x;
                    cave_y       = !cave_y} in
             ignore (Curses.refresh ());
             loop s