Snap! Reference Manual
  1. Appendices
  2. All Snap! Blocks
  • Introduction
  • Acknowledgements
  • 1  Blocks, Scripts, and Sprites
  • 2  Saving and Loading Projects and Media
  • 3  Building a Block
  • 4  First class lists
  • 5  Typed Inputs
  • 6  Procedures as Data
  • 7  Object Oriented Programming with Sprites
  • 8  OOP with Procedures
  • 9  The Outside World
  • 10  Continuations
  • 11  Metaprogramming
  • 12  User Interface Elements
  • Appendices
    • A  Libraries in Snap
    • B  Appendix A. Snap color library
    • C  Appendix B. APL features
    • The Snap! Community Site
    • All Snap! Blocks
    • Motion Blocks
      • move steps
      • turn ↻ degrees
      • turn ↺ degrees
      • point in direction
      • point towards
      • go to x: y:
      • go to
      • Glide Secs to Position
      • change x by
      • set x to
      • change y by
      • set y to
      • if on edge, bounce
      • position
      • x position
      • y position
      • direction
    • Looks Blocks
      • switch to costume
      • next costume
      • costume number
      • say for secs
      • say
      • think for secs
      • think
      • Attribute of Costume
      • Stretch Costume
      • Skew Costume by Degrees
      • New Costume
      • change effect by
      • set effect to
      • clear graphic effects
      • _ effect
      • change size by
      • Set Sprite Size
      • size
      • show
      • hide
      • shown?
      • go to layer
      • go back layers
    • Sound Blocks
      • Play Sound
      • Play Sound Until Done
      • Stop All Sounds
      • Play Sound Hz
      • Attribute Of Sound
      • New Sound Rate Hz
      • Rest For Beats
      • Play Note For Beats
      • Set Instrument
      • Change Tempo
      • Set Tempo
      • Tempo
      • Change Volume
      • Set Volume
      • Volume
      • Change Balance
      • Set Balance To
      • Report Balance
      • Play Frequency Hz
      • Stop Frequency
    • Pen Blocks
      • clear
      • pen down
      • pen up
      • pen down?
      • set pen color to
      • change pen by
      • set pen to
      • pen
      • change pen size by
      • set pen size to
      • stamp
      • fill
      • write size
      • pen trails
      • paste on
      • cut from
      • Color
      • Color Attribute
      • new color
    • Control Blocks
      • When Green Flag Clicked
      • when is edited
      • when I start as a clone
      • when I receive
      • when key pressed
      • when
      • when I am
      • broadcast
      • broadcast and wait
      • Warp
      • wait secs
      • wait until
      • forever
      • repeat
      • repeat until
      • for _ = to
      • if
      • if else
      • if then else
      • report
      • stop
      • run
      • launch
      • call
      • pipe →
      • tell to
      • ask for
      • create a clone of
      • a new clone of
      • delete this clone
      • pause all ⏸
      • switch to scene
      • define
      • delete block
      • set of block to
      • Attribute Of Block
      • this
      • set slot to
    • Sensing Blocks
      • touching ?
      • touching ?
      • color is touching ?
      • ask and wait
      • answer
      • mouse position
      • mouse x
      • mouse y
      • mouse down?
      • key pressed?
      • Distance To
      • Color at Location
      • reset timer
      • timer
      • current
      • Attribute Of
      • my
      • object
      • url
      • microphone
      • video on
      • set video transparency to
      • is on?
      • set to
    • Operators Blocks
      • Command Ring
      • Reporter Ring
      • Predicate Ring
      • Sum +
      • Subtract −
      • Product ×
      • Divide ÷
      • Power of Number
      • Mod
      • min
      • max
      • round
      • Math Functions
      • atan2 ÷
      • pick random to
      • `<`
      • _
      • `>`
      • _
      • or
      • not
      • _
      • join
      • split by
      • letter of
      • Attribute of Text
      • unicode of
      • unicode as letter
      • is a ?
      • is ?
    • Variables Blocks
      • set to
      • change by
      • show variable
      • hide variable
      • Script variables
      • inherit
      • list
      • numbers from to
      • In Front Of
      • item of
      • all but first of
      • Report List Attribute
      • index of in
      • List Contains
      • is empty?
      • map over
      • keep items from
      • find first item in
      • combine using
      • for each in
      • add to
      • delete of
      • insert at of
      • replace item of with
      • append
      • reshape to
      • combinations
  1. Appendices
  2. All Snap! Blocks

All Snap! Blocks

All Snap! Blocks
Block Text Label Type Category Lisp
block ‘move _ steps’ move _ steps command motion (move 10)
block ‘turn $clockwise _ degrees’ turn $clockwise _ degrees command motion (right 15)
block ‘turn $counterclockwise _ degrees’ turn $counterclockwise _ degrees command motion (left 15)
block ’point in direction _’ point in direction _ command motion (head 90)
block ’point towards _’ point towards _ command motion (face [mouse-pointer])
block ’go to x: _ y: _’ go to x: _ y: _ command motion (go 0 0)
block ’go to _’ go to _ command motion (goto "[random position]")
block ’glide _ secs to x: _ y: _’ glide _ secs to x: _ y: _ command motion (glide 1 0 0)
block ’change x by _’ change x by _ command motion (+x 10)
block ’set x to _’ set x to _ command motion (x= 0)
block ’change y by _’ change y by _ command motion (+y 10)
block ’set y to _’ set y to _ command motion (y= 0)
block ‘if on edge, bounce’ if on edge, bounce command motion (bounce)
block ‘position’ position reporter motion (pos)
block ‘x position’ x position reporter motion (x)
block ‘y position’ y position reporter motion (y)
block ‘direction’ direction reporter motion (dir)
block ’switch to costume _’ switch to costume _ command looks (wear nil)
block ‘next costume’ next costume command looks (next)
block ‘costume #’ costume # reporter looks (costume#)
block ‘say _ for _ secs’ say _ for _ secs command looks (sayFor Hello! 2)
block ’say _’ say _ command looks (say Hello!)
block ‘think _ for _ secs’ think _ for _ secs command looks (thinkFor Hmm... 2)
block ’think _’ think _ command looks (think Hmm...)
block ’_ of costume _’ _ of costume _ reporter looks (costume [width] [current])
block ‘stretch _ x: _ y: _ %’ stretch _ x: _ y: _ % reporter looks (stretch [current] 100 50)
block ‘skew _ to _ degrees _ %’ skew _ to _ degrees _ % reporter looks (skew [current] 0 50)
block ’new costume _ width _ height _’ new costume _ width _ height _ reporter looks (newCostume nil nil nil)
block ’change _ effect by _’ change _ effect by _ command looks (+effect [ghost] 25)
block ’set _ effect to _’ set _ effect to _ command looks (effect= [ghost] 0)
block ‘clear graphic effects’ clear graphic effects command looks (clearEffects)
block ‘_ effect’ _ effect reporter looks (effect [ghost])
block ’change size by _’ change size by _ command looks (+size 10)
block ‘set size to _ %’ set size to _ % command looks (size= 100)
block ‘size’ size reporter looks (size)
block ‘show’ show command looks (show)
block ‘hide’ hide command looks (hide)
block ‘shown?’ shown? predicate looks (shown)
block ‘go to _ layer’ go to _ layer command looks (layer [front])
block ‘go back _ layers’ go back _ layers command looks (back 1)
block ’play sound _’ play sound _ command sound (play nil)
block ‘play sound _ until done’ play sound _ until done command sound (playAll nil)
block ‘stop all sounds’ stop all sounds command sound (stopSounds)
block ‘play sound _ at _ Hz’ play sound _ at _ Hz command sound (playAt nil 44100)
block ’_ of sound _’ _ of sound _ reporter sound (sound [duration] nil)
block ‘new sound _ rate _ Hz’ new sound _ rate _ Hz reporter sound (newSound nil 44100)
block ‘rest for _ beats’ rest for _ beats command sound (rest 0.2)
block ‘play note _ for _ beats’ play note _ for _ beats command sound (note 60 0.5)
block ’set instrument to _’ set instrument to _ command sound (instrument 1)
block ’change tempo by _’ change tempo by _ command sound (+tempo 20)
block ‘set tempo to _ bpm’ set tempo to _ bpm command sound (tempo= 60)
block ‘tempo’ tempo reporter sound (tempo)
block ’change volume by _’ change volume by _ command sound (+vol 10)
block ‘set volume to _ %’ set volume to _ % command sound (vol= 100)
block ‘volume’ volume reporter sound (vol)
block ’change balance by _’ change balance by _ command sound (+pan 10)
block ’set balance to _’ set balance to _ command sound (pan= 0)
block ‘balance’ balance reporter sound (pan)
block ‘play frequency _ Hz’ play frequency _ Hz command sound (freq 440)
block ‘stop frequency’ stop frequency command sound (stopFreq)
block ‘clear’ clear command pen (clear)
block ‘pen down’ pen down command pen (down)
block ‘pen up’ pen up command pen (up)
block ‘pen down?’ pen down? predicate pen (down?)
block ’set pen color to _’ set pen color to _ command pen (setColor "rgba(145,26,68,1)")
block ’change pen _ by _’ change pen _ by _ command pen (+pen [hue] 10)
block ’set pen _ to _’ set pen _ to _ command pen (pen= [hue] 50)
block ’pen _’ pen _ reporter pen (pen [hue])
block ’change pen size by _’ change pen size by _ command pen (+penSize 1)
block ’set pen size to _’ set pen size to _ command pen (penSize= 1)
block ‘stamp’ stamp command pen (stamp)
block ‘fill’ fill command pen (fill)
block ’write _ size _’ write _ size _ command pen (write Hello! 12)
block ‘pen trails’ pen trails reporter pen (trails)
block ’paste on _’ paste on _ command pen (paste nil)
block ’cut from _’ cut from _ command pen (cut nil)
block ’broadcast _ _’ broadcast _ _ command control (send nil)
block ‘broadcast _ _ and wait’ broadcast _ _ and wait command control (sendAll nil)
block ‘wait _ secs’ wait _ secs command control (wait 1)
block ’wait until _’ wait until _ command control (waitUntil nil)
block ’forever _’ forever _ command control (forever nil)
block ’repeat _ _’ repeat _ _ command control (repeat 10 nil)
block ’repeat until _ _’ repeat until _ _ command control (until nil nil)
block ’for _ = _ to _ _’ for _ = _ to _ _ command control (for i 1 10 nil)
block ’if _ _ _’ if _ _ _ command control (if nil nil)
block ’if _ _ else _’ if _ _ else _ command control (ifElse nil nil nil)
block ’if _ then _ else _’ if _ then _ else _ reporter control (ifThen nil nil nil)
block ’report _’ report _ command control (report nil)
block ’stop _’ stop _ command control (stop [all])
block ’run _ _’ run _ _ command control (run nil)
block ’launch _ _’ launch _ _ command control (fork nil)
block ’call _ _’ call _ _ reporter control (call nil)
block ’pipe _ $arrowRight _’ pipe _ $arrowRight _ reporter control (pipe nil nil)
block ’tell _ to _ _’ tell _ to _ _ command control (tell nil nil)
block ’ask _ for _ _’ ask _ for _ _ reporter control (ask nil nil)
block ’create a clone of _’ create a clone of _ command control (clone [myself])
block ’a new clone of _’ a new clone of _ reporter control (newClone [myself])
block ‘delete this clone’ delete this clone command control (removeClone)
block ‘pause all $pause’ pause all $pause command control (pause)
block ’switch to scene _ _’ switch to scene _ _ command control (scene [next])
block ’define _ _ _’ define _ _ _ command control (define block nil nil)
block ’delete block _’ delete block _ command control (deleteBlock nil)
block ’set _ of block _ to _’ set _ of block _ to _ command control (setBlock [label] nil nil)
block ’_ of block _’ _ of block _ reporter control (block [definition] nil)
block ’this _’ this _ reporter control (this [script])
block ’set slot _ to _’ set slot _ to _ command control (doSetSlot nil nil)
block ‘touching _ ?’ touching _ ? predicate sensing (touch [mouse-pointer])
block ‘touching _ ?’ touching _ ? predicate sensing (touchColor "rgba(145,26,68,1)")
block ‘color _ is touching _ ?’ color _ is touching _ ? predicate sensing (colorTouch "rgba(145,26,68,1)" "rgba(145,26,68,1)")
block ‘ask _ and wait’ ask _ and wait command sensing (doAsk "what's your name?")
block ‘answer’ answer reporter sensing (answer)
block ‘mouse position’ mouse position reporter sensing (mouse)
block ‘mouse x’ mouse x reporter sensing (mouseX)
block ‘mouse y’ mouse y reporter sensing (mouseY)
block ‘mouse down?’ mouse down? predicate sensing (mouseDown)
block ‘key _ pressed?’ key _ pressed? predicate sensing (key [space])
block ’_ to _’ _ to _ reporter sensing (relation [distance] [mouse-pointer])
block ’_ at _’ _ at _ reporter sensing (aspect [hue] [mouse-pointer])
block ‘reset timer’ reset timer command sensing (resetTimer)
block ‘timer’ timer reporter sensing (timer)
block ’current _’ current _ reporter sensing (current [date])
block ’_ of _’ _ of _ reporter sensing (attribute "[costume #]" nil)
block ’my _’ my _ reporter sensing (my [neighbors])
block ’object _’ object _ reporter sensing (object [myself])
block ’url _’ url _ reporter sensing (url snap.berkeley.edu)
block ’microphone _’ microphone _ reporter sensing (audio [volume])
block ’video _ on _’ video _ on _ reporter sensing (video [motion] [myself])
block ’set video transparency to _’ set video transparency to _ command sensing (transparency 50)
block ‘is _ on?’ is _ on? predicate sensing (global "[turbo mode]")
block ’set _ to _’ set _ to _ command sensing (global= "[video capture]" nil)
block ’_’ _ reporter operators (+ nil nil)
block ’_ − _’ _ − _ reporter operators (- nil nil)
block ’_’ _ reporter operators (* nil nil)
block ’_ / _’ _ / _ reporter operators (/ nil nil)
block ’_ ^ _’ _ ^ _ reporter operators (^ nil nil)
block ’_ mod _’ _ mod _ reporter operators (mod nil nil)
block ’_’ _ reporter operators (min nil nil)
block ’_’ _ reporter operators (max nil nil)
block ’round _’ round _ reporter operators (round nil)
block ’_ of _’ _ of _ reporter operators (fn [sqrt] 10)
block ’atan2 _ ÷ _’ atan2 _ ÷ _ reporter operators (atan2 nil nil)
block ’pick random _ to _’ pick random _ to _ reporter operators (rand 1 10)
block ’_’ _ predicate operators (< nil nil)
block ’_’ _ predicate operators (= nil nil)
block ’_’ _ predicate operators (> nil nil)
block ’_’ _ predicate operators (and nil nil)
block ’_’ _ predicate operators (or nil nil)
block ’not _’ not _ predicate operators (not nil)
block ’_’ _ predicate operators (bool t)
block ’join _’ join _ reporter operators (join "hello " world)
block ’split _ by _’ split _ by _ reporter operators (split "hello world" " ")
block ’letter _ of _’ letter _ of _ reporter operators (letter 1 world)
block ’_ of text _’ _ of text _ reporter operators (text [length] world)
block ’unicode of _’ unicode of _ reporter operators (unicode a)
block ‘unicode _ as letter’ unicode _ as letter reporter operators (toLetter 65)
block ‘is _ a _ ?’ is _ a _ ? predicate operators (is 5 [number])
block ‘is _ ?’ is _ ? predicate operators (same nil nil)
block ‘JavaScript function ( _ ) { _ }’ JavaScript function ( _ ) { _ } reporter operators (js nil nil)
block ’set _ to _’ set _ to _ command variables (set nil 0)
block ’change _ by _’ change _ by _ command variables (+= nil 1)
block ’show variable _’ show variable _ command variables (showVar nil)
block ’hide variable _’ hide variable _ command variables (hideVar nil)
block ’inherit _’ inherit _ command variables (inherit nil)
block ’list _’ list _ reporter lists (list nil)
block ’numbers from _ to _’ numbers from _ to _ reporter lists (range 1 10)
block ’_ in front of _’ _ in front of _ reporter lists (cons nil nil)
block ’item _ of _’ item _ of _ reporter lists (item 1 nil)
block ’all but first of _’ all but first of _ reporter lists (cdr nil)
block ’_ of _’ _ of _ reporter lists (data [length] nil)
block ’index of _ in _’ index of _ in _ reporter lists (# thing nil)
block ’_ contains _’ _ contains _ predicate lists (contains nil thing)
block ‘is _ empty?’ is _ empty? predicate lists (empty nil)
block ’map _ over _’ map _ over _ reporter lists (map nil nil)
block ’keep items _ from _’ keep items _ from _ reporter lists (keep nil nil)
block ’find first item _ in _’ find first item _ in _ reporter lists (find nil nil)
block ’combine _ using _’ combine _ using _ reporter lists (combine nil nil)
block ’for each _ in _ _’ for each _ in _ _ command lists (forEach item nil nil)
block ’add _ to _’ add _ to _ command lists (add thing nil)
block ’delete _ of _’ delete _ of _ command lists (del 1 nil)
block ’insert _ at _ of _’ insert _ at _ of _ command lists (ins thing 1 nil)
block ’replace item _ of _ with _’ replace item _ of _ with _ command lists (put 1 nil thing)
block ’append _’ append _ reporter lists (append nil nil)
block ’reshape _ to _’ reshape _ to _ reporter lists (reshape nil 4 3)
block ’combinations _’ combinations _ reporter lists (combinations nil nil)
The Snap! Community Site
move steps
  • Report an issue