Program.cs:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace project
{
class Program
{
public static byte[,] feld = new byte[6, 7]; // Feld Variable - x=Reihe,y=spalte
static void Main(string[] args)
{
Program.feld[0,0] = 0;
funcs.draw_game();
Console.ReadLine();
}
}
}
funcs.cs:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace project
{
class funcs
{
public static void draw_game()
{
Console.Write("\n\t\t -----------------------"); // Obere Begrenzung
for(byte a=0;a!=6;a++)
{
Console.Write("\n\t\t | "); // Linker Rand
for (byte i = 0; i != 7; i++)
{
if(Program.feld[a,i] == '0')
{
Console.Write(" 0 ");
}
}
Console.Write(" | "); // Rechter Rand
}
Console.Write("\n\t\t -----------------------"); // Untere Begrenzung
}
}
}
Unswar soll die
byte[,] feld = new byte[6, 7] Global erreichbar sein. Auch aus der funcs.cs wo meine FUnktionen liegen sollen.
Erreichbar scheint die feld Variable zu sein jedoch ohne jegliche Werte. Wieso?