๐Ÿฑ

Scratch Cheat Sheet

MIT's drag-and-drop visual programming language โ€” instead of typing syntax, you snap together color-coded blocks like puzzle pieces. It's the single most common first-programming-language experience in the world, used in classrooms from elementary school onward.

๐Ÿ“ Reference page only โ€” Scratch is a visual, block-based editor rather than a text language, so there's no "Run" button that makes sense here the way it does for text-based languages. The real thing to do is build directly at scratch.mit.edu, completely free, right in the browser.
Jump to: Sprites & the stageEventsMotion Control (loops & conditionals)OperatorsVariables

Sprites & the stage

Everything in Scratch happens to a sprite (a character or object) sitting on the stage (the screen). Each sprite has its own independent stack of blocks that controls what it does.

Events

Every script starts with a yellow "hat" block that says when it runs.

when ๐ŸŸฉ clicked
when key [space] pressed
when this sprite clicked
when I receive [message]

Motion

move (10) steps
turn โ†ป (15) degrees
go to x: (0) y: (0)
glide (1) secs to x: (0) y: (0)

Control (loops & conditionals)

repeat (10) [ ... ]
forever [ ... ]
if <condition> then [ ... ]
wait (1) seconds

These snap around other blocks like a physical container โ€” a repeat block literally wraps around the blocks it repeats.

Operators

( ) + ( )
( ) < ( )
< > and < >
pick random (1) to (10)

Variables

Made in the Variables palette, then dragged into other blocks โ€” no typing a declaration the way you would in a text language.

set [score] to (0)
change [score] by (1)
say [Hello!] for (2) seconds
โ† See the Software Developer career track