c# 2d list
//This code is an updated, working version of the code Tender Termite wrote
List> matrix = new List>(); //Create 2d List
List list1 = new List();
list1.Add(4);
list1.Add(5);
matrix.Add(list1); //Insert List into matrix
List list2 = new List();
list2.Add(6);
list2.Add(7);
matrix.Add(list2);
int x = matrix[0][1]; //Get data from Matrix, here x is 5
matrix[0].RemoveAt(1); //Removes the 5
x = matrix[0][0]; //x is now 4
matrix.RemoveAt(0); //removes whole first row
x = matrix[0][1]; //x is now 7
2d list c#
List> matrix = new List>();
List list1 = new List();
list1.Add("4");
list1.Add("5");
matrix.Add(list1);
List list2 = new List();
list2.Add("6");
list2.Add("7");
matrix.Add(list2);
//matrix is now
// 4 5
// 6 7
c# 2d list
List track = new List();
track.Add("2349");
track.Add("The Prime Time of Your Life");
// etc
matrix.Add(track);
|