what is the conditional comand of scratch.give one example.please answer this ques. fastly
Answers
Answered by
1
Scratch:Conditional Statements: If-Then, Else
Under what conditions can the sprite move or perform an action?
Using the If-Then blocks can help you tell the program if it is faced with a new situation.
For example: If it is raining, Then I will bring an umbrella, or else, wear sunscreen
If (Condition) Then (Consequence) Else (Alternative)
The Else is what to do when the answer to the IF is false, it is not the result of not doing the THEN. so If it is raining, Then I will bring an umbrella, or else, I will get wet is not the correct logic.
The Then and Else are independent of each other so it could be:
IF (the Ball is red) Then (Jump up and down) Else (go swimming)
IF (the score is > 100) Then (You win) Else (move 10 steps)
Also the IF is just a true false question. the command in the THEN and ELSE don't really have to be connected to what the question is only if it is TRUE or FALSE
SENSING blocks:
-touching sprite
-touching color
-color touching color
-space key is pressed
-mouse pointer
Under what conditions can the sprite move or perform an action?
Using the If-Then blocks can help you tell the program if it is faced with a new situation.
For example: If it is raining, Then I will bring an umbrella, or else, wear sunscreen
If (Condition) Then (Consequence) Else (Alternative)
The Else is what to do when the answer to the IF is false, it is not the result of not doing the THEN. so If it is raining, Then I will bring an umbrella, or else, I will get wet is not the correct logic.
The Then and Else are independent of each other so it could be:
IF (the Ball is red) Then (Jump up and down) Else (go swimming)
IF (the score is > 100) Then (You win) Else (move 10 steps)
Also the IF is just a true false question. the command in the THEN and ELSE don't really have to be connected to what the question is only if it is TRUE or FALSE
SENSING blocks:
-touching sprite
-touching color
-color touching color
-space key is pressed
-mouse pointer
Similar questions