Beispiel #1
0
    public BingoCard(string board)
    {
        var boardItems = board
                         .Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
                         .Select(s => s.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
                                 .Select(int.Parse)
                                 .ToArray())
                         .ToArray();

        Rows    = boardItems;
        Columns = new int[5][];
        for (int i = 0; i < 5; i++)
        {
            Columns[i] = new int[5];
            for (int j = 0; j < 5; j++)
            {
                Columns[i][j] = boardItems[j][i];
            }
        }

        _sections = Rows.Concat(Columns).ToList();
    }
Beispiel #2
0
 public ClassicSudoku()
 {
     Alphabet   = Enumerable.Range(1, 9).ToList();
     Cells      = Enumerable.Range(0, 81).Select(i => $"{i / 9}{i % 9}").ToList();
     Conditions = Rows.Concat(Cols).Concat(Blocks);
 }