A dwarf-killing giant lines up 10 dwarfs from shortest to tallest.
Each dwarf can see all the shortest dwarfs in front of him, but cannot see the dwarfs behind himself.
The giant randomly puts a white or black hat on each dwarf. No dwarf can see their own hat. The giant tells all the dwarfs that he will ask each dwarf, starting with the tallest, for the color of his hat.
If the dwarf answers incorrectly, the giant will kill the dwarf.
Each dwarf can hear the previous answers, but cannot hear when a dwarf is killed.
(see full text)