Hello all,
I'm very new in C# and need your help.
I have a 3 values to print in the console screen with the following position.
A
B
With cursor position I can get this result, but when I’m starting to move A and B to F and it is OK (at least it seems to be), but I want to remove the A’s and B’s trace.
Currently it works like
AAAAAAA
BBBBBBB
But I want to be like the example below:
each time the A’s and B’s position changes the previews char remove like
A
B
A
B
and until F.
Could you help me please?
Below is the code I have.
Code:
char chA = 'R';
char chB = 'B';
string fin = "F";
int posA = 0;
int posB = 0;
int finish = 100;
//Print once only and keep the text
Console.SetCursorPosition(finish, 1);
Console.WriteLine(fin);
while (finish != 1)
{
Console.SetCursorPosition(posA, 0);
Console.WriteLine(chA);
if (finish ==10)
{
posA += 2;
}else
{
posA += 1;
}
Console.SetCursorPosition(posB, 2);
Console.WriteLine(chB);
posB = posB + 1;
Thread.Sleep(300);
--finish;
}
Thanks in advance