i guesd it helps to think of it as a language translator- in my experiments with getting it to write programs it does better if i essentially describe step by step exactly how the algorithm will work, and insist on no libraries. Like really painfully specific handholding.
it all goes wrong if you allow it any “creative” freedom