The project below has a single sprite with a call to a custom number guessing game block: it picks a secret number from 1 to 10 and asks you to guess until you get it. But it has a bug: if you keep playing over and over, it will sometimes (not often) congratulate you before you even guess. Analyze the code, explain how that can happen, and fix the bug. (Hint: have it pick its random number just from 1 to 3 to make the bug occur more often.)
Then extend the game: use conditionals and predicates to tell the player whether a wrong guess is too big or too small, ask the player at the start what the maximum number should be and pick a secret number between 1 and that maximum, and use another script variable to count the player's guesses so you can say how many it took when they win.
Your work autosaves (and you can use the Save button); earlier versions are available from the Revisions dropdown.