The Imitation Game is a 2014 British-American historical thriller film about British mathematician, logician, cryptanalyst and pioneering computer scientist Alan Turing, a key figure in cracking Nazi Germany's Enigma code that helped the Allies win the Second World War, only to later be criminally prosecuted for his homosexuality. It stars Benedict Cumberbatch as Turing and is directed by Morten Tyldum with a screenplay by Graham Moore, based on the biography Alan Turing: The Enigma by Andrew Hodges.