Original Post
Nothing like a seemingly easy problem to make one feel dumb. I've got a few very basic issues that will probably be ridiculously obvious when pointed out to me: 1. I can't for the life of me figure out the math formula for how many walls there should be given a # of columns and rows. 2. What I have so far for my maze generation class is: 3. been trying for 3 days now to come up with how to write and iteration that will assign a floor and and wall to a room. Once I can do that I'm sure it wouldn't be that difficult to finish. 4. Drawing the maze is being a pain aswell. I can't seem to figure out how to draw a simple 3x3 grid that's aligned nicely with for loops using the '|' and '_' characters. Its stupid easy, I remember doing it in 9th grade but I don't remember how I did it. Its frustrating because almost all of my hang ups feel like they're on the tip of my brain but just won't go over.
class MazeGen
{
int[] rooms;
int[][] roomSets;
Wall wall = new Wall;
Wall floor = new Wall;
Wall[] walls;
// the ? is because I don't know how many walls to make..
public MazeGen(int h, int w)
{
rooms = new int[h * w];
roomSets = new int[rooms.Length][];
walls = new Wall[?];
}
}
struct Wall
{
bool wallUp;
int room1;
int room2;
}