| Snap! | |
|---|---|
| Paradigm | object-oriented,educational,event-driven |
| Designed by | Brian Harvey andJens Mönig |
| Developer | Jens Mönig |
| First appeared | 2011; 14 years ago (2011) |
| Stable release | |
| Typing discipline | dynamic |
| Implementation language | Morphic.js[2] (written inJavaScript);[Note 1] |
| OS | Cross-platform |
| License | AGPL |
| Filename extensions | .xml (Snap!) |
| Website | snap |
| Influenced by | |
| Scratch,Scheme,Logo,Smalltalk,APL | |
| Influenced | |
| Scratch, BeetleBlocks, NetsBlox, Dragme IDE,Turtlestitch | |
Snap! (formerly Build Your Own Blocks) is a free block-basededucational graphical programming language andonline community. Snap allows students to explore, create, and remix interactive animations, games, stories, and more, while learning about mathematical and computational ideas. While inspired byScratch, Snap! has many advanced features. The Snap! editor, and programs created in it, areweb applications that run in the browser (likeScratch) without requiringinstallation.[Note 2] It is built on top ofMorphic.js,[2] aMorphic GUI, written by Jens Mönig as 'middle layer' between Snap! itself and 'bare' JavaScript.
In Snap!, the screen is organized in three resizable columns containing five regions: the block group selector (top of left column), the blocks palette (left column), the main area (middle column), and the stage area (top of right column) with the sprite selector (also called the sprite corral) showing sprite thumbnails below it.[Note 3]
In the interactively resizable stage area are shown the graphical results of the scripts running in the script area and/or interactively double-clicked individual blocks in any palette. Individual blocks can be dragged from the palette onto the scripts area to be associated with the selected sprite.
| Category | Notes | Category | Notes | ||
|---|---|---|---|---|---|
| Motion | Moves and turns sprites | Control | If statements, events, loop structures, scenes, OOP, metaprogramming | ||
| Looks | Controls visibility, costumes, and output | Sensing | All sprite hit detection and user input | ||
| Sound | Plays audio files and programmable sequenced audio | Operators | Mathematical, text, and Boolean operators; lambda | ||
| Pen | Write, draw, or stamp on stage | Variables | Variables, lists, including lists of lists, lists of blocks, etc. | ||

Snap!'s blocks are divided into eight groups: Motion, Looks, Sound, Pen, Control, Sensing, Operators, and Variables. The layout of these groups in the block group selector is shown in the table below.
The central area can show scripts, costumes/backdrops, or sounds associated with the selected sprite. What that area shows depends on the selected tab.
The most important features that Snap! offers, but Scratch does not, include:

Alonzo, the mascot of Snap!, is a modified version of Gobo fromScratch, with permission from the Scratch Team. He is named afterAlonzo Church[citation needed], the inventor oflambda calculus, and his hair is based on the Greek letterlambda.
Extended sets of blocks can be found in Snap! libraries, such as the'streams' library that enables one to make the complete, infiniteFibonacci sequence, for example, using the special blocks ('stream', 'show stream', 'tail of stream', and 'map ( ) over stream' block) from the library.
Many other libraries are available, such as the 'list utilities' library, the 'words, sentences' library, the 'iterations' library, the 'animation' library, the 'frequency distribution' library, the 'audio computation' library, the 'bar charts' library, the 'world map' library, the 'colors and crayons' library, the 'strings and multi-line input' library, the 'parallelization' library, etc. for other special purposes.
While the software itself has little restraints, it does have some limitations.
These include:
The web-based Snap! and older desktop-based BYOB were both developed by Jens Mönig forWindows,OS X andLinux[4] with design ideas and documentation provided byBrian Harvey[5] fromUniversity of California, Berkeley and have been used to teach "The Beauty and Joy of Computing" introductory course incomputer science (CS) for non-CS-major students.[6] Jens was a member of the Scratch Team before creatingSnap!.[7] BYOB is still available for downloading.
The source code of Snap! isGNU Affero General Public License (AGPL) licensed and is hosted onGitHub.[8] The earlier, desktop-based 3.x version's code is available under a license that allows modification for only non-commercial uses and can be downloaded from the UC Berkeley website[9] orCNET'sdownload.com and TechTracker download page.[10][11]
Snap! runs on the major web-browsers onWindows,iOS,MacOS andLinux devices.
Supported web-browsers such as
Snap! is built on top ofMorphic.js,[2] aMorphic GUI, which serves as 'middle layer' between Snap! itself and 'bare' JavaScript. It uses anHTML5 Canvasapplication programming interface (API).
All things visible in Snap! are morphs themselves, i.e. all buttons, sliders, dialog boxes, menus, entry fields, text rendering, blinking cursors etc. are created with morphic.js rather than using HTML DOM elements. Snap! caches the shapes ofsprites so the sprite doesn't have to be re-drawn onto a new Canvas element every time the mouse moves over its bounding box. It does not cache blocks, however. Instead it manages the insides of C-shaped blocks through the morphic "holes" mechanism.
All user interaction is triggered by events, which are passed on from the root element "the world" to its submorphs. Dropping a morph causes it to become embedded in a new 'owner' ('parent') morph. In Morphic the preferred way to run an animation is to register it with the World by adding it to the World's animation queue. The World steps each registered animation once per display cycle independently of the Morphic stepping mechanism.
Snap! has been recognized by the Logo Foundation,[12] and reviewed in an online magazine for programmers.[13] As of December 2014, 100 New York City (NYC) high schools introduced University of California, Berkeley's “Beauty and Joy of Computing” as a new AP Computer Science Principles course, using Snap!.[14] Jens and Brian received the National Technology Leadership Summit (NTLS) 2020 Educational Leadership Award for lifetime achievement based in part on Snap!.