Рет қаралды 795,048
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: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous video: • Coding Challenge #153:...
🎥 Next video: • Coding Challenge #155:...
🎥 All videos: • Coding Challenges
References:
🔗 Geeks for Geeks - Minimax Algorithm in Game Theory: www.geeksforgeeks.org/minimax...
📚 Minimax on Wikipedia: en.wikipedia.org/wiki/Minimax
Videos:
🏗 Algorithms Explained - minimax and alpha-beta pruning: • Algorithms Explained -...
🔴 Livestream Archive: • Coding Train Live 188:...
Related Coding Challenges:
🚂 #94 2048 Sliding Puzzle Game: • Coding Challenge #94: ...
🚂 #149 Tic Tac Toe: • Tic Tac Toe in p5.js (...
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: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: / discord
💖 Membership: kzbin.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#beginners #tictactoe #minimaxalgorithm #games #p5js #javascript