это мой код для моей двумерной таблицы.
Что я хочу сделать, так это чтобы я поставил свои данные в правильном месте - но, как вы видите, мои результаты в таблице не такие, как должно быть. Столбцы перекрывают строки.
Мой вопрос: как я могу расположить столбцы немного правее? А также - как я могу получить свой вклад в правильную позицию?
Некоторые советы и помощь приветствуются.
string[,] clubs = new string[20, 30];
clubs[1, 0] = " ADO";
clubs[2, 0] = " Ajax";
clubs[3, 0] = " AZ";
clubs[4, 0] = " FC-GR";
clubs[5, 0] = " FC-TW";
clubs[6, 0] = " FC-U";
clubs[7, 0] = " FEY";
clubs[8, 0] = " HER";
clubs[9, 0] = " NAC";
clubs[10, 0] = " NEC";
clubs[11, 0] = " PSV";
clubs[12, 0] = " RKC";
clubs[13, 0] = " ROD";
clubs[14, 0] = " SC";
clubs[15, 0] = " SPA";
clubs[16, 0] = " VIT";
clubs[17, 0] = " VVV";
clubs[18, 0] = " WIL";
clubs[0, 1] = "Ado Den haag";
clubs[0, 2] = "Ajax";
clubs[0, 3] = "AZ";
clubs[0, 4] = "FC Groningen";
clubs[0, 5] = "FC Twente";
clubs[0, 6] = "FC Utrecht";
clubs[0, 7] = "Feyenoord";
clubs[0, 8] = "Hercules Almelo";
clubs[0, 9] = "NAC Breda";
clubs[0, 10] = "NEC";
clubs[0, 11] = "PSV";
clubs[0, 12] = "RKC Waalwijk";
clubs[0, 13] = "Roda JC";
clubs[0, 14] = "SC Heerenveen";
clubs[0, 15] = "Sparta Rotterdam";
clubs[0, 16] = "Vitesse";
clubs[0, 17] = "VVV-Venlo";
clubs[0, 18] = "Willem II";
int rows = 15;
int colums = 15;
int x = 0;
int y = 0;
string str;
int thuisteam;
int uitteam;
Console.WriteLine("Selecteer de thuisteam op een nummer");
for (int i = 1; i < colums; i++)
{
Console.WriteLine(clubs[i, 0] + " " + i);
}
str = Console.ReadLine();
thuisteam = Int32.Parse(str);
Console.WriteLine("Selecteer de uitteam in onderstaande nummer");
for (int i = 1; i < rows; i++)
{
Console.WriteLine(clubs[0, i] + " " + i);
}
str = Console.ReadLine();
uitteam = Int32.Parse(str);
Console.WriteLine("Schrijf de score of datum van je wedstrijd op");
str = Console.ReadLine();
clubs[thuisteam, uitteam] = str;
Console.WriteLine();
for (; y < rows; y++)
{
for (; x < colums; x++)
{
Console.Write(clubs[x, y] + " ");
if (x == (colums - 1))
{
Console.WriteLine("");
Console.WriteLine("");
}
}
x = 0;
}
Console.ReadLine();
}
}
}