I have a loop inside a constructor, that creates and initialises a jagged array of objects. Inside the loop I have it print to the console on each iteration, so that I know how far through the process it is. It only prints to the console on a multiple of 5 (although it's only printing on a multiple of 10 for some reason) so that it doesn't spam the screen. Eg, 15% 20% 25%.
When I run the code on .Net 2.0 on Windows, it prints every 10% (rather than 5%). If I run the same code on Mono on an ARM machine it doesn't print any progress out at all.
- What is causing Mono to not give any output?
- Why is it printing only in increments of 10% rather than 5%?
Thanks
Here's the code:
public Map(int NumberOfRows, int NumberOfColumns)
{
Rows = NumberOfRows;
Columns = NumberOfColumns;
TileGrid = new Tile[NumberOfRows][];
for (int x = 0; x < TileGrid.Length; x++)
{
TileGrid[x] = new Tile[NumberOfColumns];
for (int y = 0; y < TileGrid[x].Length; y++)
{
TileGrid[x][y] = new Tile();
}
if (((double)x / Rows) * 100 % 5 == 0)
{
Console.WriteLine("{0}%", ((double)x / Rows) * 100);
}
}
}