public static void PrintMap(dungeon d) { //dungeon.ARCH //dungeon.BLOCKED //dungeon.BLOCK_CORR //dungeon.BLOCK_DOOR //dungeon.BLOCK_ROOM //dungeon.CORRIDOR //dungeon.DOOR //dungeon.DOORSPACE //dungeon.ENTRANCE //dungeon.LOCKED //dungeon.OPENSPACE //dungeon.PERIMETER //dungeon.ROOM //dungeon.SECRET //dungeon.STAIRS //dungeon.TRAPPED string map = string.Empty; for (int r = 0; r <= d.n_rows; r++) { if (map.Length > 0) { map += "\n"; } for (int c = 0; c <= d.n_cols; c++) { if ((d.cell[r][c] & dungeon.PERIMETER) != dungeon.NOTHING) { map += "0"; } else if ((d.cell[r][c] & dungeon.DOOR) != dungeon.NOTHING) { map += "-";// map += "-"; } else if ((d.cell[r][c] & dungeon.ROOM) != dungeon.NOTHING) { map += " ";// map += "#"; } else if ((d.cell[r][c] & dungeon.CORRIDOR) != dungeon.NOTHING) { map += " ";// map += "#"; } else { map += "0"; } } } Console.Write(map); }
static void Main() { Console.WriteLine("Hello World!"); X = 100; //height Y = 100; //width //cleanDungeon(); //placeRooms(); //drawDungeon(); dungeon dun = GenerateDungeon(); //PrintMap(dun); //GenerateDungeon2(); Map map = new Map(10, 10); map.MarkCellsUnvisited(); map.PickRandomCellAndMarkItVisited(); map.Generate(); }