I am trying to construct a map with coordinates -20 to 20 for the x-axis and y axis with C#. At the moment i have defined my ranges(as shown below) and i am using a for each loop to loop through both lists however i can't populate them with anything because it throws an error when i try and reassign the array values back. I would like to draw a map with points. Is my logic wrong?
IEnumerable<int> squares = Enumerable.Range(-20, 20);
IEnumerable<int> cirles = Enumerable.Range(-20, 20);
int [][] arrays = new int[squares.Count()][cirles.Count()];
foreach (var shape in squares)
{
foreach (var sha in cirles)
\\Construct map
The program throws a type error as it wants me to print out a jagged array to define it like this int [][] arrays = new int[squares.Count()][];
The error is invalid rank or specifier,