The puzzle calls for a planning for life :D.
A medieval age mad king devices another mad trick for his fun that plays on life of his best 100 men.
He calls them and line them up and then places a red or a white cap on everyone's head. After lining up they are not allowed to communicate among themselves and can only look at all the men in front of them , not himself and not behind the person himself.
He then tells them to that he will start from the end of the line and ask the person the color of the cap he is wearing (from the person in the line from whom the question is asked) . If he is correct he survives and stays there, and if incorrect he dies silently and the other in front of him wont even know about it. He will keep on moving until he reaches the first person in line.
Any break in rule or devising a way to communicate among themselves calls for killing of all of them.
Now, what is the maximum number of men that can survive for sure? Whats the plan?