Hah, LISP would be a great way to program that.
One really lengthy way of doing it would be to figure out all the countermoves the computer should make depending on where the human player places a piece. That's really all Big Blue was. It thought out millions of move possibilities in advance and then selected the best from a list.