I suppose we should consolidate these various threads, but this one is more general programming oriented. While this is a game I'm making, this is definitely a serious program error that I do not know how to fix.
I've been working all day on a map generator function for my roguelike, and it's... well it technically works, after commenting out huge blocks of the code, but it is already exposing something bad. How it essentially works is that it first generates certain-sized arrays of random booleans. This is then handed to the generator that iterates through the array, interpreting the length of the array (given to it) as how many sections to divide the screen (four is quarters for example, dividing the array in half for top/bottom), using the boolean to decide if it should draw a room there, according to some randomizing functions and hard-coded parameters. I've only designed it to work with four, six, and eight sections, and everything about my math says that everything fits and is arranged as it should be.
Now like I said, it does technically work, but only with the quarters-array. The sixth and eighth ones do terrible terrible things to the console.
Note that I did not tell it to draw the second map with a different character and color, it chose to do that on its own. I'm totally knackered after being at this for the better part of twelve hours, so I have no clue why this is breaking so badly, and the code is kinda large to post here. I'm still going through it, but if anyone has any ideas, I'm all ears.
Aaaaaand in the way of programming, I
just realized why it's probably going all pear shaped. This is like the sixth time today I was about to post a "OH GOD HELP" question before powering through my error, and I just did it again.