(self, size, range, symmetric=False)
return numpy.array(ret)
Creates a terrain map containing streaks that run from north-west to south-east

           Starts with a single point [[a]] and converts it into [[a, b], [c, d]]
           where:
           b = a + (random change)
           c = a + (random change)
           d = b + (random change) and c + (random change)

           Repeat untill size matches required size
Creates a terrain map containing streaks that run from north-west to south-east
Creates a terrain map containing streaks that run from north - west to south - east
def create_streak(self, size, range, symmetric=False):
        """Creates a terrain map containing streaks that run from north-west to south-east

           Starts with a single point [[a]] and converts it into [[a, b], [c, d]]
           where:
           b = a + (random change)
           c = a + (random change)
           d = b + (random change) and c + (random change)

           Repeat untill size matches required size"""
        add_random_range = self.add_random_range

        # Creates the top row
        ret = [[add_random_range(0, 0, range)]]
        for x in xrange(size[0] - 1):
            pos_west = ret[0][-1]
            if pos_west <= 0:
              ret[0].append(add_random_range(pos_west, 0, 1))
            elif pos_west >= range:
              ret[0].append(add_random_range(pos_west, -1, 0))
            else:
              ret[0].append(add_random_range(pos_west, -1, 1))

        # Create the next row down
        for y in xrange(size[1] - 1):
            pos_north = ret[-1][0]
            if pos_north <= 0:
                next_row = [add_random_range(pos_north, 0, 1)]
            elif pos_north >= range:
                next_row = [add_random_range(pos_north,-1, 0)]
            else:
                next_row = [add_random_range(pos_north, -1, 1)]

            for x in xrange(size[0] - 1):
                pos_north = ret[-1][x+1]
                pos_west = next_row[-1]
                if pos_west == pos_north:
                    if pos_west <= 0:
                        next_row.append(add_random_range(pos_west, 0, 1))
                    elif pos_west >= range:
                        next_row.append(add_random_range(pos_west, -1, 0))
                    else:
                        next_row.append(add_random_range(pos_west, -1, 1))
                elif abs(pos_west - pos_north) == 2:
                    next_row.append((pos_west + pos_north)/2)
                else:
                    next_row.append(random.choice((pos_west, pos_north)))
            ret.append(next_row)

        if symmetric:
            ret = self.make_symmetric(ret)
        return numpy.array(ret)
def create_streak ( self , size , range , symmetric = False ) : add_random_range = self . add_random_range # Creates the top row ret = [ [ add_random_range ( 0 , 0 , range ) ] ] for x in xrange ( size [ 0 ] - 1 ) : pos_west = ret [ 0 ] [ - 1 ] if pos_west <= 0 : ret [ 0 ] . append ( add_random_range ( pos_west , 0 , 1 ) ) elif pos_west >= range : ret [ 0 ] . append ( add_random_range ( pos_west , - 1 , 0 ) ) else : ret [ 0 ] . append ( add_random_range ( pos_west , - 1 , 1 ) ) # Create the next row down for y in xrange ( size [ 1 ] - 1 ) : pos_north = ret [ - 1 ] [ 0 ] if pos_north <= 0 : next_row = [ add_random_range ( pos_north , 0 , 1 ) ] elif pos_north >= range : next_row = [ add_random_range ( pos_north , - 1 , 0 ) ] else : next_row = [ add_random_range ( pos_north , - 1 , 1 ) ] for x in xrange ( size [ 0 ] - 1 ) : pos_north = ret [ - 1 ] [ x + 1 ] pos_west = next_row [ - 1 ] if pos_west == pos_north : if pos_west <= 0 : next_row . append ( add_random_range ( pos_west , 0 , 1 ) ) elif pos_west >= range : next_row . append ( add_random_range ( pos_west , - 1 , 0 ) ) else : next_row . append ( add_random_range ( pos_west , - 1 , 1 ) ) elif abs ( pos_west - pos_north ) == 2 : next_row . append ( ( pos_west + pos_north ) / 2 ) else : next_row . append ( random . choice ( ( pos_west , pos_north ) ) ) ret . append ( next_row ) if symmetric : ret = self . make_symmetric ( ret ) return numpy . array ( ret )