public Vector2(int xCord, int yCord)
public static void Main()
GridSystem gridSys = new GridSystem();
string[, ] grid = new string[8, 10];
Vector2 playerPos = new Vector2(0, 0);
Vector2 applePos = new Vector2(0, 0);
Update(grid, playerPos, ref applePos, ref changer);
public static void Move(string dir, ref Vector2 playerPos)
public static void Update(string[, ] grid, Vector2 playerPos, ref Vector2 applePos, ref int changer)
if ((playerPos.x == applePos.x) && (playerPos.y == applePos.y))
Console.WriteLine(applePos.x + ", " + applePos.y);
PlaceApple(ref grid, applePos);
grid[applePos.x, applePos.y] = "A";
grid[playerPos.y, playerPos.x] = "⬛";
Move(Console.ReadLine(), ref playerPos);
public static Vector2 PlaceApple(ref string[, ] grid, Vector2 applePos)
Random rnd = new Random();
return new Vector2(rnd.Next(0, grid.GetLength(0)), rnd.Next(0, grid.GetLength(1)));
public static void FillGrid(ref string[, ] info, string ToFill)
for (int y = 0; y < info.GetLength(0); y++)
for (int x = 0; x < info.GetLength(1); x++)
public static void WriteGrid(string[, ] info)
for (int y = 0; y < info.GetLength(0); y++)
for (int x = 0; x < info.GetLength(1); x++)
Console.Write(info[y, x]);