Added tests of the Graphics module.
[fedora-mingw.git] / ocaml / test3.ml
diff --git a/ocaml/test3.ml b/ocaml/test3.ml
new file mode 100644 (file)
index 0000000..4d8b5e8
--- /dev/null
@@ -0,0 +1,12 @@
+(* From: http://www.ocaml-tutorial.org/the_structure_of_ocaml_programs *)
+
+open Graphics;;
+
+let () =
+  open_graph " 640x480";
+  for i = 12 downto 1 do
+    let radius = i * 20 in
+    set_color (if (i mod 2) = 0 then red else yellow);
+    fill_circle 320 240 radius
+  done;
+  ignore (read_line ())