savagerx
February 13th, 2003, 09:46 AM
It's me again.... I know I'm troublesome.:(
First I have this:
protected int[,] array = new int[15,10];
then I do this:
map = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,
8,0,0,0,0,0,0,0,1,1,1,0,0,0,1,
1,0,0,0,1,1,1,0,0,1,0,0,0,0,1,
1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,
1,1,0,0,1,1,1,0,0,0,0,0,1,0,1,
1,0,0,0,0,1,0,0,0,0,1,1,1,0,1,
1,0,1,1,0,0,0,1,0,0,0,0,0,0,5,
1,0,1,1,0,0,0,1,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
And the compiler says this:
CMap.cs(31,43): error CS1525: Invalid expression term ','
CMap.cs(31,44): error CS1002: ; expected
CMap.cs(31,45): error CS1002: ; expected
Multiple times. And to my surprise,
neither the books "Inside C# second edition" nor "C# language specification" actually talks about that.
MSDN is a maze to me.
Question: How to I initialize a multiple dimensional array like this?
First I have this:
protected int[,] array = new int[15,10];
then I do this:
map = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,
8,0,0,0,0,0,0,0,1,1,1,0,0,0,1,
1,0,0,0,1,1,1,0,0,1,0,0,0,0,1,
1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,
1,1,0,0,1,1,1,0,0,0,0,0,1,0,1,
1,0,0,0,0,1,0,0,0,0,1,1,1,0,1,
1,0,1,1,0,0,0,1,0,0,0,0,0,0,5,
1,0,1,1,0,0,0,1,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
And the compiler says this:
CMap.cs(31,43): error CS1525: Invalid expression term ','
CMap.cs(31,44): error CS1002: ; expected
CMap.cs(31,45): error CS1002: ; expected
Multiple times. And to my surprise,
neither the books "Inside C# second edition" nor "C# language specification" actually talks about that.
MSDN is a maze to me.
Question: How to I initialize a multiple dimensional array like this?