Lab 1: Introduction to Snap!
This lab introduces Snap! programming through a fun and simple activity designed to engage students and give them an experience of success with programming right away as they explore various blocks that greet the user in different languages and fancy formatting. Students learn about the Snap! programming language, interface, and terminology (reporter blocks, input parameters) as they change input parameters to observe the impact on outputs and snap blocks together to create more complicated expressions.
In the second page of this lab, students begin saving their work to a Snap! account. Students can create accounts on their own, but ideally you, as their teacher, set up accounts for each student ahead of time and provide each student with a username and password on the first day.
Pacing
All expected times in this Teacher Guide are for planning purposes only and are not intended to constrain class time spent. The appropriate time for your students to spend on any activity may vary from these guidelines and may vary from student to student. BJC Sparks labs include optional "If There Is Time" extensions and "Take It Further" challenge exercises for differentiation.
This lab may take your students about 1 class period (20–50 minutes).
↑ Back to Top
Activity 1: Say Hello to Snap!.
- Materials: Say Hello to Snap! student page
-
Prepare:
- Take a few minutes to explore the blocks in the Snap! project to understand what they do.
-
Learning Goals:
- Understand that a block is a piece of code that can be run by a computer and it can be run by clicking it.
- Understand that reporter blocks are blocks that report outputs.
- Understand that block can have inputs, those inputs can change the output, and the output of one block can be used as the input to another.
- Explore changing inputs by typing different text into the input slots, by selecting different dropdown menu options, and by dragging other blocks into the input slots.
-
Activity Plan:
- Students explore two blocks that manipulate text strings (5-10 minutes):
-
The block
takes a name and a language as input and reports a greeting to that person in the selected language:
-
The block
takes text as input and reports the same text with any letters changed to fancy Unicode letters:
- Students then explore nesting the
fancy
and say hello
blocks inside each other and observe how the output of one block becomes the input to the other. (5-10 minutes)
-
Tips:
- In this first hands-on exploration with Snap!, students may hesitate with basics such as clicking a block to make it run, typing into input slots, etc. The simplicity of this project allows for debugging these simple challenges of the absolute beginner so that they are resolved by the time students move on to more complex use of the Snap! interface such as dragging blocks into each other, creating input parameters, and creating and editing blocks.
-
Standards:
- None covered in this activity since it focuses on the basics of using Snap!.
↑ Back to Top
Activity 2: Saving Snap! Projects
- Materials: Saving Snap! Projects student page
-
Prepare:
- If you haven't already, create your own Snap! account and sign up for access to BJC solutions and assessments.
- Plan for students' Snap! use. This activity lists three options for how to save Snap! projects. The option you direct students to use will depend on your school and district's policies. Visit the Student Accounts and Privacy page for details behind these options.
- The best option for most schools is Option B, which requires you to set up student accounts in bulk well before the first day of class. Directions are on the Student Accounts and Privacy page.
- Option A is listed first as it is the only option that does not involve student Snap! accounts. If you are not ready for students to set up accounts yet, Option A will let them proceed with their project without losing their work. Students can always import and save their projects later if they make accounts.
- You may find it helpful to review the beginning of the Beauty and Joy of Computing: Snap! Crash Course and perhaps also to familiarize yourself with the structure of the Snap! Reference Manual, which is accessible by clicking the Snap! logo in the top left corner of any Snap! window.
-
Learning Goals:
- Save their Snap! project.
- If applicable, access or create a Snap! account.
- Learn to navigate the Snap! interface.
-
Activity Plan:
- Students save their Snap! project. If applicable, students will also access their Snap! accounts. (5–20 minutes)
-
Tips:
- As mentioned in the "Prepare" section above, the best option for most schools will be Option B, which requires you to set up students account in bulk prior to the lab. See the Student Accounts and Privacy page.
- Some students may already have personal Snap! accounts or would prefer to make their own. Encourage personal use of Snap!, but also insist that students use a student account for their school work.
- If students set up Snap! accounts in class using Option C, consider asking students to enter in your (the teacher's) email address instead of their own. One advantage is that all password reset requests will then go to the teacher, instead of a student email that students may also have trouble accessing. Students' school email addresses may also be more short-lived than teacher addresses, so this potentially reduces instances where students lose access to their projects after they leave a school.
- Snap! users can change their password at any time using the Cloud menu.
-
Users can tell whether they are logged in by checking the Snap! Cloud menu:
- If it says "Logout" and then a user name, then that user is logged in.
- If it says "Login..." then no one is logged in.
If students are using shared computers, they should log out of Snap! when they are done.
- You can also tell at a glance whether anyone is logged into Snap! because the cloud icon will be filled in (white) when someone is logged in.
-
Make note of any questions or difficulties that arise, and please share them with the curriculum developers:
-
Standards:
- None covered in this activity since it focuses on getting set up with Snap!.
↑ Back to Top
Activity 3: Customizing Snap!
- Materials: Customizing Snap! student page
-
Prepare:
- You may find it helpful to explore the Snap! customization features before class.
-
Learning Goal:
- Customize the Snap! programming environment.
-
Activity Plan:
- Students customize several basic Snap! settings (language and appearance). (5–10 minutes)
-
Standards:
- None covered in this activity since it focuses on getting set up with Snap!.
Still needed:
After a quick video from the curriculum developers, the class shares their experience and interest in computer science and then explores a simple offline activity designed to introduce the basics of how computers process data in functional programming.
In this course, the curriculum will provide students with starter projects for them to save to their accounts. It's also possible to create new projects, and students may wish to explore that on their own time.
↑ Back to Top
Activity 1: BJC Culture and Norms.
- Materials: BJC Culture and Norms student page
-
Prepare:
-
Set up a screen for showing the BJC Sparks Introduction video.
- Plan some way to collaboratively develop a list of classroom norms (whiteboard, chart paper, projected document, etc.).
- If you are new to creating classroom norms, consider reading an article or two on the practice.
-
Activity Plan:
- After welcoming students to the class and addressing any administrative matters, share the BJC Sparks Introduction video. (5 minutes)
-
Tips:
- Assure students that all levels of computing experience are welcome in this class. You are asking these questions so that you and the curriculum developers can tailor the class to the experience and interests of students.
↑ Back to Top
Activity 2: Draw Like a Computer.
-
Materials:
-
Prepare:
- Print and cut out enough 12-up "shrinking wide T" sheets so that you have one "shrinking wide T" picture (clickable image shown right) for every other student.
- Watch Josh Darnit's videos Peanut Butter and Jelly and Exact Instructions Challenge to appreciate the spirit of the activities; you'll be doing the drawing activity in class today.
This is a re-imagining of the CS Unplugged activity called "Marching Orders" done as a functional-programming activity.
As you can see, the key is that the person doing the drawing tries to mess up as much as possible while still following the directions specified. For example, if the programmer (the student creating the instructions) says to draw a square, the computer (the student drawing) could draw a very tiny square if the programmer didn't specify how big it should be.
-
Activity Plan:
- Work together as a class before students open their computers.
- Explain the activity, describing the roles of programmer (provide a list of instructions that is as precise as possible for the computer to replicate some original drawing) and computer (deviate as much as possible from the programmer's intentions while still following the instructions precisely).
-
Ask the students to take out a piece of paper out and play the role of the computer. Read the following instructions and ask students to follow them, trying to mess them as much as possible while still doing what exactly what they say.
- Draw a square.
- Draw a circle on top of that.
- Draw a triangle on top of that.
- Show them the programmer's original drawing, and let students share their pictures. Celebrate those that are farthest from the original drawing but still followed the instructions precisely.
- Then, have students work through the student-facing web page for this activity.
- Students create their own drawing (using a small set of geometric primitives: a straight line, a polygon, a circle, and an arc) and write computer instructions for re-creating it.
- In pairs, they take turns as "programmer", reading their list of commands while the other pretends to be a "computer", drawing the picture.
- Bring them back together and have a debrief with them. Which programmer was able to get their drawings faithfully duplicated, and what were their secrets? Have student stand and show the class the originals and the replicas. Emphasize that the goal of today is to appreciate that computers need very specific directions to do what you want them to do.
- Then as a class...
-
Call over into a huddle the last programmer from every team. Pass out a "shrinking wide T" picture (clickable image shown right; handout here) to each of them. Request that they not show their partner, but to spread out in class and sit, back-to-back with their "computer", and describe the picture to their partner.
- Again regroup the class for a debrief, how did they do? Did the computer or programmer win? Have the computers show their pictures to the class.
- One last drawing for everyone -- but this time you're going to be the programmer. Read the following program to them:
- Draw a square centered on the paper, with the edges aligned with the edges of the paper, and whose width is about half the width of the paper (so about 4.25 inches). Imagine you're drawing the top view of a "pen" designed to hold animals. The concept of an "inner pen" is the pen an animal would see if they were at the center of the paper; all pens are made up of four straight-line fences at right angles.
- To draw a new "inner" pen, draw a pen such that the corners of the fences are connected to the midpoints of the old inner pen.
- Draw three successive inner pens.
-
Have everyone compare pictures, did anyone get what was intended? (Click image below to load in new window.)
Insert Dan video of commands vs. functions to play here. (in the video, explain that the picture that they drew could also be thought of as coming from a function, like 2*(3+7). We’d show how that expression can be seen another way, as smaller one-task machines cascading into each other. I sometimes called the lower part of the picture below "funnel functions" because they look like funnels and return only one thing at the bottom and they are functions.) DG, 2021-08-18
-
Tips:
- Students may be inclined to write instructions that a computer couldn't follow (unless it were programmed to) such as "draw a smiley face." Make sure students only write instructions using the list of commands provided.
- This activity has been done for years as the Peanut Butter and Jelly activity in which the teacher asks the students to describe how to make a PB&J sandwich as precisely as possible. As you saw in the Exact Instructions Challenge, the key to the whole activity is that the "computer" is supposed to try to find ways to mess up.
Correlation with CSTA Standards
None covered in this first lab.