 To avoid a confrontation with Romulans, Kirk orders the ship through a unknown energy field. They escape the Romulans, but the energy field has changed the ship s computer into a prankster. It begins pulling more and more complicated practical jokes on the crew, finally to the point of endangering McCoy, Uhura, and Sulu on the Recreation Deck. Besides those three s lives, the Romulans re-appear and threaten the ship. The practical-joking computer actually helps distract the Romulans for a short while, but then the ship is once again set upon. Kirk tricks the computer (using reverse logic) into re-entering the energy field, which restores the computer to normal, but makes the Romulans  computers into pranksters instead.