Ever heard this #riddle?
You are a prisoner in a room with 2 doors and 2 guards. One of the doors will lead you to freedom and the other to a hangman – you don't know which is which.
One of the guards always tells the truth and the other always lies. You don't know which does which, although the guards do.
You have to choose and go through one of these doors, but you can only ask one question to one of the guards.
What do you ask to find the door leading to freedom?
An answer that should work even if the guards don't know who is who
This method should work with any question you ask the guard. Take your yes/no question, written in the same "is whether..." way, and add "the same as whether you are the truthful guard". If you do it right you should get the correct answer from the guard. This is because it inverts their answer if they are the lying guard. They then invert their answer if they are the lying guard and you get the truth.