PDF

blockstblockst0.4.0

Render Scratch, Blockly, MakeCode and Open Roberta blocks for educational documents.

Scratch block catalog#

Every block of each Scratch 3 category, rendered live, next to the text that produces it. The Blockly and MakeCode catalogs follow.

Motion#

BlockCode
move (10) steps
turn cw (15) degrees
turn ccw (15) degrees
point in direction (90)
point towards [mouse-pointer v]
go to x: (0) y: (0)
go to [mouse-pointer v]
glide (1) secs to x: (0) y: (0)
glide (1) secs to [mouse-pointer v]
change x by (10)
set x to (0)
change y by (10)
set y to (0)
if on edge, bounce
set rotation style [left-right v]
(x position)
(y position)
(direction)

Looks#

BlockCode
say [Hello!] for (2) seconds
say [Hello!]
think [Hmm...] for (2) seconds
think [Hmm...]
show
hide
switch costume to [costume1 v]
next costume
switch backdrop to [backdrop1 v]
next backdrop
change [color v] effect by (25)
set [color v] effect to (0)
clear graphic effects
change size by (10)
set size to (100) %
go to [front v] layer
go [forward v] (1) layers
(costume [number v])
(backdrop [number v])
(size)

Sound#

BlockCode
play sound [pop v] until done
start sound [pop v]
stop all sounds
change [pitch v] effect by (10)
set [pitch v] effect to (100)
clear sound effects
change volume by (-10)
set volume to (100) %
(volume)

Pen#

BlockCode
erase all
stamp
pen down
pen up
set pen color to [#ff0000]
change pen color by (10)
set pen color to (50)
change pen shade by (10)
set pen shade to (50)
change pen size by (1)
set pen size to (1)

Variables#

BlockCode
set [my variable v] to (0)
change [my variable v] by (1)
show variable [my variable v]
hide variable [my variable v]
(my variable)

Lists#

BlockCode
add [thing] to [my list v]
delete (1) of [my list v]
delete all of [my list v]
insert [thing] at (1) of [my list v]
replace item (1) of [my list v] with [thing]
(item (1) of [my list v])
(item # of [thing] in [my list v])
(length of [my list v])
<[my list v] contains [thing]?>
show list [my list v]
hide list [my list v]

Events#

BlockCode
when green flag clicked
when [space v] key pressed
when this sprite clicked
when backdrop switches to [backdrop1 v]
when [loudness v] > (10)
when I receive [message1 v]
broadcast [message1 v]
broadcast [message1 v] and wait

Control#

BlockCode
wait (1) seconds
repeat (10)
end
forever
end
if <> then
end
if <> then
else
end
wait until <>
repeat until <>
end
stop [all v]
when I start as a clone
create clone of [myself v]
delete this clone

Sensing#

BlockCode
<touching [mouse-pointer v]?>
<touching color [#ff0000]?>
<color [#ff0000] is touching [#00ff00]?>
(distance to [mouse-pointer v])
ask [What's your name?] and wait
(answer)
<key [space v] pressed?>
<mouse down?>
(mouse x)
(mouse y)
(loudness)
(timer)
reset timer
([x position v] of [Sprite1 v])
(current [year v])
(days since 2000)
(username)

Operators#

BlockCode
(() + ())
(() - ())
(() * ())
(() / ())
(pick random (1) to (10))
<() > ()>
<() < ()>
<() = ()>
<> and <>
<> or <>
not <>
(join [apple] [banana])
(letter (1) of [apple])
(length of [apple])
([apple] contains [a]?)
(() mod ())
(round ())
([sqrt v] of (9))