Simple Strategy for Pearls before Swine | Transcience.com.au

  • Thread starter Thread starter BicycleTree
  • Start date Start date
AI Thread Summary
The discussion focuses on strategies for a game similar to Nim, emphasizing that a simple winning strategy exists, particularly for two piles. The key is to equalize the sizes of the piles when going first and then mimic the opponent's moves to secure a win. For three piles, the strategy becomes more complex, with the goal being to avoid ending up with two equal-sized rows while pushing the opponent to finish a third row. Participants mention the challenge of computing optimal moves efficiently, noting that their algorithms can be inefficient and slow. The conversation also touches on the importance of proving the effectiveness of the strategy, with some users sharing personal experiences of progressing through levels and the pitfalls of making mistakes during gameplay. Overall, the strategies discussed highlight the similarities to Nim, particularly in the context of winning by taking the last pearl.
BicycleTree
Messages
518
Reaction score
0
Physics news on Phys.org
there is a strategy. if there are 2 piles (rows whatever) then if you go first you must take out of the larger pile to make them the same size. then whatever you opponent does, just copy him. that way you win. I am not sure about 3 piles, but i imagine its similar.
 
in three piles i haven't come up with a strategy yet but the idea i think is to make sure you don't end up with two rows with equal size... in fact you want him to end the third row while the other two have different sizes.
 
That's not a simple strategy. For Nim there is a simple way to win no matter how many rows there are. There must be some way to speed the computation because I just wrote a Java program to find the right move and although it works, it's taking forever on this problem (rows with 5, 7, and 11). Whereas Juan in the game can move very quickly. Of course my algorithm is very inefficient and recursive, needlessly re-calculating positions many (probably millions, in this case) of times.
 
Last edited:
Confim: There Is a simple strategy and it's a lot like the strategy for Nim. I just got to level 11, 10-2 my favor since I made a couple mistakes at the beginning. Now this is a real brain teaser. (fair to use Google to find the strategy for normal nim)

Further brain teaser (that I haven't solved): How do you prove that the strategy works?
 
You can beat it really easy... just open 2 games up... have one start first, then after he has started, you follow behind doing the exact same thing on the other one... and at the end, you will win... Oh, wait... that don't work for the 3ed version... anyway... on 1 and 2 it does... oh, too bad...
 
Last edited:
The strategy for Nim where you have win if you take the last pearl is very similar.
In fact, you can use the exact same strategy and only change your moves at the end when you can clearly see what the right move is. I got me to level 23, then made a stupid mistake by trying to take back a move by rewinding the flash applet. Then it crashed.
 
Yup! That's the strategy.
 

Similar threads

Replies
7
Views
4K
Replies
9
Views
4K
Replies
10
Views
3K
Replies
5
Views
2K
Replies
2
Views
2K
Replies
2
Views
2K
Back
Top