Small fix
This commit is contained in:
parent
6c08637b13
commit
673a95d0cb
11
trees.ml
11
trees.ml
|
@ -112,17 +112,18 @@ let even_more_pretty_printing t r ystep skip =
|
||||||
connect graphdata.(dpth-1);
|
connect graphdata.(dpth-1);
|
||||||
done;
|
done;
|
||||||
|
|
||||||
set_line_width 5 ;
|
set_line_width (max 1 (r/6)) ;
|
||||||
for dpth = 0 to (Array.length graphdata -1) do
|
for dpth = 0 to (Array.length graphdata -1) do
|
||||||
draw_list graphdata.(dpth) dpth r
|
draw_list graphdata.(dpth) dpth r
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
(*
|
||||||
let halt = ref false in
|
let halt = ref false in
|
||||||
while !halt = false do
|
while !halt = false do
|
||||||
Unix.sleepf 0.1 ;
|
Unix.sleepf 0.1 ;
|
||||||
Unix.sleepf 2.0 ;
|
Unix.sleepf 2.0 ;
|
||||||
halt := true;
|
halt := true;
|
||||||
done;
|
done;*)
|
||||||
end;
|
end;
|
||||||
graphdata ;;
|
graphdata ;;
|
||||||
|
|
||||||
|
@ -360,16 +361,16 @@ let successive_insert () =
|
||||||
Stdlib.print_endline "What element would you like to insert ? (crash to terminate)";
|
Stdlib.print_endline "What element would you like to insert ? (crash to terminate)";
|
||||||
let elt = Scanf.bscanf Scanf.Scanning.stdin "%d\n" identity in
|
let elt = Scanf.bscanf Scanf.Scanning.stdin "%d\n" identity in
|
||||||
|
|
||||||
close_graph () ;
|
|
||||||
open_graph " 1200x1000" ;
|
open_graph " 1200x1000" ;
|
||||||
set_window_title "Trees" ;
|
set_window_title "Trees" ;
|
||||||
|
|
||||||
cur_tree := insert_abr !cur_tree elt;
|
cur_tree := insert_abr !cur_tree elt;
|
||||||
ignore (pretty_tree_printing_new_version !cur_tree 40 100 1200 1000 true)
|
(*ignore (pretty_tree_printing_new_version !cur_tree 40 100 1200 1000 true)*)
|
||||||
|
ignore (even_more_pretty_printing !cur_tree 20 100 false);
|
||||||
done;
|
done;
|
||||||
()
|
()
|
||||||
with
|
with
|
||||||
| Stdlib.Scanf.Scan_failure _ -> ignore (pretty_tree_printing_new_version !cur_tree 40 150 1200 1000 true) ;close_graph () ;;
|
| Stdlib.Scanf.Scan_failure _ -> ignore (even_more_pretty_printing !cur_tree 20 100 false) ;close_graph () ;;
|
||||||
|
|
||||||
(* --------------------------------------| TESTS |-------------------------------------- *)
|
(* --------------------------------------| TESTS |-------------------------------------- *)
|
||||||
Random.self_init () ;;
|
Random.self_init () ;;
|
||||||
|
|
Loading…
Reference in New Issue