The M-5 multitronic computer, designed by Richard Daystrom to run a starship, took over the Enterprise in war games and destroyed the USS Excalibur with all hands.
In 2268 the Enterprise was used to test the M-5, a new computer designed by Dr. Richard Daystrom to command a starship with only a skeleton crew. Kirk resented being replaced. The M-5 performed well at first, but it then destroyed an unmanned ore freighter and, during war games with other starships, made real attacks, killing the entire crew of the USS Excalibur.
Daystrom had impressed his own mind patterns on the computer, including his instability. Kirk convinced M-5 that it had committed murder, and it shut itself down to atone. Daystrom suffered a breakdown.