I have to write the game of life programm for my class. Keep in mind this is my first programming class and i hardly know anything. Well anyways i cant figure out how to check the neighbors. What do I do. got any examples? Help is much appreciated.
I have to write the game of life programm for my class. Keep in mind this is my first programming class and i hardly know anything. Well anyways i cant figure out how to check the neighbors. What do I do. got any examples? Help is much appreciated.
What type of data structure are you using? If it's just a two dimensional array then all you have to do to check the neighbors is
up = current[i - 1][j];
down = current[i + 1][i];
left = current[i][j - 1];
right = current[i][j + 1];
-Prelude
My best code is written with the delete key.