This was essentially the plot of an original series Star Trek episode, https://en.wikipedia.org/wiki/A_Taste_of_Armageddon:
In this episode, the crew of the USS Enterprise visits a planet whose people
fight a computer-simulated war against a neighboring planet. Although the
war is fought via computer simulation, the citizens of each planet have to
submit to real executions inside "disintegration booths" to meet the casualty
counts of the simulated attacks.