Advertisement
Guest User

Untitled

a guest
Nov 11th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. newmap = []
  2.  
  3. m = elevation_map
  4. for i in range(0, len(elevation_map)-1, 2):
  5. newmap.append([])
  6. for j in range(0, len(elevation_map[i]), 2):
  7. if len(elevation_map) % 2 == 0:
  8. s = m[i][j]
  9. s += m[i][j+1]
  10. s += +m[i+1][j]
  11. s += m[i+1][j+1]
  12. newmap[-1].append(int(s/4))
  13. else:
  14.  
  15. s = elevation_map[i][j]
  16. s += elevation_map[i+1][j]
  17. newmap[-1].append(int(s/2))
  18.  
  19. if in_matrix(elevation_map,[i,j+1]):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement