You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7419 Reporter: Anax Assigned to:@dra27 Status: assigned (set by @dra27 on 2016-11-22T15:49:09Z) Resolution: open Priority: normal Severity: minor Platform: Winodws OS: Windows 10 Version: 4.02.3 Category: platform support (windows, cross-compilation, etc) Monitored by:@gasche
Bug description
In class, we did some exercices on trees, and in the fil the teacher gave us, there were a function to trace trees (the fact that it is tree is not important).
I don't really know the module graphics.cma, but when I use it to trace a forest here, the forest is tarced, but when I when to close the windows with the space bar (there is the code let _ = read_key() in close_graph() at the end of the function) it crashes I have to launch again ocaml.
I use Windows 10 on my computer, and a friend of mine as the same problem on his Windows. At school, we use ubuntu and it works.
Steps to reproduce
As I don't really know how really works the graphics module, I give you the caml function :
letrec trace_arbre_binairet (xmin, xmax, ymin, ymax) h=match t with|Vide -> ()|Noeud_Binaire (x, t1, t2) ->
let dy = (ymax - ymin) / h inlet xm = (xmin + xmax) /2inlet s = string_of_int x in
moveto (xm - (10*String.length s) /2) ymax;
set_color green;
draw_string s;
let dx = (xmax - xmin) /2in
set_color yellow;
if t1 <>Videthen (
moveto xm (ymax -5);
lineto (xmin + dx /2) (ymax - dy +15);
);
if t2 <>Videthen (
moveto xm (ymax -5);
lineto (xmin + dx /2+ dx) (ymax - dy +15);
);
trace_arbre_binaire t1 (xmin, xm, ymin, ymax - dy) (h -1);
trace_arbre_binaire t2 (xm, xmax, ymin, ymax - dy) (h -1)
letvoir_arbre_binairet=let nx =800and ny =600in
open_graph (""^ (string_of_int nx) ^"x"^ (string_of_int ny));
set_color black;
fill_rect 00 nx ny;
let k =50in
trace_arbre_binaire t (k,nx - k,k,ny - k) (hauteur_arbre_binaire t);
let _ = read_key()in close_graph();;
where the type 'a arbre is
type'a arbre_binaire =
| Vide
| Noeud_Binaireof'a*'aarbre_binaire*'aarbre_binaire
Additional information
(I'm a French student, so I apologize for my apporxiamtive English)
Original bug ID: 7419
Reporter: Anax
Assigned to: @dra27
Status: assigned (set by @dra27 on 2016-11-22T15:49:09Z)
Resolution: open
Priority: normal
Severity: minor
Platform: Winodws
OS: Windows 10
Version: 4.02.3
Category: platform support (windows, cross-compilation, etc)
Monitored by: @gasche
Bug description
In class, we did some exercices on trees, and in the fil the teacher gave us, there were a function to trace trees (the fact that it is tree is not important).
I don't really know the module graphics.cma, but when I use it to trace a forest here, the forest is tarced, but when I when to close the windows with the space bar (there is the code let _ = read_key() in close_graph() at the end of the function) it crashes I have to launch again ocaml.
I use Windows 10 on my computer, and a friend of mine as the same problem on his Windows. At school, we use ubuntu and it works.
Steps to reproduce
As I don't really know how really works the graphics module, I give you the caml function :
where the type 'a arbre is
Additional information
(I'm a French student, so I apologize for my apporxiamtive English)
File attachments
The text was updated successfully, but these errors were encountered: