Use minimax to make a Python program that plays Nim against a human opponent.
Actually it should have two modes of play, one in which it plays against a
human and the other in which it plays against itself.

Rules of Nim.
  There are exactly two players.
  There are a number of piles of sticks.
  The number of piles of sticks is at least one, but has no upper limit.
  Each pile can have any positive number (including zero) of sticks.
  Players take turns until the end of the game.
  At a player's turn they must take sticks from one and only one pile.
  The number of sticks taken can be anything from one to all of them.
  No saying "pass", at your turn you must take at least one stick.
  The game is over when all the piles are empty.
  The player who empties the last pile loses the game.
  The player who doesn't lose the game is the winner.

Beware! If you have a large number of piles, or piles with a large number
of sticks there will be a large number of possible actions at each turn
and a large number of possible turns before the end of the game. That means
that minimax would take a long time.

The game's original form was less flexible: there are always four piles
at the start and they have 1, 3, 5, and 7 sticks each. Starting with that
configuration should speed things up enough that debugging is easy to do.

There is a strategy for winning which is always successful for the player
who moves second in the game's original form. Write the pile sizes in binary
(padding with zeros so the numbers are all the same length) then exclusive-or
those numbers together. Here is the starting configuration

      1: 001
      3: 011
      5: 101
      7: 111
    --------
    xor: 000

If your move leaves the exclusive or at zero, there is no possible move for
your opponent that will keep it at zero. You lose by making all the piles
empty, which would have an exclusive or of zero. Therefore if you leave the
exclusive or at zero, your opponent can not make a losing move.

Obviously the computer is not allowed to use that strategy to play, it is
required to use minimax. But if you have a lot of sticks in the game, you
can still make it playable by making minimax stop at a certain recursive
depth and giving a score for the unfinished game position based on that
strategy. That would get some extra credit.