There are three people, Alex, Brook and Cody. One of whom is a knight, one a knave, and one a spy.
The knight always tells the truth, the knave always lies, and the spy can either lie or tell the truth.
Alex says: “Cody is a knave.”
Brook says: “Alex is a knight.”
Cody says: “I am the spy.”
Who is the knight, who is the knave, and who is the spy?
Answer
Alex is a knight, Cody is a knave, and Brook is a spy.
Brook is not the knight, since if he is, then Alex would also be the knight. Cody is not the knight, since his statement would then be a lie. Therefore Alex is the knight, Cody is the knave, and Brook is the spy.