CS
cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
Random r = new Random();
string[,] Sudoku = new string[9, 9]; //9x9 Array.
List<List<string>> ColCompat = new List<List<string>>(); //List of lists for each x.
string cell; /*Variable that temporarly holds a random value gotten from GetRand class I created.*/
for (int y = 0; y < 9; y++) //Goes through each row.
{
for (int x = 0; x < 9; x++)//Goes through each column.
{
// cell = GetRand(); //This will atribute a random number from 1 to 9
cell = r.Next(1,10).ToString();//This will atribute a random number from 1 to 9
if (y == 0) /*It only need to create lists at y == 0, after that it only need to access them.*/
{
List<string> temp = new List<string>();
//ColCompat[x].Add(temp);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run