This seems very fragile. I tried your initial prompt, asked for "Give an example of the bitwise and swap trick" and got the XOR swap trick. I replied " you used sed xor, I wanted to use bitwise and", and it went straight back to printing incorrect code.
Yea, that’s right, really brittle. But things are not far, research is likely already validating these things with empirical studies. Soon we’ll see new prompting interfaces.