Technique explanation
Programs get smart when they can make decisions, using if-then (called a conditional). The pattern is: IF something is true, THEN do this — otherwise (ELSE) do that. For example: IF score is above 100, THEN show "You win!" ELSE show "Try again." The computer checks the condition and picks a path. This is how a game knows you've won, how an app knows your password is correct, and how a thermostat decides to turn on the heat. Combine sequence, loops, and if-then and you can build almost anything.