Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which method should I use to give the perception the computer is thinking in programming?

Tags:

c#

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.

like image 628
EverTheLearner Avatar asked Apr 20 '10 07:04

EverTheLearner


People also ask

What are the 4 computational thinking methods?

BBC outlines four cornerstones of computational thinking: decomposition, pattern recognition, abstraction, and algorithms.

What is used for the computer to understand a program?

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.

What are the key techniques used for computational thinking?

There are four key skills in computational thinking. These are decomposition, pattern recognition, pattern abstraction and algorithm design.


1 Answers

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.

like image 111
MatthewMartin Avatar answered Oct 12 '22 20:10

MatthewMartin