The “play autonomously” button causes it to start playing against itself and continue learning – it swaps side every hundred games and will The “reset stats” button clears the score board below the buttons. The “clear” button clears the board and resets the game. It doesn’t even know that the aim is to get three in a row.Īll the AI algorithm knows is that X and O make alternate moves and that a square can only contain an X or an O or be emtpy. It contains no code telling it what good or bad moves are and the AI algorithm knows nothing about the rules of the game – it’s simply told what the outcome of each move is (unfinished, won, drawn, lost). Here is the result, which you can play against interactively by clicking on the board or buttons. So with my limited knowledge I went about iteratively designing an algorithm to “learn” to play. It didn’t take long before I was trying to understand Q-learning and failing fast by getting lost in the maths. He suggested reinforcement learning and a few days later I started reading about it. I knew nothing about machine learning, so I spent a bit of time learning about neural networks but didn’t get very far and convinced myself that neural networks wouldn’t work and I put the project to the back of my mind.Ī few months ago at a Christmas party, I bumped into an acquaintance, JP, and I ended up telling him about my goal. I wanted the algorithm to “learn” how to play, by playing against itself. I didn’t want to tell the algorithm what the rules of the game are, nor did I want it to try and use some kind of calculation to look ahead at possible moves which might lead to a win from the current state of the board. About a year ago I set myself the goal of writing an algorithm that could learn to play tic-tac-toe.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |