Margaret Hamilton, who has died aged 90, wrote the software code that helped to land Nasa’s Apollo 11 astronauts on the Moon on July 20 1969 and see them returned safely to Earth four days later.