-
You will not gain write access to the room if you have a low reputation score and/or have not asked & answered reasonable questions on Stack Overflow - do not repeatedly request write access, we know you're waiting for access and multiple requests will get you blocked.
-
Please do not ask a question unless you have first thoroughly researched it yourself.
-
developer.android.com has everything you should ever need to do all but the most advanced functionality. 99% of the time your solution will be there.
-
Please speak English as correctly as you're able.
-
Do not paste code into chat, instead use a site such as Pastebin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static T? forXY<T>(this T[,] grid, Action<int, int> action) where T : class | |
{ | |
for (int y = 0; y < grid.getHeight(); y++) | |
{ | |
for (int x = 0; x < grid.getWidth(); x++) | |
{ | |
action(x, y); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool findTarget(target) { | |
grid.forXY(int x, int y) { | |
if(grid[x,y] == target) return true | |
} | |
return false; | |
} |