7
then int_of_float (x +. 0.5)
8
else - (int_of_float (-. x +. 0.5));;
11
{ mutable x : float; mutable y : float;
12
mutable vis�e : float; mutable lev� : bool };;
14
let crayon = { x = 0.0; y = 0.0; vis�e = 0.0; lev� = false };;
16
let fixe_crayon b = crayon.lev� <- b;;
19
let pi = 4.0 *. (atan 1.0) in pi /. 180.0;;
22
crayon.vis�e <- (crayon.vis�e +. angle *. pi_sur_180);;
25
let dx = d *. cos (crayon.vis�e)
26
and dy = d *. sin (crayon.vis�e) in
27
crayon.x <- crayon.x +. dx;
28
crayon.y <- crayon.y +. dy;
30
then moveto (round crayon.x) (round crayon.y)
31
else lineto (round crayon.x) (round crayon.y);;
33
let couleur_du_trac� = foreground;;
34
let couleur_du_fond = background;;
36
let z�ro_x = float_of_int ((size_x ()) / 2);;
37
let z�ro_y = float_of_int ((size_y ()) / 2);;
41
set_color couleur_du_trac�;
46
moveto (round crayon.x) (round crayon.y);;