title: Python Random Map Generation with Perlin Noise
body: <p>Recently, I've been attempting to defeat one of my main weaknesses in programming in general, random generation.  I thought it would be an easy thing to do, but the lack of simple information is killing me on it.  I don't want to sound dumb, but it feels to me like most of the information from places like <a href="http://freespace.virgin.net/hugo.elias/models/m_perlin.htm" rel="noreferrer">this</a> are written for mathematicians who went to college to graduate in theoretical mathematics.  I just don't understand what I'm meant to do with that information in order to apply it to programming in a language such as python.</p>
  
  <p>I've been working a few days staring at equations and attempting attempt after attempt, but still after all those days, after ripping my code apart again and again, all that's been working properly this entire time is this noise generator to generate basic noise:</p>
  
  <pre><code>import random
  import math
  
  random.seed(0)
  
  def generateWhiteNoise(width,height):
      noise = [[r for r in range(width)] for i in range(height)]
  
      for i in range(0,height):
          for j in range(0,width):
              noise[i][j] = random.randint(0,1)
  
      return noise
  
  noise = generateWhiteNoise(50,12)
  
  for i in noise:
      print()
      for o in i:
          if(o == 0):
              print('-',end='')
          else:
              print('#',end='')
  </code></pre>
  
  <p>This code produces this result:</p>
  
  <pre><code>##-######--#--#-#--##-###-###---#-##-#-----#--##-#
  #-#-##-##-#----##------##--#####-#-##---#--#-##---
  -------#-#------#---#-#---###--#--#-###-----##-#--
  ######--#-#-#--####-###---#---###-##--#-#-##--####
  -#----###--------##--##--##-#-#--#----###-####--##
  ---####-#--#--###-#-#--#--#####--####-#-##-##--#--
  ----#--####-#-#-#-#-#---#--###------###--#-######-
  --###--#-###-------#-##--###---#-####----###-#####
  #----##--##-#--##-###--#----#-#-##--##-#-##---###-
  ##---##----##--##--#--#--###-###-#--#-##---#------
  -##----#-###---######---#-#---#---###---#---###-##
  #--##-##-###-###---#--##-##--##-##-#-#-##--#-#-##-
  </code></pre>
  
  <p>I'm wanting it to eventually produce something like this:</p>
  
  <pre><code>--------------------------------------------------
  ------------------####----------------------------
  -----------------#####----------------------------
  ----------------#####-----------------------------
  ---------------#####--------------###-------------
  ---------------#####--------------###-------------
  ---------------------------------####-------------
  ---######------------------------####-------------
  ---######------------###--------------------------
  ----########---------###--------------------------
  -----#######---------###--------------------------
  ------###-----------------------------------------
  </code></pre>
  
  <p>How can I manage to smooth out the white-noise I generate, and turn it into islands?  Can anyone explain it in a very simplistic way for me?</p>
  
  <p>I may be thinking about all of this very wrong.</p>