J
John Salerno
private static void InitializeArrays()
{
FileStream stream = new FileStream(path, FileMode.Open,
FileAccess.Read);
StreamReader readSwitches = new StreamReader(stream);
int i = 0;
using (readSwitches)
{
string row = readSwitches.ReadToEnd();
string[] switches = row.Split('|');
string[, ,] panelOne = FillPanel(switches);
}
}
private static string[, ,] FillPanel(string[] switches)
{
string[, ,] panel;
for (int z = 0; z < 8; z++)
{
for (int x = 0; x < 2; x++)
{
for (int y = 0; y < 10; y++)
panel[x, y, z] = switches[i++];
}
}
return panel;
}
Ok, I made it to where the switches array contains all the information
that I then need to put into the panel arrays. Each panel array (four of
them) will consist of 8 different 2x10 arrays. I'm still trying to
figure out a good way to fill them up. The above code won't compile, but
I feel like I'm getting closer. I'd appreciate any comments.
{
FileStream stream = new FileStream(path, FileMode.Open,
FileAccess.Read);
StreamReader readSwitches = new StreamReader(stream);
int i = 0;
using (readSwitches)
{
string row = readSwitches.ReadToEnd();
string[] switches = row.Split('|');
string[, ,] panelOne = FillPanel(switches);
}
}
private static string[, ,] FillPanel(string[] switches)
{
string[, ,] panel;
for (int z = 0; z < 8; z++)
{
for (int x = 0; x < 2; x++)
{
for (int y = 0; y < 10; y++)
panel[x, y, z] = switches[i++];
}
}
return panel;
}
Ok, I made it to where the switches array contains all the information
that I then need to put into the panel arrays. Each panel array (four of
them) will consist of 8 different 2x10 arrays. I'm still trying to
figure out a good way to fill them up. The above code won't compile, but
I feel like I'm getting closer. I'd appreciate any comments.