Results 1 to 5 of 5

Thread: Algo/Code help for tictactoe ai

Threaded View

  1. #4

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,372

    Re: Algo/Code help for tictactoe ai

    Does the logic now work as intended? If so, what don't you like?
    If you play corners, or the same thing over and over again, then it takes the same path.
    the integer values could be 0=empty, 1=X, 2=O
    I didn't think about that, I'm going to change to storing values as an int array.
    Select-Case statement to all those ElseIfs
    I don't usually do select/case's, simply because I rarely find a use for them in my usual(non game programming) code. But I do see where it'd be easier.
    By the way, what is the min/max algorithm?
    You can find it on wiki here, but simplified; It's an algorithm for 2 player games where player2's the best move/play is based on the play of player1. Pretty much think of it as an if/then statement. If I click on button1 then is button2,3,4 ect. my best move? And if I do choose, say button2, then what are the possibilities after that? Or another good example is to think of it as a tree, as shown here:
    Last edited by dday9; Jul 18th, 2012 at 09:58 PM. Reason: Getting that darn image to show correctly, geez!
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width