# Pre-teaching Slope with Scratch

I gave my 6th graders a challenge in Scratch today and loved the potential to build background on slope as they go into algebra classes later.

This is a starter program in which a cat uses the pen tools to draw a set of stairs to reach a princess.

https://scratch.mit.edu/projects/58903244/#editor

Using the pen tools so the cat can reach his friend princess using stairs.

The instructions are:

The cat asks you for the height and width of each step. It should draw an entire set of steps using a loop. Test to see if the cat reaches the princess. Can you guess a height and width for the steps that will reach the princess exactly?

I loved watching the students interact with the project. There were several different solutions that came out, and several different misconceptions. It was fairly common for students to plug random “move” blocks into a loop and test it without really analyzing why they were doing what they did. Getting the students to think through the sequence that needed to be repeated was challenging. Move up. Up how much? then turn. Move right. right how much? turn. Repeat.  Some students used a move-turn-move-turn sequence and others figured out it took fewer blocks if you used change x – change y.  Some tried to work with “glide” blocks, but since they had trouble thinking through the math of the new coordinates, nobody completed it.

Once they created the steps, they tried to figure out how to get the cat on a collision course with the princess. It was fascinating. It was very common for students to try height = 10, width = 10. The cat would travel at a 45 degree angle and end up above the princess. So they would try height = 20, width = 20. When that didn’t work, height = 50, width = 50. At this point, many would start to try entering different values for the height and width. If the height is greater than the width, the cat overshoots the princess even more. But if the height is anywhere from two-fifths to three-fifths of the width, the cat would collide with the princess. A ratio of 5/12 works. 20/30 just barely misses. 10/20 works. 6/10 works but just barely. 8/10 does not work.  Through trial and error, students figured out a height and width for the steps that reaches the princess.

I thought about how this experience might be useful prior to the students’ learning about slope. I had forgotten that Common Core doesn’t emphasize the rise/run ratio as a method for teaching slope, but focuses on unit rates:

CCSS.MATH.CONTENT.8.F.B.4
Construct a function to model a linear relationship between two quantities. Determine the rate of change  and initial value of the function from a description of a relationship or from two (x, y) values, including reading these from a table or from a graph. Interpret the rate of change and initial value of a linear function in terms of the situation it models, and in terms of its graph or a table of values.

Here you see the ratio understanding coming out in 8th grade, but the ideas around ratios build all the way through middle school.

CCSS.MATH.CONTENT.8.EE.B.6
Use similar triangles to explain why the slope m is the same between any two distinct points on a non-vertical line in the coordinate plane; derive the equation y = mx for a line through the origin and the equation y = mx + b for a line intercepting the vertical axis at b.

I would love to have the students gather data on what height and width were needed to get the cat to the princess and make some inferences about the relationship between height, width, and coordinates. From there, wouldn’t it be interesting to modify the activity such that the cat and princess start at random locations each time and you need to calculate the height and width of the stairs?

An additional layer of challenge would be to limit the students to only using the “move to x: y:” and “glide to x: y:” blocks – so they have do to the math on the x and y coordinates for the stairs. It’s interesting how working with addition and subtraction as motion in the coordinate plane really expands your knowledge of those operations – we work so often with the idea of “put together” and “take away” that we forget they can represent vectors of motion.

I'm a former software engineer who has taught middle school math and computer science for the past 6 years. I believe every kid has the right to be a thinker. I started this blog to save resources for integrating programming in the Common Core math classroom. I also use it to save my lessons and reflections from teaching budding computer scientists! Coding has transformed how I teach and think. You'll love what it does for you. You should try it.

### 2 responses to “Pre-teaching Slope with Scratch”

1. zamanskym says :

Nice.

There’s got to be a cool netlogo assignment in here as well.

2. Joe says :

I LOVE the idea of introducing slope like this. I think it needs to go farther though. In your example, slope is a ratio between two distances (said more plainly, a number). As a science teacher, I struggle with students understanding slope as a rate of change. I’d love to see a version of this that requires a relationship between two different units, like money and time. There could be a target amount on a certain day, like \$500 on day 10. Then students could do the same thing with a \$ vs day graph. Students then find a slope in \$/day. I think that may reinforce the rate of change idea. To extend that example, you could have a target amount, like \$500 on day 15, and a starting balance, like \$125 on day 0. I think this might help prevent the mistake that I see in physics so often (taking a single position at a certain time and solving speed by dividing the two).
tl;dr: Continue the programming challenge to include more meaningful variables and extend it to include a y-intercept.