Minimax Algorithm for Tic Tac Toe (Coding Challenge 154)

Veröffentlicht am: 11 Dezember 2019
auf dem Kanal: The Coding Train
811,253
15k

In this challenge I take the Tic Tac Toe game from coding challenge #149 and add an AI opponent for a human player by implenenting the Minimax algorithm. Code: https://thecodingtrain.com/challenges...

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s...

🎥 Previous video:    • Coding Challenge #153: Interactive Dr...  
🎥 Next video:    • Coding Challenge #155: Kaleidoscope S...  
🎥 All videos:    • Coding Challenges  

References:
🔗 Geeks for Geeks - Minimax Algorithm in Game Theory: https://www.geeksforgeeks.org/minimax...
📚 Minimax on Wikipedia: https://en.wikipedia.org/wiki/Minimax

Videos:
🏗 Algorithms Explained - minimax and alpha-beta pruning:    • Algorithms Explained – minimax and al...  
🔴 Livestream Archive:    • Coding Train Live 188:  Tic Tac Toe A...  

Related Coding Challenges:
🚂 #94 2048 Sliding Puzzle Game:    • Coding Challenge #94: 2048 - Part 1  
🚂 #149 Tic Tac Toe:    • Tic Tac Toe in p5.js (Coding Challeng...  

Timestamps:
0:00 Introduction to the challenge
2:17 Explanation of the Minimax algorithm
8:20 Start Coding
12:54 Check to see if anybody won
14:16 Recursively check the max score for all the spots (AI)
16:51 Recursively check the min score for all the spots (Human)
18:15 Refactor using min() and max()
19:05 Fix bugs
21:13 Final output
22:46 Ideas and Suggestions

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord:   / discord  
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#beginners #tictactoe #minimaxalgorithm #games #p5js #javascript


Auf dieser Seite können Sie das Online-Video Minimax Algorithm for Tic Tac Toe (Coding Challenge 154) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer The Coding Train 11 Dezember 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 811,253 Mal angesehen und es wurde von 15 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!