Strategy

Principles

Game strategy is based on evaluating game situation. There are "winning" situations. If you find game in winning situation, regardless of your stroke you do not let it in winning situation. On the other hand if you do not find it in winning situation, you can find a stroke to put it in winning situation, and your opponent will only be able to let it in not winning situation, and if you do not do errors after you are sure to win.

The choice of player who begins is very important. With the default options, beginning situation is winning, and the player who begins may only win if his opponent do a mistake (and if you play against automate and choose to begin you cannot win because automate will not do mistakes!).

On the other hand you can by the preferences change the initial state in order that it will be a not winning situation. Then the beginner have an advantage since he can put game in winning situation.

States

We will distinguish three states:

- finishing state, where there are at more one match in each row,

- pre-finishing state where only one row is more than one match,

- usual state in all other cases.

The game begins in usual state (unless you have put very particular preferences), and according to the parties you may meet or not meet other states at end of the game

Situation evaluation

If you think be able to use binary algebra, you may use a binary algebra based method in order to evaluate the situation and research best stroke.

However there are other simpler techniques to learn and which require only knowledge of the basic operations (addition, subtraction, multiplication, division).

We introduce two concepts: the even numbers (multiples of 2: 2, 4, 6 ...) and odd numbers (the other numbers: 1, 3, 5 ...), and the integer division, a division of two integers where we only keep the integer part of the quotient (eg integer division by 5 by 2 gives 2).

We calculate three sums:

- S1 sum of all matches,

- S2 sum of two integer division by 2 of the number of matches in each row,

- S3 sum of the integer division by 4 of the number of matches in each row.

In all cases, except in pre-finishing and finishing states when you have chosen the default option that the player which picks the last match is the loser, the situation is winning if S1, S2 and S3 are even.

For pre-finishing and finishing states, see the special paragraph.

Note that only sums parity is needed, and you can often know this parity without doing all additions.

Best stroke research

If you have found the game in a winning situation, you will leave in a non-winning situation, and your only hope is that your opponent makes a mistake, try to put the game in an unusual situation for him ...

If you have found the game in a non-winning situation who is not finishing or pre-finishing state (see later), the best stroke is a stroke that puts again even S1, S2 and S3. This will require that the stroke changes the odd sums while keeping even the sums that were already. This will depend on sums that was odd.

It would be too long to detail all cases, but here are some examples:

- If only S1 is odd, remove a match in a row with an odd number of matches (there may be one or three)

- If S1 and S2 but not S3 are odd, you can remove three matches in a row with an odd number of matches unless it has five matches, or remove a match in a row with an even number of matches unless it has four matches.

You will be able to find in all cases one or several solutions, and choose between the solutions if there are several.

Case of pre-finishing or finishing states

If you find the game in one of these states, you must adopt a particular algorithm if you have the option that the one who picks the last loses. With the other option you can continue to adopt the standard algorithm, but also take a simpler algorithm.

In the option that the one who picks the last loses, a winning situation in the finishing state is a situation where there is an odd number of rows with one match. If you find the game in the pre-finishing state, your stroke must bring it to the finishing state with an odd number of rows with one match. Following the case you have to remove all or all but one matches in the single row with more than one match. Then there will be only rows with one match and the only possible strokes will be to reset a row.

In the option that the one who picks the last win, a winning situation in the finishing state is a situation where there is an even number of rows with one match. If you find the game in the pre-finishing state, you have to do as above but to leave an even number of rows with one match.