It's possible to win the game as described by the rules, but it's been programmed to cheat if beaten.
After thinking about it, I've discovered that a good player can guarantee himself a win if he leaves his opponent with three rows of pearls such that there is one row of three pearls, one row of two pearls, and one row of a single pearl. It's a bit much to write it all down but if you think through all of the possible plays at this point, you'll see that it's true.
Anyway, I've gotten the computer opponent into just such a situation, but at this point he cheats and skips a turn.
I played around with the game some more. Several times I've forced the computer opponent into the situation described above, and each time he cheated by skipping a turn, as I've stated above.
After several games, however, he once went ahead and made a move. I'm not sure what accounts for the difference. The computer opponent's moves seem to be somewhat random — there's logic behind them but you can't predict exactly what he'll do in a given situation.
Anyway, as I said, I left the opponent with three rows of one, two, and three. He removed one pearl from the row of three. I then removed the single pearl, leaving the opponent with two rows of two pearls each. He removed one pearl from one of these rows. I then removed both pearls from the other row, leaving him with the final pearl.
When you win, the computer opponent's eyes bug out. He growls angrily at you and then slowly walks away into the background,
at which point you're taken back to the main transience.com.au page.
I've found a few scenarios which guarantee a loss (or win, depends on who you're rooting for). I still haven't figured out a strategy from the start. I just have to watch for possible steps to get the guy into the losing scenarios I've discovered. I guess that's kinda like chess, but I really feel like there has to be a strategy from the beginning of this game.
Let him go first, and he might take 5 from the bottom row (He removes 5/6). If he does this then take away the top row (remove 3/3).
You automatically win at this point if you play wisely. He ends up removing one pearl out of the row of 4. Then you remove 3 pearls from the row of 5 leaving him with the 3-2-1 kill as Carl explained.
I'm a math nerd, but if you want to kick his ass the first time and every time look up nim and the word binary in a search. You might even learn something about binary numbers.Take each row and represent it in binary form an then add them up vertically like 101 100 001 results in 202. As long as you keep the numbers divisible by 2 like 222, not 121 or 110, you will win
I must be especially retarded today because I can't get this logic to work when comparing a couple simple cases:
Case 1: x x x It my opponent's turn. There are 3 rows with one ball in each row. This would add up to 3, an odd number which, according to the Nim logic, should guarantee a loss for me. Just counting the only possible turns proves that my opponent will take one, then I will take one, and then my opponent will take the last one, thereby losing.
Now, before I read the Nim logic, I was making a list of scenarios that I discovered were sure losses (if you ended up with one of these scenarios on your turn, you would lose). Let's cover a simple case, but make it so the opponent will lose. Case 2: xx xx His turn. Two rows of two balls adds up to 20. This is an even number and Nim logic states that I will win by giving my opponent this scenario. If you run down the possible moves, you'll see that it's true--I am guaranteed a win in this situation. If he takes one, I'll take the remaining row of two, leaving him with last one. If he takes a row of two, I'll take one, leaving him with the last one.
So what am I missing here? Two cases, one odd and one even, that both result in wins.
If you think about how the binary numbers work, the strategy of the nim sum is to control the board until you are ready to make your move. If you have an even nim sum any move you make will automatically result in an odd nim sum. The point of the Nim-sum strategy is to leave the board in an even-sum state. However, if you think about the fact that leaving the final sphere for the opponent is an odd sum, the point of the game and the strategy are direct opposites. The point of the strategy is to control the board until you are ready to flip it on the other guy. That's why the game blows b/c you can always win if you know what you're doing. Say you have a 3,2,1 combination. No matter what you remove you end up in an odd sum. However if you had 6,5,4 combination, you could easily go from that to 5,5,4 and still be in an odd nim sum state.
Even is referred to as a win, safe, balanced etc. Odd is loss, unsafe, unbalanced etc. Hope that helps. The games inherently flawed b/c the starter can insure victory. Hope that helps.