Yeah I’ve actually been using chatgpt as well as a few other resources! My biggest gripe is that chatgpt can’t really teach without showing. I want to understand where my logic was flawed, and be guided towards the correct answer, instead chatgpt will do a good job at explaining what I did wrong, and then showing me the correct code.
So c is a good starter language? Cuz I’m at the point now that I can just stackoverflow my way into making a smaller project, but I really want to learn how this all works and learn the fundamentals so I’m fluent
mo_ztt@lemmy.world 1 year ago
In my opinion, C is a difficult starter language, but one that sets you up for very good abilities in the future, because a lot of other languages’ core concepts are built on C concepts. It’s all bytes, and if you’re comfortable with bytes then that’ll put you ahead of someone who only knows the general concepts. It’s similar to working construction before you go into architecture – your buildings will be better even if you’re thinking at a higher level than nails and shingles when you do most of your design.
So, ChatGPT is tuned to sort of do things for you, but you can still have it do the troubleshooting with the right prompting instead of just rewriting:
GPT-4 Prompt
I’m trying to understand what’s going wrong with my code – can you point me to the line that’s causing the issue and quickly explain what might be wrong?
GPT-4’s response
The problem with your code is in this segment:
The logic you’re using here is:
This will make the display list longer than it should be, and the letters will not replace the underscores but instead will be added alongside them.
Instead, you should check if the guessed letter matches a letter in the chosen word at a specific position, and if it does, replace the underscore at that position in the display list.
Here’s the corrected segment of code:
With this, the guessed letter will replace the corresponding underscore in the display list.
Osnapitsjoey@lemmy.one 1 year ago
Thank you!