let color_of_state = let colors = [|Graphics.black;Graphics.red;Graphics.green;Graphics.blue|] in fun state -> if state <= 3 then colors.(state) else Graphics.white