Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in AI and Deep Learning by (50.2k points)

I'm very interested in the field of machine learning and recently I got the idea for a project for the next few weeks. 

Basically, I want to create an AI that can beat every human at Tic Tac Toe. The algorithm must be scalable for every n*n board size, and maybe even for other dimensions (for a 3D analog of the game, for example). 

Also, I don't want the algorithm to know anything about the game in advance: it must learn on its own. So no hardcoded ifs, and no supervised learning. 

My idea is to use an Artificial Neural Network for the main algorithm itself and to train it through the use of a genetic algorithm. So I have to code only the rules of the game, and then each population, battling with itself, should learn from scratch. 

It's a big project, and I'm not an expert in this field, but I hope, with such an objective, to learn lots of things.

First of all, is that possible? I mean, is it possible to reach a good result within a reasonable amount of time?

Are there good libraries in Python that I can use for this project? And is Python a suitable language for this kind of project?

1 Answer

0 votes
by (108k points)

Yes, it is possible to reach a good result in a fair amount of time. tic-tac-toe is a zero-sum game, so it might not be the best choice of game for what you're trying to accomplish. Tic-tac-toe will always end in a tie if both sides know what they are doing. You have to tell your AI the rules of the game, beforehand. 

Here is a Python-based Program implementation of Machine Learning for the Game Tic Tac Toe (3x3) using Reinforcement Learning (Q learning technique) and TensorFlow:

Browse Categories