Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newmap = []
- m = elevation_map
- for i in range(0, len(elevation_map)-1, 2):
- newmap.append([])
- for j in range(0, len(elevation_map[i]), 2):
- if len(elevation_map) % 2 == 0:
- s = m[i][j]
- s += m[i][j+1]
- s += +m[i+1][j]
- s += m[i+1][j+1]
- newmap[-1].append(int(s/4))
- else:
- s = elevation_map[i][j]
- s += elevation_map[i+1][j]
- newmap[-1].append(int(s/2))
- if in_matrix(elevation_map,[i,j+1]):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement