Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. void step(matrix &field)
  2. {
  3.  
  4. matrix my=*getBlankField(field.size(),field[0].size());
  5. void copy(matrix &field,matrix my){
  6.  
  7.  
  8. for(int i=0;i<field.size();i++)
  9. {
  10. for(int j=0;j<field[0].size();j++)
  11. {
  12. int alive;
  13. for(int f=-1;f<2;f++)
  14. {
  15. for(int a=-1;a<2;a++)
  16. {
  17. if(my[i+f][j+a]){
  18. alive++;}
  19. }
  20. }
  21. if(alive=0)
  22. {
  23. }
  24. else
  25.  
  26.  
  27. for(int i;i<my.size();i++)
  28. {
  29. for(int j;j<my[i].size();j++)
  30. {
  31. field[i][j]=my[i][j];
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement