Conditions conditions We use conditions all the time! But what are conditions? They are things that decide! Conditions in coding, well you use them when You need to make a decision Usually they have an IF and a THEN And you can use them again and again! You use conditions in your life every day When you think about choices when you work and you play You use IFs and THENs in your lives every day Listen up and I will throw some examples your way IF you are hungry THEN you should eat IF you are smelly THEN you should wash your feet IF you finish your homework THEN you can watch TV And IF you want to learn THEN listen to me! Conditions conditions We use conditions all the time! But what are conditions? They are things that decide! Imagine you are coding a simple game To shoot a ball into a hoop is the aim Two points for each ball that goes in But now this brings up a good question How is the computer gonna know when To add two points when the ball goes in? I think it's time to use a condition And of course it's gonna have an IF and a THEN Let's go! So points are stored in a variable called theScore TheScore starts at zero but there's gonna be more Next, hmmm what are we gonna do? Set up a true-false variable is what we'll do We'll call this new variable isItIn It's set to false when you start the game But it will change to true if the ball goes in Now we'll set up a condition That will check the value of IsItIn And if it is true, you know what we're gonna do? Then the Score will go up by two! Aww ya You're doing it Just remember, a condition uses an IF and THEN To plan the path of a decision! Ya a condition uses an IF and THEN to plan the path of a decision! Ya a condition uses an IF and THEN to plan the path of a decision! Ya a condition uses an IF and THEN to plan the path of a decision! Conditions conditions We use conditions all the time! But what are conditions? They are things that decide!