I want to create a simple game like tic tac toe where the human user is playing against the computer. The computer function takes a couple of milliseconds to run but I would like to give the perception of the computer taking 5 seconds to make a move. Which method should I use?
1) Create two memory threads. One for the computer and one for the human user. When the computer is taking 5 seconds to imitate thinking, the human user thread is paused for 5 seconds.
2) Disable input devices for 5 seconds using timer or dispatchertimer
3) Any better methods you can think of..
Thanks!
Edit - The question is about the how and now the why. 5 seconds is just an example. I prefer 1-2 seconds but for example purposes I just chose 5. So please focus on what is the best way to do this and not on the 5 seconds. Thanks again.
BBC outlines four cornerstones of computational thinking: decomposition, pattern recognition, abstraction, and algorithms.
The only language that the computer can process or execute is called machine language. It consists of only 0s and 1s in binary, that a computer can understand. In short, the computer only understands binary code, i.e 0s and 1s.
There are four key skills in computational thinking. These are decomposition, pattern recognition, pattern abstraction and algorithm design.
Noise and Blinking lights = digital thought.
Rev up the CPU to 100% with an infinite loop to generate heat.
Start looping through all the files to get the hard drive light blinking and making spinning noises.
Run a shell command to change directory to the optical drive to make the optical drive spin.
Set caps lock, numlock and scroll lock on and off, some keyboards have lights for that.
Check to see if your motherboard supports any additional blinking lights.
Ah! Good point. Many fans have API access, so turning the fans on to 100% is cool. The revert to normal could be dangerous though, because if you accidentally turn off the fans for good, it could be serious damage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With