import math import random import perlin def gen(maxx,maxy,maxz): noise = perlin.Generate(maxx,maxy) choices = ['grass','dirt'] output = [] for x in xrange(maxx): for y in xrange(maxy): for z in xrange(maxz): #if z == 0 or z == (maxz -1) or x == 0 or x == (maxx -1) or y == 0 or y == (maxy -1): #output.append((x,y,z,'metal')) if False: pass elif z <= noise[x][y]: c = random.choice(choices) if c: output.append((x,y,z,c)) return output