Sorry, I don't have it anymore, but basically if you read Wikipedia, there are 3-4 rules for it.
For each square you check the rules using simple if else statement>
To check a rule I was using an invisible square to check what king of square was up/down/left/right of the current square. If it was in a collision with a neighbor square then it was black, if not it was empty/white square