*[I'd got a draft partial I forgot to post before a busy weekend - now revised very slightly, but plan to revisit soon]* It seems particularly relevant that in step 3 >! the direction of the quarter turn (clockwise or anti-clockwise) from their initial position facing the warden (who by implication is to the side observing the whole line) is not stated. Some prisoners can be facing left and others right, which allows all hats to be observed. Working from the last clue: >! Earnest gains additional information from Dennis' comment, combined with what Earnest can see (which includes at least one hat that Dennis cannot see), which allows him to deduce the colour of his own hat. >! Earnest cannot see Bob, but Carol can see both Bob and Earnest. Dennis can see Earnest (in order to know that Earnest cannot see Bob) Given that >! Dennis can see Earnest, but Earnest can see at least one person/hat that Dennis cannot (in order to gain additional information), we can conclude that Earnest and Dennis are facing each other, and can see each other. In order for EVERYONE to know their hat colour >! it is necessary that hats at BOTH ends of the line are observed, which is certainly the case as at least one of Dennis and Earnest sees them. So far, we can conclude (without loss of generality) that the line looks something like this: >! <pre> >! ? = = ? >! ... C> ... B ... E> ... <D ...</pre> At this point >! Alice and any other prisoners' positions in the line are to be deduced, and we also need to determine all hat colours and which way Bob is facing. >! I also accidentally deleted a comment along the lines that I think that it will probably be the case that Alice and Bob must observe both ends of the line, and thus be facing opposing directions, but my initial "partial proof" of this was flawed, so it might not be the case.