score calculator working for 3x3 grid