paolozanchi / tic-tac-toe

Tic-tac-toe AI implementation in Vue.js, using Minmax algorithm with Alpha-Beta pruning.
https://vuetictactoe.netlify.app/
0 stars 0 forks source link

Doesn't go for a win #6

Open paolozanchi opened 1 year ago

paolozanchi commented 1 year ago

Sometimes my boy is too generous and doesn't go for an instant win.

paolozanchi commented 1 year ago

A few things you could check:

Check if the MINIMAXDEPTH value is set correctly, it should be high enough to find the winning move but not too high as it will increase the execution time. The function is using the random move on the first turn, if the first move is in a key position it could make the game easier for the AI, you could try to change