Added method checkValue to class Square

Added a method "checkValue" in class "Square", needed in the checkLine
method.