If you have OCaml on your machine, To run this code do:
ocamlc graphics.cma Ergodic.ml
./a.out
Otherwise see this.