Puzzle-game problem

I’m in the early stages of developing a puzzle game involving colored blocks. Yeah, I know, nothing original, but you got to start somewhere.

What would be the best way to check if there’s 3 or more blocks of the same color in line? I’m thinking arrays and somehow counting it there, but how? Also, the horizontal and vertical checks should be fairly easy, but what about both at the same time?

A sample AS would be nice. :slight_smile: