If you want to do something *really* cool, that will surely show how the AI is by far superior, develop 3D tic-tac-toe, or even checkers for it. Those games have more combinations, and thus after X games, the AI has a bigger advantage. Checkers shouldn't be too hard to develop (you can use the same tic tac toe diagram of which places are taken by what, only 8x8 in size), win happens when one player has no tokens, and when a square is taken, and the square beyond it is free, the AI may move to the square beyond it and "kill" a token. You have to allow them to move backwards for a solvable play, and you can program a "queen" (when a token reaches the end of the board) later. 3D-tic-tac-toe is even easier, you simply edit the tic-tac-toe for 3-dimensional lists, and change the combos. I'm safely assuming this would take about 4,000,000 games just to reach the state of absolute superiority for the AI, since there are more combinations.
Also - there's a chance of infinite game in checkers, although once you do program a queen, the chance is much lower (since the queen can move across the whole board). It will be slower to run, of course.
I believe after enough runs in this game you will reach a state where the AI wins every single time over the random player. I also believe, that it will require the AI less runs to reach such a state in checkers than it did for the tic-tac-toe AI, in relation to the number of possibilities. (i.e it will take it more, but less if you divide that number by the number of possibilities)
Also - you can try and adapt my Perl Hangman to the AI, this time not with 2 players, but an AI going against the number of failed guesses (trying to reach minimum). I wonder how will that work, since in hangman you basically guess letters. Giving preference to certain letters means at some point it will build a table of the most common letters in the english letters, and then you can completely throw it off by giving it Xzxyqv for example. :)
I'll try working on Checkers for perl, then see if I can place it in your code, or just give it to you if you want.
A list of combination for 3D tic-tac-toe
each of the regular tic tac toe combos, on each plane (z=0,1,2): [(0,1),(1,1),(2,1)] [(x,0)(x,1)(x,2)] types each of the regular tic toe combos, with each of the parts of the comb +o, on serial planes (0,1,2 or 2,1,0): [(0,0),(1,1),(2,2)]

I hope you understood me in spite of my lackluster english. Other than that, amazing work, of course I ++'ed it, and the guy who did it for connect 4 - you too.

-Nimster

In reply to Re: A simple game AI that learns by Nimster
in thread A simple game AI that learns by Falkkin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.