How to Upload Snap! Project on Website

Document.png This article or section needs additional citations for verification. Its data may not be accurate. Editors tin aid by adding references. (January 2022)
SandCastleIcon.png This article has links to websites or programs not trusted by Scratch or hosted past Wikipedia. Remember to stay safe while using the cyberspace, as nosotros cannot guarantee the safety of other websites.
Snap! (Build Your Ain Blocks)
Snap-logo.png
Version 7.iii.0
Operating Systems Any HTML5-compliant Spider web Browser (including iOS and Android tablets)
Purpose for creation Edifice your own blocks; everything first form
Developer(s) Jens Mönig, Brian Harvey, Michael Ball, Bernat Romagosa, others
Open up source? Aye (AGPLv3)
Programming linguistic communication JavaScript (and HTML as Markup Linguistic communication)
Released? Yes
Compatible with Scratch 1.three, ane.4, 2.0 and iii.0
Official Website https://snap.berkeley.edu
Archived Forum Topic ar-topic:34284
2.0 Forum Topic topic:4455

Snap! , too known as Build Your Own Blocks or BYOB, is an extended reimplementation of Scratch featuring kickoff-class procedures, excellent lists, and first-class sprites with inheritance. An earlier version, BYOB, was a modification of the Scratch one.four source code, but the electric current version is an entirely separate program, fifty-fifty though its user interface looks like Scratch 1.4 and information technology includes almost all of its primitive blocks. BYOB was originally developed by Scratcher Jens; as of BYOB 3.0, Scratcher bharvey joined as co-developer. (The code is still well-nigh all written past Jens; bharvey has contributed to the blueprint, libraries, and documentation, likewise every bit online mentoring of Snap! users.)

Note Note: Scratch has been phenomenally successful at introducing young people to computer programming; part of that success has been the detailed, thoughtful design of each small piece of the linguistic communication. In particular, they decided to leave out some features, to avert confusing young users. The tl;dr explanation of Snap! is that it added those missing features. When the article says "In Scratch, it is not possible to..." please bear in heed that Snap! was designed to teach calculator science courses to teenagers. A decision may be good for the Scratch target audition, only not for the Snap! target audience. In every example, the Scratch Team was enlightened of the possibilities that they decided to omit. Zero in this article is meant to insult them.

Features

The main features added in Snap! are custom blocks (making user-created blocks), first-form procedures, first class lists, offset class sprites with object inheritance, first-class costumes and sounds, hyperblocks, scenes, syntactic introspection, and an enhanced user interface.

This commodity discusses only the most important features; consult the Snap! Reference Manual for a more approved guide.

Build Your Own Blocks 1.0 Features

BYOB ane.0 was released on October 21, 2008.[1] It was based on Scratch ane.3.[1] Hither is a figure from its documentation showing how a block can be fabricated recursive.

BYOB1.png

Custom Blocks

The ability to make custom blocks was the first goal of BYOB, as reflected in its name. A limited version of this capability, allowing only stack blocks, afterward became part of Scratch 2.0. What is described hither is the current form of this feature, which changed dramatically in BYOB3.

To brainstorm making a block, utilize the button at the end of each palette, the semitransparent "+" sign at the superlative of the palette, or the "make a block" option when right-clicking on the scripting area background.

Make-button.png Plus-sign.png Context-menu.png

Block-dialog.png

In the dialog that appears, besides giving the cake a name, the user can choose its palette category (color), its shape (command, reporter, or predicate), and whether information technology is for all sprites or just i.

Clicking OK opens a block editor window, essentially a divide scripting expanse merely for this block definition. In the block editor, the user can add inputs to the block, and optionally ready the type of an input, as well as calculation the script that defines the block's actions. The use of a separate editor window is very different from the Scratch 2.0 design of custom blocks, in which all custom blocks are purple, sprite-local, and visible in the sprite's scripting area. The color isn't then of import, but the thought behind information technology is: The Scratch pattern treats a custom block as something very different from a primitive block. The Snap! blueprint tries to brand custom blocks just every bit expert as archaic blocks; ideally, once a block is written, it might as well be primitive. The fact that Scratch custom blocks are sprite-local is a result of the fact that their definitions have to appear in the scripting area of some detail sprite. Keeping the block definitions visible in the scripting area emphasizes that a custom block is essentially an abridgement for a script, and ensures that all of the user's code is visible to the user. But keeping the definitions visible partly defeats the purpose of writing procedures, namely, to hide details and programme at a higher level of abstraction.

Some other divergence is the treatment of inputs to a custom cake. Within the Scratch block definition, an input is represented by a majestic oval containing the name of the input. These inputs are variables, simply Scratch treats a procedure input every bit something very dissimilar from a (global) variable. In Snap!, the inputs are orange ovals, similar other variables, and their values can be changed with set blocks. Likewise, procedures can take local variables that aren't inputs, using the script variables ((a)::grey) @delInput @addInput ::grayness cake to create them. Like inputs, these script variables be but inside the script. Every invocation of the block creates a separate set of script variables; this is particularly important when using recursion, avoiding the demand for the user to construct an explicit stack.

Build Your Ain Blocks two.0 Features

BYOB 2.0 was released on Baronial 30, 2009.[ citation needed ] Information technology updated the underlying Scratch code to version one.4 and added several UI improvements, including Undo.[ citation needed ]

Nested Sprites

A major feature added in BYOB 2.0 was the ability to make a collection of sprites that motion together. The canonical instance is a skeleton in which each bone is fastened to 1 closer to the spine; the entire skeleton tin can rotate together, or a detail bone can rotate relative to the whole.

Swimmer.png

BYOB Version three

The well-nigh important alter in Version three was first grade procedures, commencement form lists, and first class sprites.

Build Your Own Blocks 3.0 Features

BYOB3 was released April 25, 2010.[2] Information technology introduced first class procedures and lists.

First class procedures

Command-ring.png Reporter ring.png Predicate ring.png

A data type is offset course in a language if information technology can exist used in all the same ways every bit any other data blazon. For example, in Scratch, it'southward easy to make a list of numbers, but a list of lists is incommunicable; numbers are first form, but lists aren't. Ane of the slogans of Snap! is "Everything first form." The biggest, most important difference between BYOB2 and BYOB3 was that the latter introduced first class procedures. The grey rings to a higher place are used to allow procedures (blocks and scripts) as data. A picture is worth chiliad words hither:

2plus3.png 2plus3ring.png

On the left, clicking the unringed two+3 gives 5. On the right, putting 2+three in a band gives the ((two) + (3)) block itself.

The only reason to create a ringed procedure is that subsequently it volition be called.

Users can create their own command structures, eastward.thousand., abstracting a repeated call of a part for each particular of a listing:

Mapdef.png Mapblock.png Mapcall.png

Although making procedures first class was the most important change in BYOB3, it took Jens and bharvey three tries to get the note right. One of the best things nearly Scratch is the careful pattern of each syntax element (e.g., C-shaped blocks) so that the underlying figurer science idea (e.g., looping) is obvious to a Scratch learner simply from seeing the visual presentation (east.g., the (:: command loop) arrow at the lesser of a looping block).

In BYOB3, the representation for an encapsulated block, what's now the grayness ring, was the clunky (the [] block :: operators) for reporters, and The script.png for commands. The current representation, the grey ring, was perfected by providing a grey ring as the input slot in blocks that look a procedure equally input, such as call and map above. Every bit a issue, users rarely have to bargain explicitly with the rings. If i is needed, it's already there. Dragging a ringed block into an input slot with a ring "absorbs" the extra ring; dragging a variable into an input slot with a ring removes the band since the meaning is almost always that the variable'southward value is the wanted expression to run.

When reading the map example above, was it immediately obvious that each list detail is plugged into the empty slot in the (() + (3)) block? Unproblematic school teachers all know that if an viii-twelvemonth-old is presented with "ten+three=7" and asked "what's x?" they are likely to get a blank stare, but if the same kid is shown "☐+3=7" and asked "what number goes in the square?" they are likely to reply "iv."[ citation needed ] Snap! uses that knowledge in the design of the notation for functions. When a grayness-ringed function with input is called, call looks for an empty input slot inside the ring, and that's where the input value is inserted. This annotation makes unproblematic function calling obvious, in the Scratch spirit of trying to use the visual representation to make ideas obvious. The empty input slot mechanism is not good enough for the complicated cases, such as nesting a map call inside the function input to another map call. For those cases grey rings can be given explicit input names, but like a custom block: (((x::variables) + (3)) input names: (x::variables) @delInput @addInput :: grey ring).

In the computer science literature, the equivalent of a grayness ring is a lambda expression: λx. ten+3. "Lambda" (λ) is the Greek letter l. In Lisp, the programming language that brought lambda expressions to the attending of a wider range of programmers, they are written this way: (lambda (10) (+ x 3)). "Lambda" is spelled out because they did non take Unicode back and so, although at the Stanford and MIT Artificial Intelligence Labs they used special keyboards that did have λ keys.

Offset form lists

Adding lambdas to Scratch fabricated it possible to invent any control structure; the other large trouble with Scratch is that lists can't exist items of other lists, so it is not possible to straightforwardly build complex data structures. In Scratch, a list is, sort of, a kind of variable: It has a name and a value, just like a variable, but the value has sub-values (the items). Scratch provides a scarlet oval for the listing, like the orange one for a variable, but the value information technology reports isn't the actual list; it's a chain of all the items, separated by spaces. This works because only strings and numbers can exist items in a list.

Scratch lists combine two logically separate capabilities. The primary capability of a list is that it can add, change, delete, and report items. The second capability is associating a proper noun with the list, and that should instead exist the task of a variable. If a user wants a list with items "one," "two," and "three," and wants to telephone call the list "list," it should be possible to say prepare [list five] to (list [1] [2] [three] @delInput @addInput:: list).

The list block is the only completely new adequacy needed to support lists as first-class data. The existing Scratch listing blocks practise everything else that'due south needed, but since names are no longer necessarily associated with lists, the dropdown listing-name inputs in the Scratch list blocks are replaced with list-type input slots: Listblock.png. The white rectangle with thick orange lines within is meant to look like a list watcher, with orange items.

Minimal footprint

When BYOB3 was released in 2010, its developers nonetheless hoped that the Scratch Team would exist persuaded to add its features to Scratch itself. Bharvey created a project addressed to the Scratch Team for this campaign. The blueprint therefore minimized the number of new blocks added, creating new user interface features such as variable-arity blocks that might otherwise take been multiple blocks: (call (() @addInput :: grey ring) @addInput::control) versus (call (() @addInput :: grayness ring) with inputs: [] @delInput @addInput::control) versus (call (() @addInput :: grey band) input list: (listing [input1] [input2] ...::list) ::control).
In the end, simply vii blocks and one button were needed:

Just8.jpg

(Run and launch are the equivalent to call for scripts of control blocks; run is like circulate and await while launch is like broadcast, not waiting for the launched script to finish. Report is what a custom reporter or predicate uses to report a value to its caller.)

BYOB 3.0 really had a few more blocks, just for convenience, not related to these cadre features. For example, the <truthful::operators> and <false::operators> Boolean value reporters were added, to avoid some advertisement hoc idioms in Scratch programs that needed Boolean constants.

Build Your Ain Blocks 3.1 Features

Splendid sprites and prototype-mode inheritance were the master changes in BYOB 3.ane, officially released May eighteen, 2011,[ citation needed ] but with development versions bachelor online for several months before the official release.[ commendation needed ]

Outset Course Sprites with Inheritance

Object-oriented programming is a style based around the brainchild object: a collection of data and methods (procedures, which in Snap! are only more than data) that is interacted with by sending it a message (just a name, maybe in the class of a text string, and perhaps additional inputs). The object responds to the message past conveying out a method, which may or may not report a value dorsum to the asker. Some people emphasize the data hiding aspect of OOP (because each object has local variables that other objects can access only by sending request letters to the owning object) while others emphasize the simulation aspect (in which each object abstractly represents something in the globe and the interactions of objects in the programme model real interactions of existent people or things). Information hiding is of import for big multi-programmer industrial projects, but for Snap! users it's the simulation aspect that's important. The Snap! approach is, therefore, less restrictive than that of some other OOP languages; objects are given easy access to each others' data and methods.

Scratch provides a very natural fix of objects, namely, sprites. Object-oriented programming rests on three legs:

  1. Persistent local state. An object must be able to call back its history from one activeness to the adjacent, in variables whose names are private to that object. Scratch sprites have this, in the class of "for this sprite only" variables.
  2. Message passing. Ane object has to exist able to ask another object to do something, by sending information technology a message. Scratch doesn't exactly take this capability, but a sprite can circulate a message to all sprites. Snap! adds truthful message passing, in which the messages take the form of blocks or scripts, which are carried out using the local blocks and variables of the receiver.
  3. Inheritance. It's very common for two or more objects to share some methods (local procedures). Object-oriented programming would exist hopelessly complicated if the methods had to be duplicated by hand in each object. And then object-oriented languages provide a mode for one object to inherit methods and information from another. Starting in Scratch two.0, there is a restricted course of inheritance: Information technology's possible to clone a sprite, but the resulting sprite is a re-create of the original, and is temporary; when the program stops running, the temporary clones are deleted. Temporary clones are skillful for things like the bricks in a Breakout game; they all have the same beliefs, just dissimilar positions, and tin exist recreated at the start of each new game. But sometimes a project needs permanent clones; i example would be the four ghosts in a Pacman game, each of which has slightly different behavior. Snap! provides both kinds of cloning: Clones created in a program, using the create a clone of [ v]::control block or, since sprites are first-form information in Snap!, the new (a new clone of [myself v]::control) reporter, are temporary. Clones created from the user interface, e.g., by correct-clicking on a sprite icon in the sprite corral and choosing the "clone" option from the context menu, are permanent; they appear in the sprite corral, are independently editable, and are saved with the project.

A clone is not a copy of its parent; it shares the attributes of the parent. And so, for example, if a costume of the parent is deleted, it's gone in the child also. However, if something is changed in the kid, then the connection of that attribute with the parent is broken, and the kid has a split up one of whatever it is. If the child imports a new costume, its entire wardrobe (the list of all its costumes) is copied from the parent, then the new costume is added, and thereafter the two sprites are contained concerning costumes.

Information technology could be disruptive if a child shares some attributes of its parent but non others. To avoid confusion, attributes represented by palette blocks are ghosted in the kid's palette and variable watchers:

Methods.png Vars.png Watchers.png Xypos.png Xywatch.png

A kid breaks an attribute's inheritance from its parent by changing its value. If the child'south position is inherited, motion ( ) steps will break the inheritance of both x and y position. Simply gear up x to ( ) will interruption the inheritance of the 10 position, leaving the inheritance of the y position intact.

What if a child has broken the inheritance of some attribute and now wants to restore inheriting that attribute from its parent? A new block inherit [x position v]::variables allows that. The dropdown menu includes the standard sprite attributes, but variables and other attribute blocks tin be dropped on the menu input slot if enclosed in a ring: inherit ((var::variables) @addInput :: grey ring)::variables inherit ((x position) @addInput :: grey band)::variables.

Prototyping vs. Class/Instance OOP

Readers who have programmed in class/example languages may experience that what is described here is non OOP. But classes are not necessary, and are harmful in a dynamic, interpreted language that encourages tinkering. Class/instance programmers typically design their entire form hierarchy before actually writing code. That is an appropriate subject field for a large group of programmers working on the same program, simply non for one child designing a project on the fly. What the child wants to do is build, for example, a dog sprite, and program information technology with behaviors similar to those of their pet cocker spaniel. Then the child decides to add together a Rottweiler to the project. It should inherit most of the behaviors of the cocker spaniel, but with a few differences. This OOP structure is called prototyping or prototype-based OOP.

If classes are necessary, make a sprite, requite information technology children, and then hide the parent. The parent is so effectively a class.

Another way in which this OOP design is nontraditional is that it uses blocks (procedures) as messages, and whatever cake can be used, not but the ones that the receiver has declared equally public methods. As explained earlier, in the Snap! pattern, data hiding is less important than simulation, the use of objects as metaphors for some real arrangement of agents.

Note Annotation: Note: OOP does not crave a special OOP linguistic communication. If a linguistic communication has outset-form procedures and lexical scope, and then it's possible to build an object arrangement in the linguistic communication. Run across the Snap! Reference Manual for details.
Details in BYOB iii.1 Inheritance vs. Snap! 4.1

Version 3.1 predated Scratch ii.0, so information technology didn't include Scratch-fashion temporary clones; all clones, whether made in the GUI or a program, were permanent (until explicitly deleted). Also, the developers thought that users would nigh likely want to inherit sure sprite attributes and not others, and tried to guess which were which. Feel later showed that users found it easier to empathize if all attributes were initially inherited, specially since assigning a new value to the child'southward aspect breaks the inheritance, probably just what the user wants.

Snap! Version 4

Snap! was a complete reimplementation of BYOB. Besides the name modify, the main user-visible changes in version 4 were Web access, the ability to use JavaScript in defining custom blocks, and first class continuations.

Snap! iv.0 Features

Document.png This article or department needs boosted citations for verification. Its information may not exist accurate. Editors can help by adding references. (January 2022)

Snap! 4.0, released May i, 2015,[ citation needed ] was a consummate rewrite in JavaScript, to run in a browser considering teachers had complained that their schools wouldn't let them download software.[ citation needed ] Development started in 2011, most the aforementioned fourth dimension that the Scratch Team started working on Scratch 2.0.[ citation needed ] They, too, wanted to run in a browser. One difference between the 2 projects was that Scratch chose to use Adobe Flash, whereas Snap! was built around HTML5 Sheet. Both teams knew that Flash was a moribund engineering science,[ citation needed ] and Canvas just beginning, but the Scratch Team felt that they couldn't afford to lose admission to the user'due south camera and microphone, and the power to use the MIDI musical instrument timbres.[ citation needed ] None of those were bachelor in HTML5 and JavaScript in 2011. By contrast, the Snap! team, with no budget and one developer, needed four.0 to be on a platform that would terminal a long time. BYOB3 was based on the Scratch 1.4 source code, but Snap! is entirely separate from Scratch 2.0 and afterwards.

From the outset of using BYOB in high schools, there were a few complaints about the inappropriateness of the name.[ citation needed ] Feel has shown that people outside the USA don't understand why this pun could be considered inappropriate, and even in the USA inappreciably anyone has seen a problem with it.[ citation needed ] Merely the few who did complain were very emphatic about it, saying that their schools would never allow them to use software with that name.[ citation needed ]

Then, reluctantly, the team looked for a somewhat relevant name that wasn't already the name of a programming language. Nobody really loved "Snap," which doesn't suggest much personality, but at least the blocks snap together. Bharvey insisted on adding the assertion point, for a slight suggestion of personality, and it became italicized after Scratcher nXIII designed the logo, in which it's italicized.[ citation needed ]

For the most part, Snap! 4.0 reproduces the functionality of BYOB iii.0. Also, Snap! four.0 introduced fantabulous continuations, Web access, linked lists, and the ability to write custom blocks in JavaScript.

Get-go Class Continuations

Before joining the Snap! projection, Bharvey had spent twenty years didactics computer scientific discipline using what many people consider the best introductory CS textbook, Structure and Interpretation of Computer Programs (SICP). The course uses the Scheme programming linguistic communication, although it's not about Scheme, because information technology's the language that provides the greatest versatility in supporting unlike programming styles with the least amount of syntax to get in the manner. Scheme has been the model for BYOB/Snap! linguistic communication blueprint since BYOB 3.0. One of the team'due south slogans is "Snap! is Scheme disguised as Scratch."

BYOB 3.0 was perhaps xc% of a Scheme implementation, plenty to teach a SICP-based course, but missing two primary advanced capabilities. One, macros, is half-implemented since BYOB 3.0, namely the power for a custom cake to have unevaluated inputs. (The other half, the power to inject lawmaking into the caller of the cake, is still to come up.) The second big advanced capability is excellent continuations.

The continuation of a block in a script is the part of the computation that remains to be done when that cake has been run. For a command block, this generally means the blocks beneath it in the script (plus whatever remains of the script that chosen this cake, and then on). For a reporter, information technology means the block to which this block provides an input, plus whatsoever comes below it.

Continuations are not a special characteristic of Scheme. Any part of a ciphering, in any linguistic communication, has a continuation—whatever is left to exercise after it finishes. Just in nigh languages, the programmer isn't called upon to recollect of the continuation as a thing, although the implementor of the programming language does think about continuations. What's special nearly Scheme is that information technology treats continuations as showtime-course data. Giving the programmer access to continuations allows users to write any control structure; the most common examples are nonlocal exit (catch and throw in the Snap! "Iteration, composition" library) and a thread scheduler.

Even SICP doesn't teach first-class continuations as an introductory topic, although information technology does teach a related idea, "continuation passing style." Adding first-class continuations to Snap! was more planting a flag than coming together a practical demand.

The feature is embodied in two blocks, run ({} @addInput :: grey ring) w/continuation::control and (phone call ({} @addInput :: greyness ring) w/continuation::control).

Web access

Snap! 4.0 introduced the (http:// [snap.berkeley.edu]::sensing) block (later renamed URL to allow https connections), which reads a Web page and reports the contents of the folio (typically HTML code). This turned out to exist less useful than hoped because browsers restrict "cross-site" references for security reasons. Sometimes a "CORS proxy" site can be used to go around the problem; details are beyond the scope of this article.

Linked lists

The information construction that Scratch (and therefore BYOB) calls a "listing" is implemented as a dynamic array, i.east., a face-to-face block of memory that is expanded every bit needed. A linked list is a different data structure made out of pairs; each pair contains one list detail plus a arrow to another pair, and so the entire list contains as many pairs every bit items, and they don't have to be contiguous in memory. As it turns out, dynamic arrays are nearly efficient in sequential, imperative programming, while linked lists are more efficient for recursive, functional programming.

For case, given a list of numbers (input listing:: variables), the goal is to make a list in which every particular is 2 times the corresponding detail of the input.

Set-to-double.png

Double-iterative.png

Double-recursive.png

In the iterative version, the add control cake extends the size of the list by one item each time it'due south invoked. This kind of list access is fastest with dynamic arrays.

In the recursive version, the in front of block creates a new pair, whose left half is a new item, and whose right half is (a pointer to) the result of the recursive telephone call, namely a sublist of the result. This is the fastest with linked lists.

It is a goal of Snap! that users not accept to know anything well-nigh data structures, but still have their project run every bit fast as possible. Therefore, Snap! automatically creates linked lists when the reporters (all merely first of, in front of) are used, but creates dynamic arrays when the commands (add, insert, replace, delete) are used. The just time the resulting programs aren't equally efficient as possible is if the user uses both styles of programming with the aforementioned list, which must then be converted from i form to the other. (It should be noted that none of this matters for small lists. It becomes important in "big data" projects that have lists of, possibly, hundreds of thousands of items.)

JavaScript in custom blocks

Another new thing in Snap! 4.0 has turned out to exist the (JavaScript function \( [] @delInput @addInput \) \{ [] \}::operators) block. In this example, never mind what it actually does; instead, notice how inputs are passed from the Snap! surround to the JavaScript world.

Speak-block.png

This example comes from a text-to-spoken language library. Many libraries have been written by advanced users; writing libraries is a style users who think they've learned everything Snap! has to teach tin explore JavaScript programming while remaining in, and contributing to, the Snap! community.

Snap! 4.1 Features

Snap! 4.1, released Oct. 22, 2017,[ commendation needed ] added offset-course sprites with inheritance, every bit in BYOB 3.1, except that the distinction betwixt permanent and temporary clones was added. Also, costumes and sounds are first class.

Snap! 4.2 Features

Snap! 4.two, released June 22, 2018,[ citation needed ] most notably added automatic backup of projects stored in the deject, so users tin can recover from disasters such equally saving an empty project with the aforementioned name as an important one. It also has the get-go of a vector costume editor.

Snap! Version five

Version 5 marked the growth of Jens's interest in media computation, which requires very efficient processing of very large lists. Thus, the higher society functions, which were written in Snap! in a library in version iv, were changed to primitives, even though the user'south ability to write higher social club functions was 1 of the main features distinguishing BYOB/Snap! from Scratch.

Although costumes and sounds were already start class in version 4, they were opaque objects. Version v added the ability to manipulate the contents of those objects: pixels and samples.

As computer science educators became more interested in information science, Snap! added the ability to import spreadsheets and accept them automatically converted to lists of lists.

Finally, and maybe most important, the previously static web site snap.berkeley.edu was replaced with a Scratch-style interactive community hub.

Snap! v.0 Features

Snap! 5.0, released June 27, 2019,[ citation needed ] most notably added automated conversion of text, spreadsheet (CSV), or JSON files that are dragged onto the Snap! window to lists, in a variable named after the filename. An option in the variable watcher allows for conversion in the other management, from structured list to text.

Many new primitives were added for media computation, allowing manipulation of costumes and sounds, with access to individual pixels or samples, respectively.

Another very notable change was that many blocks previously included in the Tools library became primitives. This change is intimately related to the media computation features, which made it important to be able to process lists with hundreds of thousands of items apace. The downside of this change is that it robs learners of the feel of writing blocks such as map or for in Snap! itself, with very short, simple scripts. (That is, learners can nevertheless do that, but they're less probable to meet a need for it when those tools are provided automatically.)

At the same fourth dimension, the former static home folio at https://snap.berkeley.edu was replaced with a dynamic community site with featured projects, recent projects, per-user display of published projects, and so on, similar to the Scratch site only less featureful. A divide just linked Discourse-powered forum was added later.[when?]

Snap! 5.1 Features

Snap! 5.1, released August 8, 2019,[ citation needed ] had improvements to the media computation primitives, a new paste on cake that stamps a sprite onto another sprite rather than onto the stage, and the important ability to alter the temporary/permanent status of a clone programmatically (in a script).

Snap! 5.two Features

Snap! 5.2, released October 24, 2019,[ citation needed ] added further improvements to media computation, most notably the constructors new costume and new sound to create anonymous media objects from their components (pixels or samples).

Snap! Version 6

The biggest change to the Snap! implementation in version 6 was a complete rewrite of Morphic, merely this was invisible to users except for greater reliability and speed.

The major user-visible modify was adding support for operations on vectors and matrices, in the form of lists and lists of lists, respectively. The inspiration for this change was the language APL, which was before its time both in vector and matrix back up and in its heavy use of characters not in the ASCII character fix of its day, such as Greek letters to represent mathematical functions. (This latter characteristic prevented APL from widespread use in the 1960s.) The main APL-inspired feature in Snap! itself is hyperblocks, which are functions of not-lists expanded to accept list inputs; the underlying scalar (not-list) functioning is applied to the lists' items term by term, much like an implicit map over the lists. The length archaic was extended to compute other functions of lists, such equally interchanging rows and columns. The item primitive was extended to take lists of particular numbers to find items in lists of lists to any depth. The full APL characteristic ready is bachelor as a library.

Snap! half dozen.0 Features

Snap! 6.0, released July 8, 2020,[ citation needed ] had 2 very substantial changes. Showtime, the underlying morphic.js graphics engine was entirely rewritten to use a separate canvas to render each morph, instead of editing pixels in 1 large sail. This modify was a response to a Chrome misfeature that was causing Snap! windows to plough white and freeze, but it has had farther advantages in reducing the memory footprint of projects and, in many cases, speeding them up.

2nd, the scalar operators (functions of one or 2 individual numbers or strings, such every bit + and join, not ones that crave lists as inputs) were turned into hyperblocks, meaning that they behave as always for atomic (numeric or text) inputs, but besides have lists every bit inputs, calling the underlying scalar function for each atom (or each matching pair of atoms, for dyadic operators):

Matrix-add.png Vector-length.png

Hyperblocks allow for extremely fast processing of media information. They don't quite do everything you'd like to do with vectors and matrices, though; for example, hyperized multiplication of two matrices just multiplies matching cells by pairs; real matrix multiplication is very different from that. The APL library implements the array primitives of the language APL, which is built effectually vectors and matrices as data types. Come across Appendix B of the Reference Manual.

Snap! 6.1 Features

Snap! 6.i, released July 30, 2020,[ commendation needed ] stock-still several bugs, added documentation on the migration process for Snap! extensions based on the quondam Morphic to be able to work with the new one, and added the "fade blocks" options:

Fade-solid.png Fade-medium.png Fade-shimmering.png Fade-elegant.png

Snap! 6.2 Features

Snap! 6.ii, released September 7, 2020,[ citation needed ] translated Snap! into Catalan, German and Norwegian, made changing the custom block from reporter to stack alter the prototype, and fixed some bugs.

Snap! 6.iii Features

Snap! 6.3, released November 11, 2020,[ citation needed ] fixed the "rename costume" dialog title, and fixed some bugs.

Snap! 6.4 Features

Snap! 6.4, released Dec 11, 2020,[ citation needed ] improved loading vector graphics in Firefox, added a SIGN function to the arithmetic reporter, and stock-still some bugs.

Snap! 6.5 Features

Snap! vi.5, released December 23, 2020,[ commendation needed ] updated the manual, added an "unsaved changes" alarm when opening or creating a new projection, sped upwardly reporters, WARP and TURBO blocks by 25%, and stock-still some bugs.

Snap! 6.6 Features

Snap! half dozen.6, released February 25, 2021,[ commendation needed ] changed "length of list" to become a general list operations archaic, fabricated 2d lists inside ITEM OF now accept the right order of dimensions (rows, columns, planes, etc.), and stock-still some bugs.

Snap! vi.7 Features

Snap! 6.vii, released March 8, 2021,[ citation needed ] added an undelete feature for sprites, updated the manual and fixed some bugs.

Snap! 6.8 Features

Snap! 6.eight, released May 3, 2021,[ citation needed ] added first-course colours in the new "Colors" library, sped-up talk bubble positioning by 5x and fixed some bugs.

Snap! half-dozen.ix Features

Snap! 6.9, released June 14, 2021,[ commendation needed ] translated Snap! into Polish and Hindi, error messages in presentation mode were fabricated pop-upwardly messages onstage, and fixed some bugs.

Snap! Version 7

The major planned innovation in version 7 is scenes, allowing multiple projects to be packaged as a single project, to back up applications such as levels in a game, slides in a presentation, or chapters in an animated story.

From the beginning of BYOB, some teachers accept wanted the ability to hide blocks, and so every bit to nowadays students with a restricted linguistic communication in which to solve bug.[ citation needed ] For a long time, Jens and bharvey resisted these requests, on the theory that learners shouldn't have tools withheld from them.[ citation needed ] This changed when Education Evolution Center ([www.edc.org]) wanted to base an early childhood (ages v-7) math curriculum on Snap!, but wanted to provide students with an environs in which all the primitive blocks were hidden, leaving only the custom blocks they would build for each action.[ citation needed ] They provided funding to support block hiding and several other needed features for their work. The Snap! developers were less upset about hiding blocks in a math curriculum than most hiding blocks in a programming curriculum.[ citation needed ] Some of the EDC changes found their manner into Version seven: block hiding, a unmarried multicolor palette, and others.

Syntactic introspection, described in more than particular below, allows programs to examine and create scripts.

Snap! 7.0 Features

Snap! seven.0, released December xiii, 2021,[ citation needed ] has major changes including scenes (combining several independent projects into 1 that can switch betwixt sub-projects programmatically), syntactic introspection (conversion betwixt expressions or scripts and tree-structured lists in which input expressions are separated from the block to which they provide input values), and a collection of features to back up Parsons bug (extremely limited environments in which a learner is challenged to solve a problem using but a handful of selected blocks): programmatic hiding and unhiding of blocks, an optional unmarried palette with blocks of all categories, and user-defined cake categories. Additional changes include updating the manual and readme, translating Snap! into Chinese, support for extensions, and fixing bugs.

Snap!NewCategory.png Snap!Hideblocksinpalette.png

Soon before the release of version 7.0, there was a significant set on on the Snap! community in the form of a projection that used the JavaScript function block to introduce malware into users' computers and collect users' passwords.[ citation needed ] This led to a quick release of version 6.9.2, in which that block is disabled by default, and users who run projects using it have to enable it explicitly each time the project is loaded.[ commendation needed ] This made information technology painful to use some of the libraries provided with Snap!, and so version 7.0 moves those JavaScript functions into Snap! itself, interfaced via a primitive block available in dev style.

Syntactic Introspection

Snap!IntrospectionExample.png Snap!IntrospectionDefinition.png

Snap!IntrospectionSplit.png Snap!IntrospectionSplitResult.png

The definition of block takes a custom block (in a ring, since it's the cake itself that'due south the input, not the result of calling the block) as input and reports the block'southward definition, i.e., its inputs and body, in the form of a band with named inputs respective to the cake's input names, and then that those input names are leap in the torso.

The split by blocks block takes whatsoever expression or script equally input (ringed) and reports a list representing a syntax tree for the script or expression, in which the offset item is a block with no inputs and the remaining items are the input values, which may themselves be syntax copse. The inverse office is provided by the join block, which when given a syntax tree as input reports the corresponding expression or script.

Together these features are the start of a metaprogramming capability, in which Snap! programs can be treated every bit data. For example, this debugging help can be written in Snap! itself:

Snap!CallersOf.png Snap!CallersExample.png

This adequacy volition be expanded in future versions, including the ability to define new custom blocks programmatically, and a full implementation of Scheme-style macros.

Many Other Features

Each release added dozens of features not discussed here, because they don't rise to the level of importance of custom blocks, beginning-course procedures, first class lists, first class sprites, and first-class continuations. Here is a representative sample:

Generic Hat Block

when <> :: hat control

Custom hat blocks take been a frequent user asking since the early days of custom blocks. The generic when block, introduced in 4.0, answers that demand. The feature required particularly careful design considering the script is in a sense always running an implicit forever if <>:: control, so information technology could dull down projects using information technology, even if the user tries to terminate all scripts. To avoid this problem, generic chapeau blocks, unlike all other chapeau blocks, are disabled by the ruddy stop button or by a terminate [all v] block. Some other script must run, either because an upshot triggers its lid block or because the user clicks it, to re-enable generic lid blocks.

Zebra Coloring

Zebra.png

This feature, introduced in BYOB three.0, is representative of the careful attention to the user interface in BYOB/Snap!. When same-color blocks are nested, it's difficult to see the borders between them. Zebra coloring assigns two colors to each palette category: the normal color and a lighter color. When aforementioned-color blocks are nested, the outermost one has the normal color, and an inner block takes the opposite color from the ane just exterior information technology. The text inside light colour blocks is blackness, instead of white as usual.

Detailed Mouse Event Hat Block

Mouse-block.png

Since 4.ane, users tin can detect all mouse events, not just clicks. (The "stopped" option was added in 4.2, to allow physical robot packages to detect clicking the stop button and stop the robot's motors. To prevent runaway scripts, a "when I am stopped" script is immune to run for but ane display bicycle.)

Suspension and Visual Stepping

Control-buttons.png

Since iii.0, the menu bar has included a pause push button, between the light-green flag and the stop sign. Clicking the push button pauses the thread scheduler and replaces the "pause" icon with a yellow "play" icon. Clicking once more continues running the project. There is likewise a pause all ❚❚ :: control cake that can be inserted in a script to prepare a breakpoint while debugging.

Since 4.0, the visual stepping feature from Scratch 1.iv (in which information technology'due south misleadingly named Unmarried Stepping) is controlled by a card bar button (with the anxiety icon), and a slider that appears when the push button is clicked that controls the speed. If the slider is all the way to the left, truthful unmarried-stepping is used: the suspension button must be clicked for each step. If a custom cake is edited after enabling visual stepping, then the stepping includes the blocks within that edit window. (More than than ane editor tin be opened.)

Outset Class Costumes and Pen Trails

Since iv.one there is a (pen trails::pen) cake that reports everything currently fatigued or stamped on the stage equally a costume. Since costumes are beginning class information, this block can exist used as input to any block, eastward.1000., add (pen trails::pen) to (my costumes::variables)::listing), switch to costume (pen trails::pen)::looks, or say (pen trails::pen) for (two) secs::looks.

Intellectual Precursors

Custom Blocks

The ability to write and invoke procedures, which is the cadre idea of Build Your Own Blocks, has been part of well-nigh every programming language (with hardware support in every processor design at to the lowest degree to the extent of an instruction to salvage the return address somewhere before jumping to the procedure) in the history of computing. (In the original Fortran, the first general-purpose high-level programming linguistic communication, procedures were not reentrant, like Scratch scripts, which suspension off in the middle if the event that started the script happens again.)

Mapwithexample.png

Glide BYOB.png

Among languages intended primarily for children, in that location were heated debates between Basic and Logo advocates because the latter included support for recursive procedures and the former did not, limiting itself instead to something pretty similar to the Scratch Broadcast () and Wait block.[ commendation needed ] There's an irony in this since the Scratch Squad is a descendant of the old MIT Logo Lab. Seymour Papert, one of Logo's inventors and the founder of the MIT Logo Lab, argued for recursion as one of the mathematical big ideas that children should learn from programming computers.[ citation needed ]

First Class Data

The phrase "first class data" was coined past figurer scientist Christopher Strachey, who argued in the 1960s that any information blazon that exists in a language at all should be first class. This means that information of that type:

  • can be the value of a variable.
  • can be an input to a procedure (Scratch: block).
  • can exist reported past a process.
  • can be a member of an aggregate (Scratch: list).
  • tin can exist without having a name.

It'southward easy to see why i might want lists of lists; every data construction (copse, heaps, hash tables, etc.) can be constructed out of lists, merely not straightforwardly with simply lists of text strings. But why should procedures be first grade? This was historically a counterintuitive idea, especially because a process tin not be recursive unless it has a name by which to call itself.

The idea of kickoff-course procedures comes ultimately from the 1936 invention by mathematician Alonzo Church of lambda calculus, which is a formal study of the behavior of functions. In 1936 there were but a handful of experimental computers, and no symbolic programming languages, and then the fact that lambda calculus turned out to be of practical use (it is the basis for much of the theory of programming languages today) was a bang-up confirmation of the power of the idea.

Church demonstrated that the ability to create and call functions is universal — it is all that is needed to perform any computation that can exist done at all. (He also proved that there are undecidable problems, which is the reason for the qualifying clause above.) In BYOB terms, this means a programming language with nothing but THE BLOCK and Telephone call could exist and still be able to compute whatever function. (See this BYOB project clarification for an explanation of how to invent arithmetic from that starting point.) The Greek alphabetic character lambda (λ) is Church'south name for a gray band.

Compose.png

(Of course, lambda does not solve the problem of input/output: capturing mouse clicks, drawing pictures on the screen, then on. Although obviously of crucial practical importance, such input/output activities are not central to the understanding of what a program or a programming language is.)

Church building'southward work influenced actual programming language design past way of John McCarthy's 1958 invention of the Lisp programming language for artificial intelligence research. Lisp is a directly influence on Logo, and therefore an indirect influence on Scratch. The detailed blueprint of first-form procedures in Build Your Own Blocks was strongly influenced by Scheme, a Lisp dialect invented in the tardily 1970s past Gerald Jay Sussman and Guy Steele, which brought Lisp closer to its roots in lambda calculus by introducing lexical scoping rules.

Prototyping

The clone block reports a new object that inherits properties of the parent object. This allows users to create an object hierarchy, every bit in other OOP languages such as Smalltalk. Just dissimilar Smalltalk, Build Your Own Blocks does not distinguish between classes and instances; every object can be viewed equally an instance of its parent or every bit the course of its children. This form of inheritance is chosen "prototyping" considering the user builds an example of a category of sprite rather than building the category as an abstruse description. The best-known prototyping languages are JavaScript and Self. The particular form of prototyping used in BYOB was inspired by the work of Henry Lieberman.

History

Jens' kickoff modification was Chirp, a program that had improvements to Scratch. He then began to work on Build Your Own Blocks (a much bigger project), which has three versions: i.0 (based on Scratch ane.iii), 2.0 (based on Scratch one.4), and version iii.ane.1, which can be downloaded here. Bharvey put a "Document of Appreciation" on the BYOB website, consisting of 16 people who helped exam the alpha versions of BYOB 3.

In 2009, the University of California at Berkeley decided to create a new computer science form for non-majors and wanted to apply Scratch as the programming language, merely too wanted to teach recursion and college-order functions. This is how bharvey, one of the developers of the new form, joined the BYOB projection, working with Jens to design the user interface for start-class lists and splendid procedures.

Snap! four is written in JavaScript, using the HTML5 canvas element. It uses a Morphic library by Jens called Morphic.js.

As of January 2022, Snap! 7.0.iii tin can be found here to try out.

The Build Your Ain Blocks-based Dazzler and Joy of Computing curriculum has been converted to Snap!.

Use in Scratch

Primary article: My Blocks

The Scratch Team has incorporated a function based on Build Your Ain Blocks into Scratch ii.0. Custom blocks are procedures (also known as functions or methods) in which a script can easily be modified or run without duplicating it entirely. An instance of Scratch's custom cake is below:

define jump repeat (ten) change y past (6) finish repeat (x) change y by (-6) finish  jump        

Scratch Modernistic Design Aesthetics

Information technology is traditional to measure out the power of a Scratch modification in part by the number of blocks it adds to the linguistic communication.[ citation needed ] BYOB/Snap! has taken the reverse approach, trying to get a lot of expressive power out of a very pocket-sized number of new blocks.

Ane reason for this is that an explicit goal of Build Your Own Blocks was to influence the design of Scratch 2.0, and it was hoped that the Scratch Team might be more acquiescent to changes with a "small footprint" — ones that volition not intrude dramatically on the experience of the traditional Scratch programmer.[ commendation needed ]

Alternative Launch

The alternative launcher in activeness

One other mode that is used for launching Snap! in the offline editor is BirdBrain Robot Server can exist used to launch Snap! And further using its glory. It does require a download, and when opening the application a prompt is given to launch Snap!.

See Also

  • List of Scratch Modifications

External Links

  • Proclamation of BYOB1 on Jens's blog
  • Announcement of BYOB2 on Jens's blog
  • Announcement of BYOB3 on Jens'due south blog
  • Announcement of BYOB3.1 on Jens'southward blog
  • BYOB Forum Topic
  • BYOB iii Forum Topic
  • Snap! Forum Topic
  • BYOB1 manual
  • BYOB 3.ane.1 Reference Manual
  • Snap! Reference Manual
  • Snap! Website
  • Snap! Wiki (Unofficial)
  • Snap! on Wikipedia
  • Snap! Deject Website, a mirror of the main website
  • Snap! Con Website

References

  1. a b [1]
  2. bharvey. (25/04/2010). "Okay, gang, Information technology'Southward HERE! http://byob.berkeley.edu" ar-post:375320

The Wiki is working on a dark theme, and you lot're seeing it! Got feedback? Post on the Wiki Forum Topic.

carpenterupecent47.blogspot.com

Source: https://en.scratch-wiki.info/wiki/Snap%21_%28programming_language%29

0 Response to "How to Upload Snap! Project on Website"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel