hi we are trying to make game of life using haskell. I am confused how to define my data type Conway:
In src/Automata.hs, fill out the data type Conway that represents cells in the game of life. Defining our own type to talk about cells lets us be precise when we code, which reduces bugs
– | Type of cells used in Conway’s game of life. data Conway – TODO
In your case I think you should create a type that contains one element for cells that are ‘off’ and another element for cells that are ‘on’. That would be very similar to the boolean example, only with different names.
Types in Haskell are called algebraic data types, so you can search for that on the internet. Some other relevant pages are:
yes it is an uni assignment. It was actually very simple as I though it would be, I made it very complicated for myself. So the Conway is either dead or alive so
data Conway = Allive | Dead