Your guessing game runs, your helpers pass their tests, and the code stays secret until somebody cracks it. One more step turns a working game into a game you understand: explaining how it runs and changing a rule you haven’t seen before. If you can say what happens on one pass of the loop and why the program ends, then you can adapt the game, or any loop like it, with confidence.
This review takes about ten to fifteen minutes. You’ll do three things, one at a time:
- Explain one pass: Take a player’s answer through your loop and say which lines run and where the program goes next.
- Check a helper with new data: Predict what one of your helpers returns for answers you haven’t tried yet, then run it locally and compare.
- Change a rule: Plan, write, and test a small new rule for your game.
Before you start, open your course folder in VS Code with guessing_game.mjs in the editor and the integrated terminal ready below it. You’ll want to copy code from the file and run the game again.
Talk Through Your Game With the Mentor
The button below opens the Mentor AI drawer and starts a new conversation with a message from you. The mentor then asks you one question at a time and waits for your answer. When an answer is shaky, it gives you a hint or a smaller case instead of the solution and asks you to try again.
The mentor can’t see the files on your computer or run your program. When it asks for your code or your terminal output, copy it from VS Code and paste it into the chat. It’s fine if your game differs from the one in the project lesson, with your own secret code, range, or guess counter. The mentor works with the code you paste: