I coded a tic tac toe program, but I don't know if I can call it artificial intelligence.

Here's what I did.

There is a random player, which always makes random valid moves.

And then there is the AI player, which will receive input before every move, that input is the state of the board, and all the posibilities. The AI, will try any move that it hasn't tried before. But if it knows every possibility, it will select the one that has the higher value. This value is assigned by the outcome of the match, if the match was won ,+1, 0 for draw, -1 for lose. Every move, will be stored in a database, or updated if it's known.

Eventually it will know every possible move.

I also added a threshold to compare the best moves, so it really select the best move. Example, two moves with a value of 100, the AI will keep trying them both, randomly until one has surpased the other by the threshold, say 50.

It takes about 20.000 games to make the AI perfect, it never loses a game, just draws and wins.

I'm new to AI, and I'm wondering, could this be really considered Artificial Intelligence? And how is this different from a Neural Network approach? (I'm been reading about it, but I still don't quite get it.)


1 Answer 1


This is basically reinforcement learning. The state space contains your moves, and the value function are the value you store at the end. And your rewards are the end results. And you have episodic game. It is an AI method. Consider looking at value iteration, policy iteration, SARSA, Q-learning. The difference between neural network method and yours is you are not doing function approximation with neural network for the value function, you are doing tabular method.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .