Howdy, Stranger!

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

Categories

AI in delphi

BogelBogel Member Posts: 15
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

  • Josh CodeJosh Code Member Posts: 675
    : 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.
  • Justin BibJustin Bib USAMember Posts: 0

    _ { http://forcoder.org } free ebooks and video tutorials about < C C++ C# Assembly PL/SQL Visual Basic .NET PHP Java R Python MATLAB Swift Objective-C JavaScript Delphi Visual Basic Go Perl Scratch Ruby Lisp FoxPro VBScript Scheme Alice Dart F# Scala Kotlin SAS Julia Erlang Logo Awk Rust Ada Crystal COBOL ML Bash Transact-SQL ABAP Lua LabVIEW Fortran Hack Apex Prolog Clojure D /> _______

Sign In or Register to comment.