I've been trying to create a roguelike, and I was trying to create randomly generated rooms like in Rogue. I'm seperating my map array into sections and giving it a 50% chance of spawning a room, but right now it doesn't do anything but spawn solid rock. What am I doing wrong?
int MapSizeX = 100;
int MapSizeY = 100;
char map[100][100] = {};
char wall = 178;
int ViewDistance = 10;
int x = 25;
int y = 25;
int Groom = 1;
int RoomArea = 10;
void Init()
{
map[MapSizeY][MapSizeX];
for(int a = 0; a < MapSizeY; a++)
{
for(int b = 0; b < MapSizeX; b++)
{
map[b][a] = wall;
}
}
for(int c = 0; c < MapSizeX; c = c + RoomArea)
{
for(int d = 0; d < MapSizeY; d = d + RoomArea)
{
int Groom = (rand() % 2) + 1;
if(Groom == 2)
{
for(int a = 0; a < RoomArea; a++)
{
for(int b = 0; b < RoomArea; b++)
{
map[a][b] = ' ';
}
}
}
}
}
}