Tic Tac Toe, FreeCodeCamp YouTube Video

Hello there,
This may have been pointed out already and/or I may be missing something, but it seems like there’s something wrong with the minimax algorithm in the youtube video put up a few weeks ago to the FreeCodeCamp channel.

At this point in the video, the lecturer has finished writing the application and does a few tests.
However, in the first test he actually beats the AI, but the UI displays the “Tie Game!” .

I have followed along with the code and can reproduce the bug with my own files.

Have a great day!

So do you know the fix? My version doesn’t loose. :wink: