This isn't a real riddle, but it has certainly mystified me and I can't stop thinking about it, so I would really like an answer. :-)

When asked a question with a choice, 'is it legal or illegal?', someone for some reason answered 'yes'.

Somebody else commented that you cannot answer a choice with 'yes', but that someone wrote 'More formally, the answer is "Yes, it is either legal or illegal, and you didn't ask which."'

I thought 'or' was used to give an alternative, so how can 'yes' be the answer to a choice you're given?

By the way, the question can be re-worded any way you like: 'are roses red or green?', 'should we go out or stay in?', etc.
That "someone" was being a real pain in the neck, and pretending that English and logic function under the same rules.

If you say to someone who is pregnant "Do you know whether you're having a boy or a girl?" You could get back "Yes, I do know." If you say "Is it a boy or a girl?" the person does DOES know, you expect to hear "It's a girl" or "It's a boy." However, the person who does not know could say with a smile "Well, it's not a puppy, so yes, it's either a boy or a girl."

I wonder how that someone thought the question should have been asked. Perhaps "Please tell me whether this is illegal or legal?" What an awkward way to have to go around speaking!
Is it legal or illegal?

A = Legal? Yes=1 No=0
B = Illegal? Yes=1 No=0

A B A or B
0 0 0 = No
0 1 1 = Yes
1 0 1 = Yes
1 1 1 = Yes

The answer is YES unless it is "not legal" and "not illegal". If that is not possible, then the answer is always YES.

Moral: that person is right, but it's not a human, it's a cyborg.

Now, seriously, he was obviously joking. He was applying the rules of logic to a simple idiomatic sentence in English. Logic doesn't apply to English. And that's a big problem when you have to write or read books about logic, you always have to rely on long explanations and drawings. Emotion: smile
Students: We have free audio pronunciation exercises.
By the way, in case people need to know the context, here it is:

It was on a forum thread about game graphics. We were discussing the usage of one game's graphics for another game's, and someone asked whether it was legal or not. His question was 'So is OpenTTD actually legal...' The answer he got was 'The correct question is "Is OpenTTD legal or illegal?" and the correct answer is "Yes."'

Someone else commented 'I think you mean legal, not Yes', but he got replied 'No, I mean "Yes." If I'd meant "Legal" I would have said "Legal". More formally, the answer is "Yes, it is either legal or illegal, and you didn't ask which."'

Does that clear it up?
Honestly, that person is just enjoying being an awkward idiot. Acting like a 5 year old. His version isn't 'correct' and the answer he gave is just stupid.

Don't bother about it.
Site Hint: Check out our list of pronunciation videos.
 Kooyeen's reply was promoted to an answer.