I think tightwads answer is correct but here is another spin on it. He stakes the cow anywhere along the perimeter of the barn and lets the cow do it's thing. If the cow goes around the barn to the right it will hit the end of it's rope half way around the barn. Then it turns right 180 degrees and goes the opposite direction turning 270 degrees at each corner it comes to so that it can actually be making a left hand turn by turning right. ( a very smart cow, only cow I know of to own a protractor. Probably gives chocolate milk too.). It does this and ends up at the same point it made the 180 degree turn thereby completing it's task.
To be honest, TightWad's answer was right I think but I can never pass up the opportunity to make things more difficult than they need to be.

If I could, I'd probably be playing good poker.