Information Technology Reference
In-Depth Information
define pause-counter integer( 8)
pause-counter = 0
perform pause-loop until pause-counter = 10000000
where the procedure
pause-loop
would be
pause-loop: pause-counter = pause-counter + 1
which involves ten million additions. You could put these few lines in your program and
then time the delay. If it still wasn't enough or if it was longer than 10 seconds, you could
change it accordingly by modifying the number of the additions. Another possibility is to
add the keyword
blink ,
which results in the message blinking.
Any of these choices has the possibility of problems - mostly the person keying
data not paying attention or falling asleep from too big a lunch. People from outside
organizations may be upset if somehow an electric shock is set up to be transmitted to the
person keying data, so that's not an option. If the error message is being sent from a
called program, it's a better idea to just transmit some value for a variable - as we did
here - to eventually get some error message on the screen of the calling program. As you
can guess, I'm not about to use the
pause
keyword since the approach of clearing the error message after the data is entered through
the
input
keyword is a better idea.
Up until now, instruction was provided to accomplish certain results. Heuristic
learning is another method of education that involves learning by making mistakes. Doing
things the proper way may be fine until someone flounders and does it incorrectly. Had he
done it wrong to begin with, he would only have made the mistake once. A computer can
utilize this method to program the game of chess. I'm glad I don't have to do it, but each
series of moves - by both the computer and its opponent - is filed and when a move
results in a defeat of the computer, the exact sequence is noted and the losing move is
never repeated. This happens for every game. You can see that eventually , the computer
won't lose. Please note the word in italics - it might take a long, long time.
The way chess and Jeopardy are computer programmed is done by methods that
involve specific strategies. This means the system will work in the programmer's
lifetime, even if the computer loses every so often. What this boils down to is when you
play against the computer, you're rally tangling with the person who designed the
strategy. Naturally, that person has the advantage of numerous calculations done for him
by a machine that a human just couldn't manage so quickly. The strategies involve
looking ahead a few moves and proceeding from there.
I programmed two mind games - you may have heard of both - but I'm not sure
what language either was in. That's not important. The first was JOTTO, a word game
Search WWH ::




Custom Search