Star Trek: Season 2, Episode 3
The computer of the Enterprise gains partial sentience and starts playing practical jokes on the crew.