Creating Games in ScratchJr without Variables

Written by Aung Nay & Aye Thuzar

ScratchJr is a popular graphical programming language that allows children from age five to seven to create “interactive and animated scenes and stories” [1]. It addresses the lack of programming tools that focus on “content creating or higher level thinking” [1] for kindergarten to second grade students. ScratchJr software deployment comes with the curriculum and online community, and the design goal of the ScratchJr software is to “provide young children with a powerful new educational tool as well as guidance for teachers and parents to implement it to the benefit of diverse areas of early learning, from math and literacy to interdisciplinary knowledge structures” [1].

Even though ScratchJr is great at making interactive and animated stories, creating games was a challenge since ScratchJr does not have variables. Because of this, we developed the idea of a sprite moving towards a goal as an ongoing visual tracker/indicator of the player’s progress [2], which allowed us to create a variety of games. The game creation allowed us to move beyond the interactive storytelling phase and pump excitement beyond. For the purposes of this blog, we would like to introduce one of the sample projects, Safari Animals. For this game, the players will have to tap on only the safari animals to win the game. There will be various animals that will be shown but not all will be safari animals. When a non-safari animal is tapped, the game will be over. Please view the game video at https://youtu.be/OkVoS_3lnbU

grid

Fig 1. Safari Animal game with visual progress tracker

Fig 1 shows a sample project of a game that has the progress dot which starts at row 15 and column 16 and has a red bars at row 15 and column 20. As the game progresses, the red dot moves towards the red bar. When the red dot reaches the red bar, the player is greeted by a “You Win” scene. Along with the achievement tracking, this game also tells a story about animals, particularly the taxonomy of the animal kingdom. The storytelling aspect of the games always draws students in, motivates, and inspires them to create their own games with storyline. And this creativity has to be integrated into the lesson plan. Please see and download the Safari Animal lesson plan at http://scratchjr.zatna.com.

ScrachJr is a great platform for younger kids because you can create exciting games with the progress tracker using fewer code blocks than Scratch or other block programming environments. We hope that ScratchJr team maintains and updates it regularly and more K-2 teachers as well as Pre-K environments will adopt ScratchJr.

Our paper, “Teaching and Learning through Creating Games in ScratchJr: Who needs variables anyway!” will be published in this month as part of the proceedings of the Blocks and Beyond Lessons and Directions for First Programming Environments A VL/HCC 2015.

Reference:

[1] Flannery, Louise P., Elizabeth R. Kazakoff, Paula Bontá, Brian Silverman, Marina Umaschi Bers, and Mitchel Resnick. “Designing ScratchJr: Support for Early Childhood Learning through Computer Programming.” DevTech Research Group. Proc. of 12th International Conference on Interaction Design and Children, ACM, New York, NY. Tufts University, n.d. Web. 29 Aug. 2015

[2] Thuzar, Aye, and Aung Nay. “Teaching and Learning through Creating Games in ScratchJr.” Proc. of Blocks and Beyond Lessons and Directions for First Programming Environments A VL/HCC 2015 Workshop, Atlanta, GA (To be published in Oct. 2015)

CS Principles and Creativity

Students will likely need exposure to, and practice with the CS Principles big Idea “Creativity” many, many times before a “creative – innovative – mindset” is comfortable and natural. You may have to undo years of “non-creativity conditioning.”

It is not enough to tell students that creativity is important; you must show students that you value creativity by actively engaging in it yourself. I don’t have to tell you that a unit exclusively “on creativity” is bound to fall flat!

So how can we build creativity and innovation into the very core of CS Principles? A few suggestions from a variety of experts:

  1. Let students know that there are usually multiple paths that lead to understanding.
  2. Arrange student collaborations that provide meaningful (to them) real-world, problem-solving opportunities.
  3. Provide lots of project and performance choices that employ a variety of “intelligences” whenever feasible.
  4. Encourage them to look for and experiment with new things and ideas.
  5. Encourage questioning.
  6. Be sure your grading does not penalize “less than successful” creativity. Students will not feel free to experiment if their grade hinges on some abstract measure of success. The true reward for being creative is purely intrinsic.
  7. Encourage them to mistakes as opportunities for learning rather than failures.
  8. Enable students to exchange, value, and build upon the ideas of others. Share interesting examples of technological creativity that you run across in the media.
  9. Make time for informal interactions between students.
  10. Offer a safe environment that encourages risk-taking. Avoid a competitive and extrinsically rewarding classroom, by providing a friendly, secure, and comfortable environment.

What do you do in your classroom to build the creative capacity of your students? Share with us!

 

 

What do students think about coding?

What does assessment look like in a K-8 Computer Science program? Computer science teachers like myself use various methods to determine learning amongst their students, examples include:  a debug activity, some version of ‘get the robot through the maze in N programming blocks’ or a rubric to assess different components of a Scratch project.

In addition to problem solving and programming skills, I also assess my student’s attitude to computer science.  Through the year, I use anonymous SurveyMonkey surveys, Google forms, Edmodo questions, and writing prompts to determine what student think about their learning and about coding.

Since I teach across the Los Altos school district (over 500 students each week), I have a wealth of data to analyze after each survey. My survey question at the end of this school year wasWhat do you think about coding? What would you tell someone to convince them that they should learn to code? ‘.

This question generated a wide variety of responses. Here are some that seem to have a common theme – can you detect it?

  • I think it’s difficult, but still interesting.
  • It was fun yet challenging.
  • It is kind of difficult to learn at first, but then is fun to play with
  • Coding is hard in the beginning but fun once you learn how.
  • It is fun but hard and boring.
  • Coding is fun but hard. If you want to design or make something coding is for you.
  • Coding is hard but interesting.
  • Love it, and makes your brain work hard while you have tons of fun.
  • I think coding is fun but can be difficult.
  • I liked coding. It was challenging though.
  • I think coding is very interesting and challenging. The feeling of success when you finish a project is all worth the trouble.
  • Coding is complicated but fun. People think it’s scary because it’s new but it’s actually really cool!

The common theme is: ‘difficult but fun’.

These students find coding fun even though it is difficult. In fact, they think it is fun because it is hard. They enjoy coding for the same reason they enjoy a good video game – it is challenging. It is not easy and boring.

Seymour Papert who showed us that children can program computers almost 40 years ago, explained this kind of learning as ‘Hard fun’ in his article http://www.papert.org/articles/HardFun.html

It appears that my sixth grade students agree with the student Papert mentions in his article. Coding is fun and it is hard. Much has changed in terms of tools and resources in the last 40 years, and it is good to know that this fundamental attitude remains the same.

Doing computing means embracing failure

We always tell ourselves and our students to take risks. But taking risks means that we will fail at things. And generally, none of us like to fail.

Think about what it’s like to write code. Most of the time, the code is broken, and you’re failing.

This semester, I’m watching my students struggle with assignments in our sophomore-level object-orientation in C++ programming class.

We’re working through a series of two-week projects. The projects are pretty fun:

(There are more—this material is from Princeton’s COS 126 course.)

From the students’ point of view, there are a lot of steps to get to a working system:

First, to understand the basic problem. What data structures will we use? How does the algorithm we’ll use work? How will it all be organized into objects?

Next, starting to write code. What goes in the header file? What goes in the source file? Why is there this separation anyway?

OK, I have some code. Let’s try compiling it. Oh great, tons of compile errors. Of course.

OK now it compiles. Does it work? Not a chance.

Well, time to debug… where do I start? Probably printing some stuff out… how about seeing that I can read the command line arguments properly?

And so on.

Probably the most challenging part is at the very beginning—making sense of the task itself, and how it’s to be accomplished.

I encourage my students to do their work in baby steps. Just write a few lines of code, compile it, and make sure it works.

Only add more code after you have a little bit of code working.

Compile and test before moving on. Make sure you are going from a working thing to the next working thing.

But even with this strategy, as soon as a bit of code is working, the next step is to add more code, which means breaking it again!

Most of the time, things are broken.

It takes a high tolerance for failure like this.

I do believe that we learn best when we encounter challenges.

And the beauty of our practice is that we’re so readily able to get feedback on the quality of our ideas. Since our ideas are expressed in machine-executable form, we can debug them.

But it is hard, emotionally demanding work, and it’s important that we recognize how much effort our students put in to accomplish their successes.

Terry Dash, a CS educator in Massachusetts, just described to me a teaching experience she had teaching Scratch to middle school students. Midway through the school year, her student Erica cried out during class, “Now I get it! The more it breaks, the more fun it is!”

That’s the spirit!

yours respectfully,
Fred Martin
CSTA University Representative

How Do You Help Struggling CS Students?

This question has plagued me for the last few years, but more so this school year. In order to offer computer science courses and to make the course open access, some students enroll in the courses that don’t fully understand what computer science is and may not have the prerequisite problem solving skills. They do know that they want an AP course.

There is no prerequisite computer science course for AP Computer Science at my campus. The students would not enroll in a prerequisite unless it was an honors or AP, and we don’t offer one that is. To ease the students into computer science, I use Alice3 at the beginning of the school year then move into programming turtles and then Media Comp Lessons that are in Exploring Wonderland by Dann, Cooper and Ericson. I have been successful with this approach the last few years until this year.

This year I have tried several new strategies. I began using paired programming so each student would have someone to turn to for help. I would be free to help the students that are really struggling. Additionally, I have assigned fewer labs to give the students more time to work out solutions together. I have also assigned scenarios similar to the labs for the students to construct pseudocode prior to writing the program. I select random student papers, project them and we discuss the student written pseudocode. I also have assigned videos to do some flipping of lessons and the students take Cornell Notes while viewing the videos. I am available at lunch and after school for additional help. The students are writing reflections at the end of each unit discussing a lab that they have completed.

Even with all of that, I have students that are so lost they are not completing labs and are scoring low on tests. This semester the counselling department has resurrected a course title, “Fundamental of Programming” and has transferred a few of the students into that class. I have altered the assignments and tests to better meet their needs.

As I work to make my computer science course more diverse, I know that I will need to include additional teaching strategies to help all students. On Wednesday, March 11, I will be participating in the CSTA K-8 Task Force Twitter Chat #CSK8 from 5-6 pm PDT about Pedagogy: How to teach CS to 5 – 14 year olds. I am looking forward to hearing what K – 8 teachers are doing and tweaking their ideas to use with the high school students. I am also attending the CSTA Conference in July. One session that interests me is “Teaching CS to Students with Learning Differences”.

I will be piloting a Computer Science Principles course next school year and offer it as an AP course the following school year. Adding CS Principles may encourage some students to enroll in that course rather than AP Computer Science to help build their confidence.

I am continuing to look for additional resources and strategies. If you have any suggestions, resources or strategies please post them.

Myra Deister
CSTA Board At-Large Representative

Teaching Writing is just like Teaching Computer Science

We all know that writing is an important skill to develop in every classroom—including the computer science (CS) classroom. If our students can’t communicate their ideas, they don’t have a chance succeeding in or out of our classrooms.

And while as CS teachers we know the importance of teaching writing, we sometimes freeze with that deer-in-the-headlights look when thinking about actually TEACHING communication skills. Well, I’m here to tell you that you’re a natural! If you can teach computer programming, you can kids to write.

Thank you, Terry Freedman, for the elaboration of these ideas in the Tech & Learning article “How learning to code might improve writing skills” (http://www.techlearning.com/blogentry/8736).

Compare the strategies you use to teach CS to those required in writing.

  1. Making a plan for writing is similar to creating a flow chart or storyboard.
  2. Writing a clear precise sentence is like an explicit computer instruction.
  3. Good grammar is just syntax in another language.
  4. Well-ordered text is not much different than code that follows the algorithm.
  5. Too many words can confuse the reader just like too many statements create spaghetti code.
  6. Creative writing and programs require a mastery of vocabulary and commands.

See? I told you that you were a natural. Teach writing the way you teach programming and you’ll be fine.

Going beyond coding puzzles

Moving a robot through a maze or drawing a pre-defined shape are examples of well known coding puzzles available in every tool or curriculum. As a K-8 computer science teacher, I know we love handing out these structured exercises to our students. They are a perfect way to introduce programming concepts, and because they only have one solution, they provide a clear and definitive end to the lesson. It makes assessment easy, it takes away the stress of “what should I make” and it makes both teacher and student feel successful. It simplifies PD for new CS teachers and ensures that all students will learn the basics.

But K-8 computer science teachers need to go beyond these coding puzzles. We must show students that programming offers much more than a ‘one solution’ answer to a pre-defined problem. This can be messy, uncomfortable and it is not easy.  However, we also know it can be fun and deliver the “fall in love with coding” moment we hope to provide in these early CS classes.

When do we show our students that they can make anything with code?  Should we use K-8 as a time to focus on creative computing and make the first few projects completely exploratory?

I believe CS teachers must strike a delicate balance here.  While showing the students that there is so much more than mazes and shapes, we also want to give them constraints to ensure that they are still successful. In my own classroom, I see both excitement and fear when I tell  students they can make anything they want. Some students rush in – “I know exactly the kind of game I want to create.” However there are others who are frozen – they want suggestions, they want to look around for inspiration, they prefer to remix an existing project. To these students, the open ended project is a source of stress and can scare them away from coding. As teachers, our challenge is to find ways to be helpful but not limiting to these students, allowing them to explore their creative potential without fear.

During my days as an art student, I remember being given a blank white canvas and found myself in my own “make anything you want” moment. I felt that same fear many of my students have until my instructor gave me a wonderful tip – just paint a Burnt Sienna (brown) wash on it. Simply turning the canvas into something non-white made a difference. It gave me the courage to start, to experiment, and to make mistakes.

Writing code for a new project is a lot like starting a new painting. As a CS teacher, we have to be ready to give our students the help they need: a gentle suggestion, the first few lines of code, an exercise that could be extended. We must find the Sienna brown wash that will get them going.

Top Secret Rosies: The Female Computers of WWII

I showed the film Top Secret Rosies: The Female Computers of WWII in 3 of my classes for CS Ed Week (although it was a different week due to exams – such the life of education).  I had heard good things about the film from several other computer science teachers and thought it would be a great history/cs topic.   I also found the website http://www.topsecretrosies.com/ very helpful for resources including a study guide and other reference links.  But enough about my decisions, it is the reactions to the film from my students that made this such a worthwhile experience.

The most profound remark occurred while the film was discussing how the women did not get credit for their work and it was showing how a picture was cropped so that it was just the man with the machine and not the women.  One of my male students remarked out loud “that’s not fair!”  I think he startled himself just as much as some around him because it was an impromptu emotional reaction. After the film this led to several comments about how none of them knew women did so much and why no one else knows about this.
During the film the students had questions to to fill out as well as opinions questions to answer.  Here are some of the best comments:
“I don’t get why they stopped and had a family instead of staying in computers”

“Why didn’t they stay in computers if they were doing well?”
“I think it is weird only one stayed in computers”
“Did men take back over all the jobs when the war was over?”

“I didn’t know women started all the programming”
“I think it would be hard to know your calculations killed people”
“Its cool that computers used to be knobs and levers.”
“I didn’t know computers was a name for people”
As you can see many students were surprised and actually upset that the women left computing for family and other opportunities.  The students collectively felt if the women started the job and were doing well then they should have stayed with it.  Some of them were also struck by the concept that what the women were doing with the calculations led to people being killed in the war.  This actually opened up a great conversation about understanding the consequences of your work and actions.  We discussed that people can have a far reaching effect when they are programming and it can be anything from bombs dropping to corporations making money, etc.  There were several other conversations centered around beginning computing, the people, the machines, and how different it is today.  Overall I would say this film had a much further impact that I would have thought.  The students learned history that included the women “computers” and also learned about the impact of war, computing, and jobs during that time period.
If you haven’t used this in your classes I would highly suggest it and my best advice would to not preface the film and just let them come to understandings and realizations on their own.  You might just be surprised what they say!

Teaching and learning with “gift code”

Last month I co-taught a two-and-a-half day workshop introducing students to building apps with MIT App Inventor. Some of our students had prior programming background, and others did not.

Here, our goal as teachers was to get our students engaged in their own original projects (rather than teaching any specific set of computing concepts).

I’ve done a bunch of workshops like this, with learners of all ages, and we’ve developed the concept of “gift code.” (Thanks, Michael Penta!)

With gift code, a student describes their idea to you, and you translate it back to them in the form of working code.

Ideally, gift code has the following properties:

  • It’s short. I’ll dictate the code and have the student type it in (or in the case of App Inventor, select and configure the code blocks). It really has to be small so neither of us gets impatient.
  • It works. The premise is that the student will understand the computational ideas in the code by seeing them work. Often the code will combine a bunch of concepts together—ideas that would be hard to explain individually, but make sense when combined into a working unit.
  • It’s the student’s idea. This is pretty important—the code should embody the student’s idea! But it’s OK to simplify what they said, as long as it demonstrates the essence of what they wanted.
  • It’s extensible. This is crucial. In a few minutes, I’m going to walk away and work with another student, and I want my student now to understand enough so that they can keep going. It’s fine if their next step is a copy-paste of the same code structure—e.g., adding a new condition-action rule.

It’s really fun when it works. Students are empowered because they can get complex things working quickly.

In the best case, an hour after receiving gift code, a student has full ownership over it. They understand it, they have added to it, and they don’t even remember that I gave it to them. (That’s totally fine with me.)

Do you use gift code in your own teaching?

Fred Martin
CSTA University Faculty Representative

A Resource for your Careers Unit

Probably at some time during the next semester, you will guide your students through a unit on “career explorations.” Certainly, there are lots of resources out there to learn about CS careers, job prospects, pay, and education. The challenge comes in putting together a cohesive…not to mention up-to-date… series of lessons.

While cleaning off my work desk (an annual end-of-the-year event in my life), I found a suggestion on a scrap of paper I had torn from Tech & Learning several month ago that might just fit the bill.

The site reference is econedlink (http://www.econedlink.org/) from the Council for Economic Education. The specific lesson plan is “The 411 on College Education” (http://www.econedlink.org/lessons/index.php?lid=1103&type=student).

The lesson includes objectives such as:

  • The relationship between level of education and the average unemployment rate
  • Level of education and median weekly income
  • Choosing and financing college
  • College as an investment in human capital

The online lesson is designed to be used by students and includes activities, assessments, and an extension activity—all with links to reliable sources of information. Take a look…it might be a resource to complement career exploration in your classroom.