Trying Out SyntaxHighlighter

Comments

This is just a test post to see if I’m smart enough to add the javascript SyntaxHighlighter to my blog. ;)

public int ScoreDice(int[] selectedDice)
{
    int score = 0;

    foreach (IScoringCombo scoreCombo in ScoringCombos)
    {
        IEnumerable<int> satisfyingIndices = scoreCombo.SatisfiedBy(selectedDice);

        if (satisfyingIndices.Count() > 0)
        {
            score += scoreCombo.ScoreDice(selectedDice);

            // Remove the dice at satisfyingIndices from selectedDice collection so not double-scored
            selectedDice = selectedDice
                .Select((value, index) => index)
                .Except(satisfyingIndices)
                .ToArray();
        }
    }

    return score;
}