Java Tile Array Issue

I am creating a 2D TileMap.I am using integers to determine tile type. I wanted to turn every grass tile(4) that neighbours at least one ocean tile(3) in to sand(1). public void geography() { for(int x=0; x<width; x++) { //Iterates through array for(int y=0; y<height; y++) { int counter = sametile(x,y,1,3); // uses a method… Read More Java Tile Array Issue

Writing combinations from a list of strings where output is longer than input

What I’m trying to do is to take a list like this: [‘WS’,’SB’…] And write a python program that will produce an output like this for each string in the list: [‘WWWW’,’WWWS’,’WWSS’,’WSSS’,’SSSS’,’SSSW’,’SSWW’,’SWWW’,’WSSW’,’SWWS’,’WSWS,’SWSW’] Essentially, I want all possible 4-character strings that can be written with those 2 characters. The order of the characters in the input… Read More Writing combinations from a list of strings where output is longer than input