I am new to C#, so please try to be basic and explain things as much as possible.
This is my code right now:
using System;
using System.Threading;
class MathQuiz
{
static void Main()
{
Thread ask = new Thread (new ThreadStart (prompt));
ask.Start();
Console.ReadKey();
}
static void prompt()
{
Console.WriteLine ("Testing!");
}
}
What I want to do, however, is have the new thread read a ConsoleKeyInfo to an object. Then, if the user doesn't press a key in 10 seconds, they move on to the next question, which repeats the process with a different answer.
Hopefully, you're still with me.
I need to have a variable in the MAIN thread be modifiable and callable in the "prompt" thread.
How can I do this?