The doomsday clock is ticking and the young computer whizz has to override a sophisticated computer program to save the day.
A typical scene in a movie perhaps, but it was also a nail-biting moment for Dong Ruidi, 14, and Ng Chee Fong, 15, at the annual National Robotics Competition (NRC) on Thursday.
During the competition, the Fuhua Secondary School students were given a "surprise rule" - a modified set of tasks for which they had only a few hours to reprogramme their robot.
They managed to do it and won the 13-to-15 age category and a trip to Costa Rica in November to compete in the World Robot Olympiad.
"The best part is seeing the robot work - it motivates you to continue," said Chee Fong. The pair designed and built their robot with Lego Mindstorms, a robotics kit containing Lego bricks, sensors and software.
The robot's mission was to recognise objects by colour, pick them up and reposition them in pre-defined areas, according to a set of rules.
The teens spent about 20 hours a week over the last few months, going through five or six different prototypes before coming up with the perfect machine.
Chee Fong, who watched dozens of YouTube videos of robots, explained that their robot had "grab-and-lift" mechanisms that could pick up objects more effectively than those of their competitors as it had longer arms.
The NRC, previously known as the National Junior Robotics Competition, is organised by Science Centre Singapore (SCS) and has seen more than 50,000 participants since its inception in 1999.
This year, SCS collaborated with local education consultancy Duck Learning and increased the maximum participating age to 25. The minimum age is six.
Aaron Tan, 7, a Primary 1 pupil from Maha Bodhi School, and his two teammates won the junior category with a robot similar to Chee Fong's.
The team was fielded by ZLearnED, an education centre that conducts robotics classes.
"The competition is about getting students to experience science and technology that they don't get to do in their normal curriculum," said Mr Daniel Tan, SCS' senior director of projects and exhibitions.
"It exposes them to real-world applications by bringing something highly technical to a simple level."