/// <summary>
 /// Plays a single game and dumps the results
 /// </summary>
 /// <param name="white">The white (first) player</param>
 /// <param name="black">The black (second) player</param>
 /// <param name="dump">A text writer to act as a dump</param>
 /// <returns>The winner (Disc.Empty if draw)</returns>
 public static Disc PlayGame(IReversiPlayer white, IReversiPlayer black,
     TextWriter dump = null)
 {
     if(dump == null)
         dump = Console.Out;
     dump.WriteLine("{0},{1}#", white.GetName(), black.GetName());
     ReversiGame game = new ReversiGame();
     dump.WriteLine(game.board.AsString() + "$");
     game.currentPlayer = Disc.White;
     int passes = 0;
     while (passes < 2)
     {
         if (ValidMoves(game.board, game.currentPlayer).Count == 0)
         {
             passes++;
             game.currentPlayer = game.currentPlayer.Reversed();
         }
         else
             try
             {
                 Program.RunActionWithTimeout(
                   () =>
                     game.PlaySingleTurn(
                     game.currentPlayer == Disc.White ? white : black),
                   MOVE_TIMEOUT);
                 passes = 0;
             }
             catch (Exception e)
             {
                 dump.WriteLine(e);
                 dump.WriteLine(e.StackTrace);
                 return game.currentPlayer.Reversed();
             }
         dump.WriteLine(game.board.AsString() + "$");
     }
     int score = Score(game.board, Disc.White);
     if (score > 0)
         return Disc.White;
     if (score < 0)
         return Disc.Black;
     return Disc.Empty;
 }
 /// <summary>
 /// Adds a player to the simulation
 /// </summary>
 /// <param name="player">An IReversiPlayer object</param>
 public void AddPlayer(IReversiPlayer player)
 {
     players.Add(player);
 }
 /// <summary>
 /// Playes a single game turn
 /// </summary>
 /// <param name="player">The player object</param>
 public void PlaySingleTurn(IReversiPlayer player)
 {
     Point point = player.NextMove((Disc[,])board.Clone(), currentPlayer);
     board = PlayTurn(board, point, currentPlayer);
     currentPlayer = currentPlayer.Reversed();
 }