C
C#3mo ago
HD-Fr0sT

How could i navigate my cursor in my 2d array for loop

I have seen people using cursor(Console not windows) but i am unfamiliar with the functions and etc
5 Replies
HD-Fr0sT
HD-Fr0sT3mo ago
int[,] grid = {
{1, 2, 3,},
{4, 5, 6,},
{7, 8, 9,},
};


int kolumn;
int rad;

ConsoleKeyInfo key;




while (true)
{
Console.Clear();

for (int i = 0; i < grid.GetLength(0); i++)
{
for (int j = 0; j < grid.GetLength(1); j++)
{
Console.Write(grid[i,j]);
Console.Write(" ");
}

Console.WriteLine(" ");
}

key = Console.ReadKey();

switch (key.Key)
{

case ConsoleKey.UpArrow:
break;

case ConsoleKey.DownArrow:
break;

case ConsoleKey.LeftArrow:
break;

case ConsoleKey.RightArrow:
break;
}



}
int[,] grid = {
{1, 2, 3,},
{4, 5, 6,},
{7, 8, 9,},
};


int kolumn;
int rad;

ConsoleKeyInfo key;




while (true)
{
Console.Clear();

for (int i = 0; i < grid.GetLength(0); i++)
{
for (int j = 0; j < grid.GetLength(1); j++)
{
Console.Write(grid[i,j]);
Console.Write(" ");
}

Console.WriteLine(" ");
}

key = Console.ReadKey();

switch (key.Key)
{

case ConsoleKey.UpArrow:
break;

case ConsoleKey.DownArrow:
break;

case ConsoleKey.LeftArrow:
break;

case ConsoleKey.RightArrow:
break;
}



}
HD-Fr0sT
HD-Fr0sT3mo ago
is there also a way to make the cursor cover a text if its over it
leowest
leowest3mo ago
mmmm no idea maybe if u change the Console.CursorSize? but yeah no idea about that
HD-Fr0sT
HD-Fr0sT3mo ago
sounds very plausable
Want results from more Discord servers?
Add your server
More Posts