An inhabitant has been killed in Knavesville and the Sheriff has interrogated four suspects. It is known that one of them is the killer. As is expected of Knaves, they alternated between telling the truth and lying (Not necessarily in that order).
Each suspect was first asked if he was the killer, to which the sheriff got the same answer from all the four suspects.
He then asked them, 'Who was the killer?' The answers to which are shown below.
Abbey said: Bart is the killer.
Bart said: Dean is the killer.
Cody said: Bart is lying when he says Dean is the killer.
Dean said: If Abbey did not kill him, then Bart did.
Who was the killer?
Cody is the killer.
The first question was "Are you the killer?". They all answered 'No', which means only Cody was lying.
In the second question Abbey, having told the truth the first time, now has to lie, so wrongly accuses Bart.
Bart, also having told the truth the first time, also has to lie, and accuses Dean.
Cody, having lied the first time now has to tell the truth, and so confirms that Bart told a lie.
Dean, having told the truth the first time, lies by fingering either Abbey or Bart.