Activity 01
Game Design: Number Guessing Challenge
Students create a program that generates a random number between 1 and 10. Use a while loop to repeatedly ask for user guesses until correct, providing hints like 'too high' or 'too low'. Test and refine with classmates.
Analyze how a 'while' loop's condition controls its execution.
Facilitation TipDuring Game Design: Number Guessing Challenge, circulate to ensure pairs test edge cases like correct guesses on the first try or repeated incorrect answers.
What to look forProvide students with a simple pseudocode snippet of a 'while' loop. Ask them to predict the output of the code and explain why the loop terminates or if it would run infinitely. Example: 'Set score to 0. While score is less than 5, print 'Keep going!' and add 1 to score. What is printed?'