??? 04/23/04 20:21 Read: times |
#69062 - Seems like, but maybe isn't, a WOT |
I have a riddle. I'm submitting this as a WOT, because it doesn't apply exclusively to 51s, and it isn't even explicitely related to embedded systems or ยต-controllers. Nonetheless, maybe it's a cool exercise for honing the old logic skills, and good logic skills are definitely important to writing elegant and efficient code.
The Setup: You are in a room that has two doors. One of the doors is a safe passage out. The other door leads to instant and certain death. You do not know which is which. There are two men in the room with you. They both know which door is which. One of the men will always lie and the other will always tell the truth. Again, you don't know which is which. The Riddle: You can ask one and only one question, and you must ask it of one and only one of the men. How can you get out of the room safely? (Taking a 50:50 chance does NOT constitute "safely.") |