A tale of three hats

Here is a puzzle to start you off on the course - this is a very old puzzle, this version is taken from the novel Doctor Copernicus by John Banville (a book which I have recommended as worth reading on my books page).
In a room there are 3 men: A & B who are blindfold, and C who is blind. On a table in the room there are 3 black hats & 2 white hats (5 hats in all). A 4th man enters (call him D). D places a hat on each of the heads of A & B & C, and the remaining 2 hats he hides. Now D removes the blindfold from A, who thus can see the hats that B & C are wearing, but not the hat he himself wears, nor the 2 hidden hats. D asks A if he can say what colour is the hat that he, A, is wearing. A ponders, and answers "No".

Now D removes the blindfold from B, who thus can see the hats that A & C are wearing, but not the hat that he himself wears, nor the two hats that are hidden. D asks B if he can say what colour is the hat that he, B, is wearing. B ponders, hesitates, and answers "No".

Now, D cannot remove a blindfold from C, who does not wear a blindfold, and can see no hats at all, not white nor black, not worn nor hidden, for C, as said, is blind. D asks C if he can say what colour is the hat that he, C, is wearing. C ponders, smiles, and answers "Yes".

So: what is the colour of the blindman's hat, and how does he know it?

 

(Don't spoil it for yourself - think about the puzzle a while. You can see the answer by highlighting the text below the hats.)

 

 

The answer (In "ROT13"! - Google "ROT13 decoder"):


N pnaabg or frrvat gjb juvgr ungf, sbe vs ur qvq, ur jbhyq xabj uvf ung jnf oynpx. Fb ur zhfg frr rvgure bar oynpx, bar juvgr, be gjb oynpx ungf. O naq P nyfb xabj guvf snpg.

Arkg O pnaabg frr n juvgr ung ba P, sbe vs ur qvq, gura ur jbhyq xabj uvf ung zhfg or oynpx. Fb ur zhfg frr n oynpx ung ba P.

P nyfb xabjf guvf snpg, fb gurersber ur xabjf uvf ung vf oynpx.

Abgvpr gung ng gur raq bs guvf tnzr, gur oyvaq P vf gur bayl cynlre jub xabjf jung pbybhe uvf ung vf.


Have fun!