"The Imitation Game" (2014) stars the actor Benedict Cumberbatch playing the mathematician Alan Turing. Turing was famous for his work on early computers. During World War II, he worked for the British government on a team that deciphered intercepted Nazi communications. His successful cryptography is believed to have shortened World War II.
In the film, Turing is portrayed as a reclusive personality without strong ties to friends or family. He knows from an early age that he is attracted to other men. This was illegal in Britain at the time; sexual relations between men were punishable by prison. He is briefly engaged to a fellow codebreaker (Joan Clarke, played by the actor Keira Knightley), but he breaks it off with her, admitting his true feelings.
When finally convicted of "gross indecency," Turing was given the choice between prison and a "treatment" of chemical castration that was supposed to moderate or eliminate his sexual feelings. Both possibilities devastated him; Turing chose treatment. The film depicts him as gaunt and frail after beginning the chemical castration. He lasted one year on treatment and then committed suicide on June 7, 1954 by biting an apple poisoned with cyanide.