Download SNAP! Reference Manual
Transcript
Table of Contents I. Blocks, Scripts, and Sprites 4 Hat Blocks and Command Blocks 5 A. Sprites and Parallelism 6 Costumes and Sounds 6 Inter-Sprite Communication with Broadcast 7 B. Nesting Sprites: Anchors and Parts 8 C. Reporter Blocks and Expressions 8 D. Predicates and Conditional Evaluation 10 E. Variables 11 Global Variables 12 Script Variables 13 F. Etcetera 13 VII. Object Oriented Programming 40 A. Local State with Script Variables 41 B. Messages and Dispatch Procedures 42 C. Inheritance via Delegation 43 D. An Implementation of Prototyping OOP 43 VIII. The Outside World 47 A. The World Wide Web 47 B. Hardware Devices 48 C. Date and Time 48 IX. Continuations 49 A. Continuation Passing Style 50 B. Call/Run w/Continuation 53 Nonlocal exit 55 II. Saving and Loading Projects and Media 14 A. Local Storage 14 Localstore 14 XML Export 15 B. Cloud Storage 15 C. Loading Saved Projects 16 X. User Interface Elements 57 A. Tool Bar Features 57 The Snap! Logo Menu 57 The File Menu 58 The Cloud Menu 61 The Settings Menu 62 Stage Resizing Buttons 64 Project Control Buttons 64 B. The Palette Area 65 Context Menus for Palette Blocks 65 Context Menu for the Palette Background 66 C. The Scripting Area 66 Sprite Appearance and Behavior Controls 66 Scripting Area Tabs 67 Scripts and Blocks Within Scripts 67 Scripting Area Background Context Menu 68 Controls in the Costumes Tab 70 The Paint Editor 71 Controls in the Sounds Tab 72 D. Controls on the Stage 72 E. The Sprite Corral and Sprite Creation Buttons 73 III. Building a Block 17 A. Simple Blocks 17 Custom Blocks with Inputs 19 B. Recursion 20 C. Block Libraries 21 IV. First Class Lists 22 A. The list Block 22 B. Lists of Lists 23 C. Functional and Imperative List Programming 24 D. Higher Order List Operations and Rings 25 V. A. B. Typed Inputs 27 Scratch’s Type Notation 27 The Snap! Input Type Dialog 27 Procedure Types 28 Pulldown inputs 29 Input variants 30 Prototype Hints 31 Title Text and Symbols 31 Index 75 VI. Procedures as Data 32 A. Call and Run 32 Call/Run with inputs 32 Variables in Ring Slots 33 B. Writing Higher Order Procedures 33 Recursive Calls to Multiple-Input Blocks 35 C. Formal Parameters 36 D. Procedures as Data 37 E. Special Forms 38 Special Forms in Scratch 39 2