Back on the Shore Leave planet, the crew finds that its untended master computer has turned against visitors and wants to seize the Enterprise.
The crew returns to the amusement planet first seen in Shore Leave, hoping for rest. Instead the landing party finds the grave of the Caretaker who ran it, and the untended machinery begins building dangerous figures from their thoughts, starting with an attack on McCoy by the Queen of Hearts. Uhura is captured.
The master computer resents serving others and takes over the Enterprise's computer, hoping to use the ship to seek out other computers. Spock fakes an injury so the planet's systems carry him underground, and Kirk follows. Kirk convinces the computer that service is not slavery, and it returns to its role with visitors for company. Chuck Menville and Len Janson wrote it.
