I'm trying to be really good and avoid any 'magic numbers' in my code
so I've got this ugly construct for 2D array access:
for y := low(kMap) to high(kMap) do
for x := low(kMap[y]) to high(kMap[y]) do
Will these expressions get evaluated over and over or can/will the compiler figure out the right values just once? I could stuff the values into variables beforehand but it seems like a lot of work
Also, unless I'm imagining things (and I have had a lot of screen-time today!), array access via
a[x][y]
seems to work in the same way as
a[x, y]
but I don't see it mentioned anywhere - is it syntactic sugar?
TIA