Most likely its training data included countless Space Invaders in various programming languages.
replies(6):
i have this feeling with LLM's generated react frontend, they all look the same
If they only recalled they wouldn’t “hallucinate”. What’s a lie if not an invention? So clearly they can come up with data that they weren’t trained on, for better or worse.