Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-28 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found