I'm trying to learn my way around C# threading by making a simple little game. I've run into a bit of an issue that I could certainly use help with.
My desire is to have simultaneous input and output. The output from the threads would appear at the top of the screen, while the user's input could be typed to the bottom of the screen. The problem I am running into is that in order to refresh the screen, when I use
static int i = 0;
static void Main(string args)
Thread tickThread = new Thread(new ThreadStart(CountThread));
Thread userThread = new Thread(new ThreadStart(UserInput));
static void UserInput()
string input = "";
input = Console.ReadLine();
static void CountThread()
Console.SetCursorPosition(0, Console.WindowHeight - 1);
You can set cursor position in a loop for each cell in the console except those, which are designed for user's input, and write a space symbol. This will, essentially, clear a part of a console window. Also, you can use the same method to partially render output to the console.