On Apr 8, 2007, at 9:06 AM, Richard Jones wrote:
> You might need to install X11.app (from Mac OS X install disk 1) for
> the above to work.
Yes. To use the Graphics module, you need to install and run X11.app
(though I remember a project that somehow used native graphics,
though I can't find it with a half-assed google search). Then start
your toplevel from the X11 temminal (if you're using cococaml, you
can launch it with "open /Applications/CocOCaml.app").
Then just enter
#load "graphics.cma";;
open Graphics;;
into the toplevel, and you're good to go.
open_graph " 600x600";;
set_color yellow;;
fill_circle 300 300 200;;
set_color black;;
fill_ellipse 225 375 35 50;;
fill_ellipse 375 375 35 50;;
set_line_width 5;;
draw_arc 300 300 100 100 225 315;;
draw_circle 300 300 200;;
let draw_face x y r =
set_color yellow;
fill_circle x y r;
set_color black;
let offset = 3 * r / 8 in
fill_ellipse (x - offset) (y + offset) (r / 5) (r / 4);
fill_ellipse (x + offset) (y + offset) (r / 5) (r / 4);
set_line_width (max 1 (r/40));
draw_arc x y (r / 2) (r/2) 225 315;
draw_circle x y r;;
draw_face 500 500 25;;
William D. Neumann
"I eat T-bone steaks, I lift barbell plates, I'm sweeter than a
German chocolate cake. I'm the reflection of perfection, the number
one selection. I'm the man of the hour, the man with the power, too
sweet to be sour. The ladies' pet, the men's regret, where what you
see is what you get, and what you don't see, is better yet."
--Superstar Billy Graham
.