
Variables - Microsoft MakeCode for micro:bit
Understand what variables are and why and when to use them in a program. Learn how to create a variable, set the variable to an initial value, and change the value of the variable within a micro:bit …
Declaring variables - Microsoft MakeCode for micro:bit
Using variables Once you’ve defined a variable, just use the variable’s name whenever you need what’s stored in the variable. For example, the following code shows the value stored in counter on …
Blocks - Variables - Microsoft MakeCode for micro:bit
Blocks - Variables An introduction to variables for the Block Editor. What is a variable? Variables are things that are remembered by the micro:bit. Variables can take a few formats and can have …
Introduction - Microsoft MakeCode for micro:bit
The micro:bit’s variables can keep track of numbers, strings, Booleans, sprites, and arrays. The first time you use a variable, its type is assigned to match whatever it is holding.
Variables - Microsoft MakeCode for micro:bit
Variables Assign (set) a variable’s value 1 set x to Get a variable’s value 1 x set y to set x to
Variable Declarations - Microsoft MakeCode for micro:bit
While these variables are “present” throughout their scope, all points up until their declaration are part of their temporal dead zone. This is just a sophisticated way of saying you can’t access them before …
Activity: Scorekeeper - Microsoft MakeCode for micro:bit
This micro:bit activity guides the students to create a program with three variables that will keep score for their Rock Paper Scissors game. Tell the students that they will be creating a program that will act …
Variables - Microsoft MakeCode for micro:bit
Understand what variables are and why and when to use them in a program. Learn how to create a variable, set the variable to an initial value, and change the value of the variable within a micro:bit …
Variable Declarations - Microsoft MakeCode for micro:bit
While these variables are “present” throughout their scope, all points up until their declaration are part of their temporal dead zone. This is just a sophisticated way of saying you can’t access them before …
Unplugged: Keeping score - Microsoft MakeCode for micro:bit
The objective of this activity is to experience creating and working with variables by pairing up and playing Rock Paper Scissors. Ask students to keep track of their scores on paper.