Esempio n. 1
0
    // Assuming this board is the winning one, get the score.
    public int GetScore()
    {
        var currentDrawn       = DrawnNumbers.Take(VictoryTurn);
        var unmarkedNumbersSum = Matrix.SelectMany(i => i).Where(i => !currentDrawn.Contains(i)).Sum();

        return(unmarkedNumbersSum * currentDrawn.Last());
    }
Esempio n. 2
0
 private void InitializeVictoryTurn()
 {
     // Start at 5.
     for (int i = 5; i < DrawnNumbers.Count; i++)
     {
         var currentDrawn = DrawnNumbers.Take(i);
         foreach (var line in Lines)
         {
             if (line.All(x => currentDrawn.Contains(x)))
             {
                 VictoryTurn = i;
                 return;
             }
         }
     }
 }