Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void step(matrix &field)
- {
- matrix my=*getBlankField(field.size(),field[0].size());
- void copy(matrix &field,matrix my){
- for(int i=0;i<field.size();i++)
- {
- for(int j=0;j<field[0].size();j++)
- {
- int alive;
- for(int f=-1;f<2;f++)
- {
- for(int a=-1;a<2;a++)
- {
- if(my[i+f][j+a]){
- alive++;}
- }
- }
- if(alive=0)
- {
- }
- else
- for(int i;i<my.size();i++)
- {
- for(int j;j<my[i].size();j++)
- {
- field[i][j]=my[i][j];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement