✅ After 2 wrong guesses, the program closes immediately
As the title says, after 2 wrong guesses the program doesnt show the text, or wait 3000 milliseconds. It just closes immediately. I dont know if Environment.Exit is a correct command to use in this situation, i just looked it up. Basically, after 2 wrong guesses i want the program to wait 3 seconds and then close.
8 Replies
You're not
await
ing Task.DelayIf you are a beginner you may use Thread.Sleep instead of Task.Delay. tho in actual apps it is a no-go, but I suggest to not weigh yourself with async/await for now
okay, thank you. so there isnt any beginner-friendly way for the program to wait?
Thread.Sleep is simple but it blocks the thread, which will concern you only after you start creating multi-thread programs
Okay, thanks, ill try to use thread.sleep and see how it goes
ill be sure to change that after learning about these multi thread programs
You may as well do
Afair it will work the same way
this gives me some errors, ill use the thread.sleep for now
Consider
/close
ing this thread