Monday, October 23, 2017

Day 31: Introducing For Loops

AP CSA

Today we introduced for loops in AP CSA.  I actually went to the facebook group to find some good intro ideas and they supplied in spades!

One person mentioned she used M&Ms and gave students instructions for "while there are M&Ms, eat one M&M".  This made me realize that I could expand this idea to use it with for loops.  It took probably 4 hours over MEA, but I am happy how it turned out.

Today in class we started out with this short clip from The Big Bang Theory about the "Friendship Algorithm".  One of my goals this year is to get better at hooks for new content, this seemed relevant to the topic.  Essentially, Sheledon has a "while loop" and he gets stuck in an "infinite loop" so Howard adds a loop counter that keeps track of the "least objectionable activity"

Then we zoomed in on the algorithm described in the video with the changes Howard made.



From there I introduced the "for loop" anchor chart and practiced it a few times together.

Then came the M&Ms.  I gave students this handout below, asked them to act out the loop, and then write down what it does.  The document is somewhat displayed below but you can find it here as well.



Over all, it went well.  Some students REFUSE to act this out when they trace code.  It kinda frustrates me - it's like the "show your work" in math - just do it.  It makes everything better.  No one thinks you're the cool kid for not showing your work. </rant>


Above: Students worked in pairs to trace code and organize M&Ms.  I gave them each a fourth cup of M&Ms - that was a lot, but somewhat necessary to demonstrate the movement.

BUT that did get me thinking about ways to extend the activity for students who refuse to show their work.  It was a lot of work for ME to come up with these activities, I think for the "cool kids" I can have them generate their own code using the commands given.  Perhaps have them design a loop that makes students split a color into two equal buckets, or one that makes students move everything to the "outside" and then move half of them back in.  Or have students eat enough M&Ms so all the values are equal in a container... there might be more ways I could extend this, but having students write their own code would up the rigor of the task for sure.

We also talked about what SHOULD be in the comments - a lot of students just re-wrote the code in semi-human language rather than explaining what the net effect was of the loop.  I think we could have related this back to the video as well (what the net-effect of Howard's loop was).

Time will tell if this makes the concept more sticky for students - it certainly made it more approachable which is one of my goals for the year.


AP CSP

Today students did the first activity in unit 3.

Overall it went well.  I had students rotate through two different other people's tangram pattern and let them revise their work in between.  Then we did two up on the board to determine what made a good or bad set of directions.  Over all the flow was good, but it could have been a tinge faster for some students.  I know I need to keep this class moving - it seems like it is hard to encourage meaningful reflection with a group of 40 squirrel-y students after lunch.



For that reason, I think I am going to smoosh the next two lessons together and then get them started on programming.

Concepts

We start the deep dive into quadratics now!  We started out with two desmos activities to get things started.

One Good Thing

I needed some classroom management advice today and got two really great pieces of advice from coworkers that helped me think in a productive way about how deal with interruptions.

No comments:

Post a Comment