let draw_configuration () =
let hexagon = [|
scale,0; hexagon_width,hexagon_height/3; hexagon_width,hexagon_height;
scale,(hexagon_height*4)/3; 0,hexagon_height ; 0,hexagon_height/3|] in
let draw_cell x y =
hexagon
|> Array.map (fun (xh,yh) ->
x*hexagon_width +xh +(if y mod 2 =0 then 0 else scale),
y*hexagon_height +yh)
|> fill_poly in
fun color_of_state configuration time ->
Femtolib.Array_simulate_2d.iteri height
(fun x y state ->
set_color (color_of_state state);
draw_cell x y)
configuration