I presume you mean a 2D array or single array that's displayed as a 2D grid or something (you weren't entirely clear). But basically you only really need to check for horizontal/vertical and diagonal. shouldn't different checks for left and right, and for up and down...