How to Create a TIC TAC TOE Bot in Python | Beginner Tutorial (Minimax Algorithm) | Part 2
Vložit
- čas přidán 6. 09. 2024
- Learn how to create a Tic Tac Toe bot in python. Hey everybody welcome to part 2 of this python series. Today we implement the minimax algorithm for tic tac toe in just a short amount of code. The link the the full project is below. Let me know what you guys think of the video and any other future suggestions you might have!
Completed file: github.com/wat...
Article I talked about in video: levelup.gitcon...
Subscribe: www.youtube.co...
On this channel we focus on all things Python. Whether it is a project tutorial/showcase, teaching different Python concepts, or just live coding this is one of the best channels for programmers. Check out my links down below and think about supporting me on Patreon👇
Links:
Patreon: / codecoach
Github: github.com/wat...
Thanks for making this! It works perfectly. I am a beginner and I do not understand everything in this Video so MiniMax feels like a magical black box for me that just gives perfect answers but it works and I managed to implement it into my program. Thanks a lot!
Hey thanks for the video. I have a question. what if I want the number 1-9 to be display on the board and change to X/O only after a number is entered. How do I do that?
Is there an algorithm that allows the player to win randomly? However enjoyed your video and it was really helpful
12:50 why the computer doesn't go straight for win?
This is a great video! One question, how do we know the depth for minmax needs? In this case, we peek two step ahead?
Great video. Everything is understandeble and i like it
What if I don’t want the bot to beat the player?
This would be a little more tricky you would have to make several changes to the code. I would probably modify how the points were calculated in the minimax function and before the bot makes a move i would pick a random move from the range of some value so the bot does not make the best possible move every time. I hope that made a little sense - I will look into it!
Hey Nate, check out this video:
czcams.com/video/BfmivoVFins/video.html&ab_channel=ZeSardine
he created a more advanced version of this game but the rational he used for attempt 2 at 7:30 would be how you implement a medium difficulty bot. You would have to evaluate each position on the board based on the conditions he gives in the video. Hope this helps!
I always get a recursionError pls help
Thanks for the video. I use to read subtitles, and sometimes you code on the bottom of the screen, and that makes me not able to see the code clearly :/ But really thanks for the amazing explanation