AI in delphi

I have a task to make a game (Tic Tac Toe) and i want to do that in delphi but i don't know how to implementing AI in delphi :( does anyone can help me to solve my problem?
Thanx for your help :)

Comments

  • : I have a task to make a game (Tic Tac Toe) and i want to do that in delphi but i don't know how to implementing AI in delphi :( does anyone can help me to solve my problem?
    : Thanx for your help :)
    :

    Programming AI in Delphi probably isn't much different than doing it in another language like c or Java.

    Anyway, for tic tac toe, the computer is trying to win the game so have it compare the posible winning lines for itself and the user. This includes 2 diagonals, 3 vertical and 3 horizontal. If the user has 2 in a line, the computer should block the 3rd place. If not, just have the computer compare options. Cancel the impossible lines(lines with 1 or more of the user's letters in it) from the comparison. Compare for the most complete possible line (ie. 2 in one of the possible lines). The computer should try to complete that line to win the game.

    Just think of each step you take when you play the game. After you figure that out, turn it into code.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion