Let's say it could. It wouldn't be perfect. You'd still need to know code to know when the AI is wrong.
There are other ways of making a game that does not require code, however. UE5 has a visual logic editor that's strong enough to make an entire game using nothing but that and never actually touching the text code.