Week 2 – 1/17/15

We talked a bit about about using variables in Scratch.

We use the block: Set “variable_name” = value

For example set x = 5

We talked about how you can think about this as if there were a bucket that you place 5 in and then when you want to know what is in the bucket you use the variable x.

Now think about this and write the code in scratch. Test it!!!

set x = 5
set  y = x
say y

What prints out?
Now explain in words what is going on. Explain it with buckets etc….

Now write a program in Scratch that asks the user for a number between 1-10. Then it asks the user for a second number between 1-10. Then prints out “Same” if the two numbers are the same and “Different” if they are different.

Leave a Reply