Nim is a well-known game with a number of variants.

We will consider the following variant, which has an interesting winning strategy.

The player must take of the marbles. Then the other player takes a turn.

The player who takes the last marble loses.

You will write a program in which a computer plays agains a human opponent:

In your game the computer should move first.

Computer moves should be legal, but random.