[I'd got a draft partial I forgot to post before a busy weekend - now revised very slightly, but plan to revisit soon]I've not figured out all the interactions yet]
It seems particularly relevant that in step 3 [since edited to make this particular phrasing nonsense...]
the direction of the quarter turn (clockwise or anti-clockwise) from their initial position facing the warden (who by implicationeach prisoner is to the side observing the whole line)facing is not stated. Some prisoners can be facing left and others right, which allows all hats to be observed.
Whoever is at the two end positions
I also accidentally deleted a comment along the lines that I think that it will probablyMight as well be the case thatfacing inwards so they can see everyone else... any conclusion they can make without seeing hats they can also make whilst seeing hats too.
It seems likely that
Alice and Bob must observe bothare also facing opposite directions, each observing one of the ends of the line, and thus be facing opposing directions, but my initialI've not fully convinced myself this is absolutely certain - I had a "partial proof" of thisthat was flawed.
I strongly suspect that
multiple prisoners learn their hat colour only at the last moment, so it might not beas Earnest declares he knows his hat colour, thus disproving the casealternative scenario each had in mind.