beaucarnes / fcc-project-tutorials

freeCodeCamp video project tutorials.
293 stars 416 forks source link

Strange behavior of minimax in TTT #11

Open Apache02 opened 6 years ago

Apache02 commented 6 years ago
O = minimax

1       2       3       4       5       6       7       8
_|_|_   _|_|_   _|_|_   _|_|_   _|X|_   O|X|_   O|X|X   O|X|X
_|_|_   _|O|_   _|O|_   _|O|_   _|O|_   _|O|_   _|O|_   O|O|_
_|_|X   _|_|X   _|X|X   O|X|X   O|X|X   O|X|X   O|X|X   O|X|X

On the step 5 mimimax can win right NOW, but chose long 100% win way.

beaucarnes commented 6 years ago

Yes, this is a mistake in the code. Check out the code here for the fix: https://github.com/beaucarnes/fcc-project-tutorials/tree/master/tictactoe/improvements