Skip to content

Instantly share code, notes, and snippets.

@calebrob6
Created April 25, 2013 16:59
Show Gist options
  • Save calebrob6/5461323 to your computer and use it in GitHub Desktop.
Save calebrob6/5461323 to your computer and use it in GitHub Desktop.
Perlin Noise Test Python
from matplotlib import pyplot
X=[]
Y=[]
currentNum = 0
randRange = 7
def getPerlinNum():
global currentNum, randRange
currentNum = random.randrange(currentNum-randRange+1,currentNum+randRange)
return currentNum
def getRandomNum():
return random.randrange(-50,50)
for i in range(0,100):
X.append(i)
Y.append(getPerlinNum())
#Y.append(getRandomNum())
pyplot.plot( X, Y, '-' )
pyplot.title( 'Plotting PERLIN' )
pyplot.xlabel( 'X' )
pyplot.ylabel( 'Y' )
pyplot.show(block=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment