Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. for (int y = 0; y < mapHeight; y++) {
  2. for (int x = 0; x < mapWidth; x++) {
  3. int neighbours = CountAliveNeighbours(oldMap, x, y);
  4. if(oldMap[y,x] == MV.floor){
  5. if(deadLimit > neighbours){
  6. map[y,x] = MV.wall;
  7. }else{
  8. map[y,x] = MV.floor;
  9. }
  10. }else{
  11. if(neighbours > birthLimit){
  12. map[y,x] = MV.floor;
  13. }else{
  14. map[y,x] = MV.wall;
  15. }
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement