You asked an AI to build a simple "Number Guessing Game" using Streamlit. It wrote the code, ran away, and now the game is unplayable.
- You can't win.
- The hints lie to you.
- The secret number seems to have commitment issues.
- Install dependencies:
pip install -r requirements.txt - Run the broken app:
streamlit run app.py
- Play the game. Open the "Developer Debug Info" tab in the app to see the secret number. Try to win.
- Find the State Bug. Why does the secret number change every time you click "Submit"? Ask ChatGPT: "How do I keep a variable from resetting in Streamlit when I click a button?"
- Fix the Logic. The hints ("Higher/Lower") are wrong. Fix them.
- Refactor & Test. - Move the logic into
logic_utils.py.- Run
pytestin your terminal. - Keep fixing until all tests pass!
- Run
[Insert screenshot of your fixed, winning game here]