コード例 #1
0
    private static List <BingoCard> ParseCards(IEnumerable <string> game)
    {
        var lines = new List <string>();
        var cards = new List <BingoCard>();

        foreach (string line in game.Skip(2))
        {
            if (string.IsNullOrEmpty(line))
            {
                cards.Add(BingoCard.Create(lines));
                lines.Clear();
                continue;
            }

            lines.Add(line);
        }

        cards.Add(BingoCard.Create(lines));

        return(cards);
    }