say there is an event that must compare values on multiple array cells in say a 5 x 5 area in a for each X&Y loop.
for example, if I wanted to compare all cells in a 5 x 5 area to be equal to 0. The first thing that comes to mind is:
for each XY element:
compare at XY X: array.curX Y: array.curY Value = 0
compare at XY X: array.curX + 1 Y: array.curY Value = 0
compare at XY X: array.curX + 2 Y: array.curY Value = 0
compare at XY X: array.curX + 3 Y: array.curY Value = 0
compare at XY X: array.curX + 4 Y: array.curY Value = 0
compare at XY X: array.curX Y: array.curY + 1 Value = 0
compare at XY X: array.curX + 1 Y: array.curY + 1 Value = 0
... & so on until compare at XY X: array.curX + 4 Y: array.curY + 4 Value = 0
-----> [action]
this would work, but it's awfully spacious. Any thoughts on applying some form of math or technique to shorten this but still be able to check all 25 conditions?
Hope this was clear enough, much appreciated.