Creating game playing computer programs.

Two player board-game playing programs typically work as follows:
(i) Assume that the opponent is very good. i.e. he will respond with the best possible move.
(ii) Design an evaluation function on the board. The evaluation function will take as input a board position and return a score indicating how good that board situation is for the player whose turn it is. e.g. a very naive evaluation function for a chess board would be [no of my pieces] - [no. of opponents pieces]
(iii) Now given a board situation, we decide which move to make as follows:
List out all the possible legal moves. (This depends on the rules of the game.) Then apply the evaluation function on each resulting board state and select the move which gives the minimum score. This does not work very well because it is difficult to design very good evaluation functions. Therefore, we actually look ahead a few moves: I make a move, the opponent will respond with the best move he has, i will then respond with the best move i have, .. and so on. Now select the move move which gives me the best score after a few levels of such lookahead.
Thats essentially all that there is to game programming!
A brief history of computer game programs can be found here. A link to a possibly useful library for such games and some other assorted links are given below.

Game Programming Methods

General Information on Computer Games

Individual Game Programs

Computer Game Tournaments and Matches

Computer Game Researchers