Skip to content

Latest commit

 

History

History
82 lines (44 loc) · 6.07 KB

File metadata and controls

82 lines (44 loc) · 6.07 KB

💭 Reflection: Game Glitch Investigator

Answer each question in 3 to 5 sentences. Be specific and honest about what actually happened while you worked. This is about your process, not trying to sound perfect.

1. What was broken when you started?

What did the game look like the first time you ran it?

Upon first running the game, we're presented with a screen that has the title at the top, a "Make a guess" message, and an area to submit guesses with two buttons and a checkbox. In the top-left corner, there's a pop-up side menu for selecting the game difficulty. There's also a toggleable section for "Developer Debug Info."

List at least two concrete bugs you noticed at the start (for example: "the secret number kept changing" or "the hints were backwards").

  • The New Game button doesn't work.

  • The hint messages are reversed—when guessing 48 with a target of 49, the game says to guess lower (instead of higher), and vice versa.

  • The point system appears broken; points were deducted even after submitting a correct answer.

  • The difficulty settings don't make logical sense: Easy (range 1-20, 6 attempts), Normal (range 1-100, 8 attempts), and Hard (range 1-50, 5 attempts) lack a consistent progression in difficulty.


2. How did you use AI as a teammate?

Which AI tools did you use on this project (for example: ChatGPT, Gemini, Copilot)? AI Tool used: ClaudeCode

Give one example of an AI suggestion that was correct (including what the AI suggested and how you verified the result). I asked ClaudeCode to walk me through what happens when I guess 48 with a secret number of 49, it correctly traced the code execution and confirmed my suspicion about reversed hints. On top of that it spotted an additional bug where on even-numbered attempts, the secret number was being converted to a string, which broke numeric comparisons. I verified this by checking the code at the lines Clause pointed to and found the problematic type conversion that would cause "9" to be compared as greater than "40" due to string ordering.

Give one example of an AI suggestion that was incorrect or misleading (including what the AI suggested and how you verified the result).

When asked “Where could this game fail when someone clicks the new game button?” it gave a confusing answer regarding how attempts should be initialized at the start of the game. I called it out on this, in which it corrected itself.

3. Debugging and testing your fixes

How did you decide whether a bug was really fixed? I decided a bug was fixed by manually testing the game and seeing if it registered the changes I made. For example for the hint reversal, I tested guesses both above and below the target number to confirm the correct messages were being displayed.

Describe at least one test you ran (manual or using pytest) and what it showed you about your code. I manually tested whether or not the new game button was working as intended after winning and losing. This showed that I fixed the problem of it not resetting its status, history and number of attempts made.

Did AI help you design or understand any tests? How? Yes, Claude helped me understand the underlying issues by explaining sections of code line by line. It also helped me understand Streamlit’s top-to-botom rendering model and why the debug panel above the submit button would always show the state from before the current submission.


4. What did you learn about Streamlit and state?

In your own words, explain why the secret number kept changing in the original app. I’m not entirely sure if I ran into this issue. I do know that there was was a problem where either guess or secret was being converted to a string on even number attempts causing a type error comparison for numerical comparisons. Other than I did learn that Streamlit renders from top to bottom which causing an issue with the debug information section where it only showed the previous state from before the current submission.

How would you explain Streamlit "reruns" and session state to a friend who has never used Streamlit? I'd explain it like this: Imagine Streamlit reads your script like a recipe from top to bottom every single time anything happens on the page. Session state is like a sticky note attached to the page that survives between these recipe readings, you can write things down on it and check them later. Without that sticky note, any information your recipe creates disappears as soon as it finishes reading.

What change did you make that finally gave the game a stable secret number? Honestly not sure, I worked on this past midnight, so I might not remember fixing it if I did encounter this problem. However I do know there is still a problem regarding score calculation that I did not fix.


5. Looking ahead: your developer habits

What is one habit or strategy from this project that you want to reuse in future labs or projects? This could be a testing habit, a prompting strategy, or a way you used Git.

I want to reuse the habit of asking AI to explain what code does step-by-step before jumping to fixes. When I asked Claude to walk through the guess-checking process, it not only confirmed my understanding but revealed bugs or information I had overlooked.

What is one thing you would do differently next time you work with AI on a coding task? Next time, I would fix one or two bugs completely before exploring other parts of the code. I got disorganized by jumping between the hint reversal, point system, difficulty settings, and New Game button simultaneously, which led to me asking Claude to track what I had and hadn't fixed.

In one or two sentences, describe how this project changed the way you think about AI generated code. This project taught me that AI is most valuable as a reasoning partner that helps me understand what I'm looking at, not as a magic fix machine, the real breakthroughs came when I asked Claude to explain rather than to solve.

Despite not following every checklist item, I successfully fixed the critical bugs and learned a lot about Streamlit state and AI collaboration along the way.