public static Random random = new Random();
public static int MazeSizeX = 4;
public static int MazeSizeY = 4;
public static Player Player = new Player(new Point(0, 0), 100, 10, 0);
public static Room[][] Maze = new Room[MazeSizeX][];
public static Point[] initRooms = new Point[MazeSizeX * MazeSizeY];
public static int numInitRooms = 0;
public static int iter = 0;
public static bool isFirstTime = true;
public static void Main()
for (int i = 0; i < MazeSizeX; i++)
Maze[i] = new Room[MazeSizeY];
for (int j = 0; j < MazeSizeY; j++)
InitMaze(MazeSizeX, MazeSizeY);
Console.WriteLine("WELCOME TO THE 𝔻𝕦𝕟𝕘𝕖𝕠𝕟𝕤 𝕠𝕗 𝔻𝕣𝕦𝕤𝕖");
Console.WriteLine("You are in the room at: " + Player.X.ToString() + ", " + Player.Y.ToString());
Console.WriteLine("You can say: 'go', 'look'");
string msg = Console.ReadLine();
if (msg == "look" && !fighting)
bool nw = !Maze[Player.X][Player.Y].northWall;
bool ew = !Maze[Player.X][Player.Y].eastWall;
bool sw = !Maze[Player.X][Player.Y].southWall;
bool ww = !Maze[Player.X][Player.Y].westWall;
Console.WriteLine("You can go: " + (nw ? "north, " : "") + (ew ? "east, " : "") + (sw ? "south, " : "") + (ww ? "west, " : ""));
if (msg == "map" && !fighting)
Console.WriteLine("You are in the room at: " + Player.X.ToString() + ", " + Player.Y.ToString());
if (msg.Contains("go") && !fighting)
if (!(msg.Contains("north") || msg.Contains("east") || msg.Contains("south") || msg.Contains("west")))
Console.WriteLine("What direction? you can say:'north', 'east', 'south', or 'west'");
if (msg.Contains("north") && cmd == "go")
if (Maze[Player.X][Player.Y].northWall)
Console.WriteLine("You cant go there, there is a wall");
else if (Player.Y + 1 >= MazeSizeY)
Console.WriteLine("You cant go there");
Console.WriteLine("You have moved to " + Player.X.ToString() + ", " + Player.Y.ToString());
if (msg.Contains("east") && cmd == "go")
if (Maze[Player.X][Player.Y].eastWall)
Console.WriteLine("You cant go there, there is a wall");
else if (Player.X + 1 >= MazeSizeX)
Console.WriteLine("You cant go there");
Console.WriteLine("You have moved to " + Player.X.ToString() + ", " + Player.Y.ToString());
if (msg.Contains("south") && cmd == "go")
if (Maze[Player.X][Player.Y].southWall)
Console.WriteLine("You cant go there, there is a wall");
else if (Player.Y - 1 < 0)
Console.WriteLine("You cant go there");
Console.WriteLine("You have moved to " + Player.X.ToString() + ", " + Player.Y.ToString());
if (msg == "west" && cmd == "go")
if (Maze[Player.X][Player.Y].westWall)
Console.WriteLine("You cant go there, there is a wall");
else if (Player.X - 1 < 0)
Console.WriteLine("You cant go there");
Console.WriteLine("You have moved to " + Player.X.ToString() + ", " + Player.Y.ToString());
if (Maze[Player.X][Player.Y].type == "enemy" && !fighting)
EnemyRoom ter = (EnemyRoom)Maze[Player.X][Player.Y];
ter.Health = Player.HP + random.Next(Player.HP / -10, Player.HP / 10);
ter.Attack = Player.ATK + random.Next(Player.ATK / -10, Player.ATK / 10);
Console.WriteLine("You have encountered an enemy! you can say: 'attack', 'check', 'boost', 'defend'");
public static void enemyTurn(EnemyRoom enemy)
public static void InitMaze(int sizeX, int sizeY)
Console.WriteLine("loading maze");
InitRoom(1, 0, 3, sizeX - 1, sizeY - 1);
InitRoom(0, 1, 2, sizeX - 1, sizeY - 1);
for (int i = 0; i < random.Next(numInitRooms) / 5; i++)
int RoomIndex = random.Next(numInitRooms);
Maze[initRooms[RoomIndex].X][initRooms[RoomIndex].Y] = new PrizeRoom(Maze[initRooms[RoomIndex].X][initRooms[RoomIndex].Y]);
for (int i = 0; i < random.Next(numInitRooms) / 3; i++)
int RoomIndex = random.Next(numInitRooms);
Maze[initRooms[RoomIndex].X][initRooms[RoomIndex].Y] = new EnemyRoom(Maze[initRooms[RoomIndex].X][initRooms[RoomIndex].Y]);
public static void InitRoom(int x, int y, int d, int sizeX, int sizeY)
if (x >= sizeX || x < 0 || y >= sizeY || y < 0)
Maze[x][y].northWall = false;
Maze[x][y + 1].southWall = false;
Maze[x][y].eastWall = false;
Maze[x + 1][y].westWall = false;
Maze[x][y].southWall = false;
Maze[x][y - 1].northWall = false;
Maze[x][y].westWall = false;
Maze[x - 1][y].eastWall = false;
Maze[x][y].isInit = true;
initRooms[numInitRooms] = new Point(x, y);
if (random.Next() % 2 == 0)
InitRoom(x, y + 1, 2, sizeX, sizeY);
if (random.Next() % 2 == 0)
InitRoom(x + 1, y, 3, sizeX, sizeY);
if (random.Next() % 2 == 0)
InitRoom(x, y - 1, 0, sizeX, sizeY);
if (random.Next() % 2 == 0)
InitRoom(x - 1, y, 1, sizeX, sizeY);
public string type = "Basic";
public bool isInit = false;
public bool northWall = true;
public bool southWall = true;
public bool eastWall = true;
public bool westWall = true;
public class EnemyRoom : Room
public class PrizeRoom : Room
public Player(Point loc, int hp, int atk, int def)