New answers tagged

0

tl:dr; Read the first and very last paragraph With this approach, your AI will likely attempt to always use the optimal strategy, but the way you code it can easily lead to abuse. So, when considering how to evaluate "the best state for the AI" keep these examples in mind: Example 1: (the problem you currently see) Player team is full of extremely high ...


1

For such problem I'd rather go for a Montecarlo algorithm. For each possible move make N random plays and count the number of computer wins. Let the computer do the move with the higher number of wins. N should be sufficiently large. The larger that number, the strongest the computer will be Doing this way the computer will force the game into the ''path'' ...


2

I don't have a complete answer for you, just a few lines of thought... 1) Construct a dependency graph As you consider each move each token can make, store a reference to that move with each cell it passes through. When a later move ends in one of the marked cells, we've identified a potential new dependency: performing move B before move A can change the ...


1

I would start from the end positions, because this is what matters. There are 2 tokens and 21 blank squares in your example, which means that in the worst case (all ordered pairs of squares represent reachable outcomes) there are 420 valid outcomes. Check each of these possible outcomes to look for one valid way of reaching it, once you find one way of ...



Top 50 recent answers are included