rewrite of conway.hs to do IO, random assignment, and to use arrays