Table of Contents

#Repeated smoothing

I wanted to see what the smoother function from the noise function tutorial page did if you repeated it.

def smoother(noise):
    output = []
    for i in range(len(noise) - 1):
        output.append(0.5 * (noise[i] + noise[i+1]))
    return output

for i in range(30):
    noise = [0] * mapsize
    noise[30] = 100
    for j in range(i):
        noise = smoother(noise)
        if j % 2 == 0: noise = noise + [0]
        else: noise = [0] + noise
    print_chart(i, noise)

Looks like a Gaussian!

#Repeated roughening

I wanted to see the same for the rougher function:

def rougher(noise):
    output = []
    for i in range(len(noise) - 1):
        output.append(0.5 * (noise[i] - noise[i+1]))
    return output

for i in range(30):
    noise = [0] * mapsize
    noise[30] = 100
    for j in range(i):
        noise = rougher(noise)
        if j % 2 == 0: noise = noise + [0]
        else: noise = [0] + noise
    print_chart(i, noise)

Is this a sinc function?