What every block does, when to use it, and an example you can open and run. Stuck on something? Search below, or look in Common questions.
Open the editorTap a block to see what it does, what to fill in, and an example you can try.
Start
Talk
Values
Decide
Repeat
Lists
Functions
Objects
Finish
Many boxes take a value: a number, some text, a name, or a sum that works one out.
7, 3.5, -2."hello". Single quotes don't work.score, firstName.["red", "blue"], or [] for an empty one. colours[1] is the first item.| Symbol | Means | Example |
|---|---|---|
+ | add numbers, or join text | 3 + 4 is 7, "Hi " + name |
- * / | take away, times, divide | 10 / 4 is 2.5 |
% | remainder after dividing | 10 % 3 is 1 |
== != | is equal to, is not equal to | answer == 42, colour != "red" |
> < >= <= | bigger, smaller, at least, at most | age >= 13 |
&& | and: both must be true | age >= 13 && age <= 19 |
|| | or: at least one is true | day == "Sat" || day == "Sun" |
! | not: flips true and false | !contains(word, "a") |
( ) | work this part out first | "Sum: " + (a + b) |
Use them in any box, like round(price, 2).
round(number) or round(number, digits)floor(number)ceil(number)abs(number)sqrt(number)power(number, times)min(a, b, …) or min(list)max(a, b, …) or max(list)random(lowest, highest)length(list or text)upper(text)lower(text)contains(list or text, thing)join(list) or join(list, between)split(text) or split(text, between)