Dear All,
Our Lecturer has set us the task of writing a program to play the Game of Life, it starts by us setting up a matrix... how do we set up matrices and where do we go from there?
Please help, we are lost without you!
Folklord*
Dear All,
Our Lecturer has set us the task of writing a program to play the Game of Life, it starts by us setting up a matrix... how do we set up matrices and where do we go from there?
Please help, we are lost without you!
Folklord*
> how do we set up matrices
int pond[10][10];
pond[0][0] is one corner
pond[9][9] is the opposite corner
> where do we go from there?
I assume your lecturer gave you the rules for determining who lives, dies and gets born
I suppose a function to count the neighbours of a cell would be a good start.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.