Javascript |
|||
Failure Cases
Even though I admit (actually very impressed) that chatGPT can help a lot with coding, it has not always been successful to get the code that I liked. With multiple atempt that failed, I thought that it would be good idea to keep track of such a failure cases as well and try it later when new AI or upgraded version comes out.
Simple Preprocessor
I tried to get a simple code to function like a preprocessor in C language. I didn't expect to get a fully functioning preprocessor. I just wanted to get a simple preprocess that can handle the directive [#if #elif #endif] and [#define]. The GUI part and overal code structure that I got from chatGPT was pretty similar to what I expected. But the implementation of stripIf(str) was not good at all. It was far behind from the expectation and was not able to improve it to the code functioning as expected.
This was tried on Feb 9 2023.
I revised the initial prompt a little bit as follows. I wanted to check if chatGPT can understand a generic concept as highlighed in red below as apposed to my own description, but result was even worse. It removed the whole #if blocks regardless of whether the condition is true or not.
| |||