Did you get to the end of my post? I came to a very important conclusion, I think. Your program assumes that the parents randomly told us the gender of one of their children, which is perfectly logical. On the other had, mine assumes that if a girl is present, the parents would mention that, as that is what we're testing for. I believe that that is the whole teaser in a nutshell. It all depends on how you test it. The problem is, the 1/3-ists can't prove the 1/2-ists wrong as any 1/3-ist proof doesn't apply to the 1/2-ists, and vice versa.
Let's do a little mind experiment. Say we went to test this out for real. You go around asking parents with two children what the gender of one of their children are, while go around asking if one of their children are a girl. You then (if they say a girl) ask the gender of the other child, while I (if they respond yes) do the same. Our results will be obvious: about 1/2 of your second children will be girls, while about 1/3 of mine will be girls. Did we do something wrong? Well yes and no. Yes because we tested for two completely different things. I can't say to you, nor you to me, "You should have gotten my results," because we each tested for something different. However, there is nothing wrong with either of our methods of testing.
The big question now is which is right? I propose that they are both right. It just depends on how you read the question. So if anyone ever points a gun at your head and asks you, "I have two children. One of them is a girl. What's the gender of the other one?" you should first ask him, "If you had a boy and a girl, would you tell me one was a girl, or would you pick arbitrarily between them?"... and that would probably leave him stumped enough for you to get away.