The crew fights to stay alive when the Enterprise develops an intelligence, manifested in a bizarre holodeck scenario of a locomotive.