arbeit an TUI Klasse

main
The_miro 2024-10-03 11:19:14 +02:00
parent 73ca9c8b99
commit 63fee94b0d
3 changed files with 31 additions and 6 deletions

View File

@ -5,8 +5,8 @@ class SlotMachine
{ {
static void Main() static void Main()
{ {
TUI Test = new TUI(); TUI Test = new TUI();
Test.Generate();
Random random = new Random(); Random random = new Random();
string[] symbols = { "Kirsche", "Zitrone", "Orange", "Pflaume", "Melone", "Glocke", "Bar" }; string[] symbols = { "Kirsche", "Zitrone", "Orange", "Pflaume", "Melone", "Glocke", "Bar" };
@ -37,5 +37,7 @@ class SlotMachine
} }
Console.WriteLine("Vielen Dank fürs Spielen!"); Console.WriteLine("Vielen Dank fürs Spielen!");
Console.WriteLine(Test.Generate());
} }
} }

Binary file not shown.

31
TUI.cs
View File

@ -6,18 +6,41 @@ namespace _TUI
{ {
public TUI() public TUI()
{ {
} }
public string Generate() public string Generate()
{ {
string returnstring = "";
int w = Console.WindowWidth; int w = Console.WindowWidth;
int h = Console.WindowHeight; int h = Console.WindowHeight;
char[,] Terminal = new char[w,h]; char[,] Terminal = new char[w,h];
#Console.WriteLine(w);
#Console.WriteLine(h);
#Console.WriteLine(Terminal.GetLength(0));
#Console.WriteLine(Terminal.GetLength(1));
return ""; for (int i=0; i<w-1; i++) {
for (int j=0; j<h-1; j++) {
Console.Write(i);
Console.Write(" ");
Console.WriteLine(j);
if(i == 0 || j == 0 || i == Terminal.GetLength(0) || j == Terminal.GetLength(1) )
{
Terminal[i,j] = '#';
}
}
}
for (int i=0; i<w-1; i++) {
for (int j=0; j<h-1; j++) {
returnstring += Terminal[w,h];
}
}
return returnstring;
} }
} }
} }