late-goodbye / the-game-of-life

MIT License
1 stars 0 forks source link

Implement module for generation .gif picture based on 2D matrix #2

Open late-goodbye opened 5 years ago

late-goodbye commented 5 years ago

The module uses 2D matrix to generate a .gif picture. Each matrix cell is bool value. The picture represents each value as a black pixel if the value os true and a white pixel otherwise.

late-goodbye commented 5 years ago

Input data type: [[((x :: Int, y :: Int), (present_state :: Bool, future_state :: Bool))]]

aekrylov commented 5 years ago

I think the data type could be simply a 2D Bool matrix or something like a sparse matrix

late-goodbye commented 5 years ago

I think the data type could be simply a 2D Bool matrix or something like a sparse matrix

You're right. Then [(x :: Int, y :: Int)] if we will draw picture just at the moment the separate matrix was generated or [[(x :: Int, y :: Int)]] in case of generating .gif animation after a simulation is finished.

I suppose the most cells on a map will be not active, so the sparse matrix is better solutuon.

late-goodbye commented 5 years ago

As I understand, a transmission of the whole set of matrices is a simpler option to be implemented, so I suggest this way.