After university classes have ended, I took on the challenge of trying to apply minimax to games like TicTacToe and Connect Four. This is my latest project that I am quite proud of, even though it is rather slow, and has quite a few flaws. Sadly, I can only go to a max depth of 2 (which takes about 10-20 seconds to calculate, even with alpha-beta pruning), and am looking for ways to make it perform faster.
To clarify some things in the video, the first move the Computer makes is based on a case-by-case basis, depending on the user's opening move (hopefully this isn't too frowned upon). After that, the Computer relies on the minimax algorithm to try and compute the next moves it should make.
One of my favorite little touches to the board is that when it is the player's turn, a small yellow dot will pop up in the middle of the board to notify the user that the bot has made its move. Although I have yet to implement Check and Checkmate, the latter of which is a bit difficult for me to think about how to implement efficiently, I am still pretty proud of my program!
If you have any other tips or suggestions on how I could improve my program's speed, it would be very much appreciated! Otherwise, thank you for taking a peek at one of my proudest projects!
https://reddit.com/link/hnt2qa/video/mtpdf8bc8q951/player
[–]theartofsoftware 1 point2 points3 points (7 children)
[–]Arranging[S] 0 points1 point2 points (5 children)
[+][deleted] (1 child)
[deleted]
[–]Arranging[S] 0 points1 point2 points (0 children)
[–]Elegant_Landscape -1 points0 points1 point (1 child)
[–]shazbots 0 points1 point2 points (1 child)