I have made a grid using for loop and pygame
and I have also connected it to a 2d-array. I have converted x, y into rows and columns according to the blocks.
now the green block represents the start position and I have to perform actions on its neighbors i.e all blocks touching it(even the corner blocks)
I wanted to know is there a more efficient solution to this as currently I am just storing them one-by-one in a list and then perform actions on it.
and to get the row and column of each it takes a lot of code so please help I am a beginner.