![]() The board evaluation function evolves naturally.Use a 2D array to make a Tic Tac Toe game - and practice using conditionals, loops, and functions! Then, after tournament rounds, new neural networks are created (through genetic algorithm) from the winners and losers are eliminated. Now the idea is to feed board positions into neural networks, which do the board evaluations, and let them play according to the technique I described above, tournament style. Coming up with a good board evaluation function can be tricky, and the one I described misses some obvious details.Īnother thing to try is to use a genetic algorithm and neural networks to evolve the board evaluation function. That board eval function is only an example. The idea is that if you can't search all the way down the tree, you search as far as you can with the minimax technique, confident that you're working your way toward a strong position. One way to win is to get four in a row prior to that, so if X has four in a row, that might be worth 4, and if O has four in a row, that might be worth -4. So, as a guess, we know five in a row wins, so assign X wins as +5 and O wins as -5. ![]() ![]() The idea is that you, as a human, might have some ideas about what strong and weak positions are. The next most obvious thing to me would be to change the board evaluation function and search only as deep in the tree as is feasible for your time constraints. If not, that's still a good starting point. How to code simple AI for a windows phone board game? Oddly enough, I just wrote a description of the general technique last night, for this question: 5x5 Tic-Tac-Toe might still be small enough to solve directly, depending on your time constraints, if you're clever about the board symmetries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |