In computer science, Loops is a type of block that causes other code to run multiple times in succession. A program can be written in many different ways that are functionally equivalent. Last week, we learned how to draw shapes using SNAP! As an exercise, we wrote the script to draw […]
Author: Silvia Doomra
Draw Shapes in SNAP!
Let’s have some fun today and draw some shapes in SNAP! For the purpose of this post, I will use the following 2 blocks in Pen palette: However, I do encourage you to play around with other blocks as well in this palette and test what they can do. Let’s […]
How to Deal with a Bully at the workplace?
Every workplace has people who like to find their way around by bullying people. If you have such a co-worker who is trying to bully you, how do you deal with him? How to you tell him/her that you won’t take any more? There is always the dilemma – should […]
Reporter Blocks in SNAP!
In SNAP!, a reporter block is used to report a value, which is generally used as an input to another block. What do reporter blocks look like? Reporter blocks can be easily identified in the palette as they have reporter shape (round). For example, the following blocks in the Motion […]
Custom Code Blocks: Functions with Parameters
Last week we covered an important computer science concept, Variables, and how to use them in a simple jump example. Variables gives us the ability to store a value and track/modify/use it throughout the program. Additionally, last month, we had covered the concept of functions. Functions are a great way […]
Variables
In my previous blog, we covered how you can customize your script to take user input and make your sprite jump to the height specified by user. Now let’s extend the previous scenario to asking user input for both height and length of the jump. How would you enhance your […]
User Input in SNAP!
In previous blogs, we have covered different aspects of coding practices using a simple Sprite Jump example. In this blog, I will build on top of the code we built in Good Coding Practice: Using Relative Coordinates. Here is what our Sprite Jump code looked like: Now let’s say we […]
Simple Code Blocks: Using Functions
Let’s say you create 3 sprites (of ball shapes – learn how to change the sprite’s costume): one of color Red, other of Blue and last one of Green. Now you want all three to jump when different keys are pressed. For example, Red one should jump when key ‘a’ […]
Good Coding Practice: Using Relative Coordinates
In the previous blog, we covered how to make the sprite jump, and this is what our script looked like: What will happen every time you click on green flag? The sprite will come to the center of the stage (coordinates [0,0]) and then glide to [20,20] coordinates and then […]
Simulating a Sprite’s Jump in SNAP!
This blog post will illustrate how we can make a sprite jump in SNAP! Now to make a sprite jump, it should first look like an object which can jump. Checkout my previous blog post on how to change sprite’s costume to give it the shape of a ball. Once […]