This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clone of https://gist.github.com/Flafla2/1a0b9ebef678bbce3215 with more dimensions and seed generation. | |
public class PerlinGen | |
{ | |
private readonly int[] p; // Randomly shuffled array of values from 0 to 255. | |
// Values are repeated twice to get performance boost | |
// from avoiding the use of modulo operator. | |
public PerlinGen(int seed) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def simplifyExpr(target): | |
out = "" # output | |
brac = {} # dictionary matching ending positions of brackets to starting positions | |
bracStac = [] # stack containing positions of unclosed brackets | |
index = 0 # current position in target | |
outIndex = 0 # current position in out | |
skip = 0 # used to skip this many characters | |
for c in target: | |
app = '' | |
if(skip > 0): |