Graham Moore’s script for codebreaking thriller “The Imitation Game” has won the Oscar for adapted screenplay.

“The Imitation Game” won over scripts for “American Sniper,” “the Theory of Everything,” “Inherent Vice” and “Whiplash.”

The script was loosely based on the biography “Alan Turing: The Enigma” by Andrew Hodges. The film, which won the WGA award a week ago, has been the top independent film at the box office among 2014 releases with $160 million.

Michelle Obama lauded “The Imitation Game” and other films and TV shows last month for helping to break stereotypes about gay people. The film depicts Alan Turing’s heroic efforts to break a crucial Nazi code during World War II, even as he was ostracized for his homosexuality.

“You have the power to shape our understanding of the world around us,” the first lady told a group of writers and creatives in a Jan. 30 speech. “You challenge our most strongly held beliefs.”

“Alan Turing is the person for who we made this film,” Moore said in his Feb. 14 acceptance speech at the Century Plaza in Los Angeles. “It is on the shoulders of his genius that we made this film.”

And on Sunday, Moore said that it was “most unfair” that Turing was unable to stand in front of the audience of “disconcertingly attractive faces.”

Moore also revealed that he had attempted suicide at 16 because he did not fit in and urged kids who felt the same way to “stay weird, stay different.”

“When I was 16 years old, I tried to kill myself because I felt weird and I felt different and I felt like I did not belong,” he said. “And now I’m standing here and, so, I would like for this moment to be for that kid out there who feels like she’s weird or she’s different or she doesn’t fit in anywhere. Yes, you do. I promise you do. You do.”

“Stay weird. Stay different. And then when it’s your turn, and you are standing on this stage, please pass the same message to the next person who comes along. Thank you so much.”