I'm trying to find a specific episode of an old sci-fi show I watched decades ago. It involved two planets that were originally at war with each other, but the wars became too costly, and both planets agreed to do simulated war, where imaginary missiles would detonate (in a simulator) over real towns.
The inhabitants of the town were then "registered", and then had a day to say their goodbyes and then go into a room that vaporized them, sending the kill count to the other planet to make sure both sides were honoring the rules of the "war". The protagonist "saves the day" by damaging the simulator, causing the two planets to think the other side reneged on the war pact, and actually resumes a real war with real weapons.