Revision Flashcards
How would you make a sprite move fowards?
Use the block from “motion” that says “move (10) steps” you input the number of steps you want the sprite to take.
How would you make a sprite move backwards?
Use the block from “motion” that says “move (10) steps” but you would change the positive (10) to a minus number.
How would you make a sprite go to a specific location on the screen?
Use “go to” block and then input the X and Y co-ordinates.
What are the 3 different types of iteration?
Infinate loops, count controlled loops and condition controlled loops.
What is an infinite loop?
A loop that iterates forever.
When do you use a condition controlled loop?
When it is not known how many times the algorithm must be iterated before being completed.
example: inputting a password.
What does a count controlled loop do?
Uses a counter to keep track of how many times the algorithm is completed.
How could you use a count controlled loop to make the scratch cat move forward 20 steps, wait for one second, then move backwards 10 steps - 5 times?
repeat 5
move 20 steps
wait 1 second
move 10 steps
How could you use an infinite loop to make the scratch cat continually change costumes (with a wait between each costume change)?
forever change costume to (cat1) wait 1 second change costume to (cat2) wait 1 second
How could you use a condition controlled loop to make the scratch cat move 5 steps until it touches the edge of the screen?
forever move 5 steps
if on edge, bounce
In programming, what is does efficiency mean?
Reducing the amount of code used in an algorithm.
How does iteration improve the efficiency of an algorithm?
Allows them to be simplified.
What are the two boolean logic answers?
TRUE , FALSE
What are the three boolean logic operators?
AND , OR , NOT
What is a syntax error?
An error in the program.
example: capital letters and brackets etc
What is a procedure?
You create a block and explain what it does. A shortcut.