60 likes | 196 Views
Variables. Making variables. Click on the variables tab and click "Make a variable". Set vs. Change. Set and Change look the same but are slightly different in what they do Set [ variableName ] to [number] Sets the variable to whatever the number is Change [ variableName ] by [number]
E N D
Making variables • Click on the variables tab and click "Make a variable"
Set vs. Change • Set and Change look the same but are slightly different in what they do • Set [variableName] to [number] • Sets the variable to whatever the number is • Change [variableName] by [number] • Adds whatever the number is to the variable
Variable Sized Shapes • We want you to combine what you've learned about variables and shapes to fill in the blank below. • The program should draw a shape with a different number of sides based upon the value of a variable. For example, if the variable sides was 3, it would draw a triangle, if it was 8, it would draw an octagon. • For this, we need someOperators. Look in the Operators tab to see theones you can use
Drawing Spirals • If you continue to repeat while changing the size of the steps, you can create spirals • Use either the Set block or the Change block to change the size of the step after drawing a side. Use this to create a spiral. • This is a squiral (square+spiral).Experiment with differentnumbers to create other spirals.