"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 14 Apr 2008 00:13:56 -0700, v4vijayakumar wrote: > >> In computer based, two player, board games, how to make computer play? >> Are there any formal ways to _teach_ computer, to choose best possible >> move? > > That depends on the type of the game. For a certain class of games one > can use the `minimax method`_ for instance. > > .. _minimax method: http://en.wikipedia.org/wiki/Minimax
While checking the Wikipedia, also check out the A* (a-star) graph search algorithms: http://en.wikipedia.org/wiki/A%2A There is a table on the top-right of this page that includes other graph search algorithms. My AI games are usually built around general purpose mini-max code, possibly inplementing A* (I reuse the same code for various games). For each new two-player game, I usually only have to write new "position evaluator" code, which generates a quantitative value that gives the relative position of one player over the other for a particular board. Some games can benefit from a database of opening moves that have been shown to be be superior (this speeds up the computer's response). Carl G. -- http://mail.python.org/mailman/listinfo/python-list