Scratch/Block Reference Guide

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Table of Blocks
Block picture Name Description Category Examples
() mod () Returns the remainder (modulo) after the first number is divided by the second. Operators (16) mod (7) = 2

(75) mod (34) = 7

(7) mod (2) = 1

(7) mod (3.3) = 0.3

(1) mod (0.3) = 0.1

add () to [] Adds the specified variable to the specified list. Variables (Lists) add ("grapes") to [fruits]
If 'fruits' was the list:
apples
cherries
then 'fruits' would then be
apples
cherries
grapes

add ("16") to [squares]

If 'squares' was the list:
1
4
9
then 'squares' would then be
1
4
9
16