Tic-Tac-Toe AI: How to Make the Tree?

前端 未结 5 1280
Happy的楠姐
Happy的楠姐 2021-02-01 08:11

I\'m having a huge block trying to understand \"trees\" while making a Tic-Tac-Toe bot. I understand the concept, but I can\'t figure out to implement them.

Can someone

5条回答
  •  余生分开走
    2021-02-01 08:49

    Implementing the Tic Tac Toe game is probably the simplest problem to solve in terms of AI and search space.

    The key is to approach the problem with Minimax, Iterative deepening Depth-first search and Alpha-beta pruning algorithms.

    Here's my implementation of the game in Python, which is only ~200 lines of code and has the capability to play a game as Human vs. Human, Human vs. Computer, and Computer vs. Computer. It also keeps the statistics on depths and number of nodes reached/pruned leading up to the best move.

    I highly recommend edX.org Artificial Intelligence course, which gives the the fundamental knowledge on current AI topics and solutions.

提交回复
热议问题