Ich versuche, mein 'Spiel' auf der Vorderseite jeder Zeile dieses Codes erscheinen, aber es erscheint am Ende und ich kann nicht herausfinden, wie meine Schleifen so zu beheben Es erstellt eine neue Zeile zur richtigen Zeit.For-Schleife mit geordneten Array-Formatierungsfehler
static void Main() {
int[,] lottoNumbers ={
{ 4, 7, 19, 23, 28, 36},
{14, 18, 26, 34, 38, 45},
{ 8, 10,11, 19, 28, 30},
{15, 17, 19, 24, 43, 44},
{10, 27, 29, 30, 32, 41},
{ 9, 13, 26, 32, 37, 43},
{ 1, 3, 25, 27, 35, 41},
{ 7, 9, 17, 26, 28, 44},
{17, 18, 20, 28, 33, 38}
};
int[] drawNumbers = new int[] { 44, 9, 17, 43, 26, 7, 28, 19 };
PrintLottoNumbers(lottoNumbers);
ExitProgram();
}//end Main
static void PrintLottoNumbers(int[,] lottoN)
{
for (int x = 0; x < lottoN.GetLength(0); x++) {
for (int y = 0; y < lottoN.GetLength(1); y++) {
if(y < 1 && x > 0)
{
Console.WriteLine("Game" + lottoN[x, y] + " ");
}else {
Console.Write($"{lottoN[x, y],2}" + " ");
//Console.Write(lottoN[x, y] + " ");
}
}
}
}//Print Function For Lotto Numbers
Perfekt! Vielen Dank, Jungs! – BobFisher3