minimaxarticle icon indicating copy to clipboard operation
minimaxarticle copied to clipboard

Incorrect output for certain inputs.

Open Legend-of-iPhoenix opened this issue 6 years ago • 1 comments

Your code gives the incorrect output for the following input:

X |   |  
---------
X |   | O
---------
  | O |  

If I get the best move for the computer (X), it lists spot 1, which is incorrect (it's obviously spot 6, to win). It does give the correct output for the human player (spot 6, to block the computer), though.

Here's my "origBoard" input. it follows the format you specified in the article and in the code itself. var origBoard = ["X",1, 2,"X",4 ,"O", 6 ,"O",8];

I'm running Chrome 70 on MacOS.

Legend-of-iPhoenix avatar Dec 03 '18 23:12 Legend-of-iPhoenix

so, did u find the fix? thx in advance

vital1312 avatar Apr 21 '20 16:04 vital1312