“Cooking Show” CS Lessons / Presentations

What do you do if there isn’t quite enough time in a CS lesson or a CS conference session? What “cuts” do you make and why? What do you focus on and/or highlight? What do you downplay and/or skip? Would your decisions be different if the activity was for new-to-CS learners or experienced CS learners?

This is a dilemma Toni and I have faced on a number of occasions. One approach that we have found particularly helpful for these situations is what we call “Cooking Show CS”.

Consider a cooking show for a minute… Time is not spent equally on each part of the cooking experience. Rather, some parts—the really important parts—are slowed down and discussed and modeled in great detail. Other parts—the not-so-important parts—are sped up considerably or even skipped entirely. Like, seriously, when does a cooking show include “real-time footage” of a recipe baking second-by-second in the oven?? We don’t need to see that—we get it. We often do need to see the preparation and the active cooking and the tips and tricks and the cooking “theory” being applied to this particular recipe. So that’s where a cooking show spends its time.

What would the CS equivalent of this be? What would it look like for a CS “recipe”/program/project to slow down and focus deeply on the preparation and the active computational thinking and the tips and tricks and the computer science theory…while speeding up or skipping entirely the parts that we don’t need to see or do in their entirety?

Here are two vignettes of how Toni and I have tried to used “Cooking Show CS” in 1 hour conference sessions.

Side Note: We don’t think that this pedagogy is always effective or that it is necessarily the best approach in all instances. Rather, we contend that there are times (i.e. short conference sessions) where it might meet a need—allowing participants to “develop” (or co-develop) a program in one hour that otherwise might take them much longer.

Guess My Number

In this particular session, new-to-CS learners were learning about introductory CS control structures, including sequential, branching, and iterative pathways. Participant pairs worked together to make sense of block-based pseudocode for this particular program, then we collectively translated this pseudocode into the text-based language of the TI-84+CE (by hand — more on that decision later). (Toni or I will share more about the block-based pseudocode we used for this activity in a later post.)

We ended up with the following program coded by hand on paper:

:Disp “GUESS IS TOO HIGH”
:Wait 0.5
:Send(“SET SOUND 1046.5 TIME 0.5”)
:Wait 0.6
:
:Disp “GUESS IS TOO LOW”
:Wait 0.5
:Send(“SET SOUND 65.41 TIME 0.5”)
:Wait 0.6
:
:randInt(1,20)→N
:
:Input “GUESS? “,G
:
:While N≠G
:
:If G<N
:Then
:Send(“SET SOUND 65.41 TIME 0.5”)
:Wait 0.6
:
:Else
:Send(“SET SOUND 1046.5 TIME 0.5”)
:Wait 0.6
:End
:
:Input “GUESS? ”,G
:
:End
:
:Disp “YOU WIN!”

Getting to this point took time, as we carefully constructed, deconstructed, and discussed the various computer science principles at play in our program. How were we possibly going to have time to code this program into the calculators, as well?

Here’s where “Cooking Show CS” came into play.

Toni and I created a partially pre-made version of the program (called NUMGAME) and uploaded it onto all of the handhelds in the room. Instead of starting from scratch, participants opened up NUMGAME to find the first 9 lines of code already coded into the program—specifically, the lines highlighted below:

We helped participants navigate through entering the remaining lines of code into the “pre-prepped” program. Most participants finished coding these commands into their handhelds in time to test and run their programs, but a few did not.

We had considered this possibility, so we also preloaded a program called NUMGAME2 onto all of the handheld calculators. This program included all of the lines of code we (as a group) had collectively coded by hand.

This, to us, was akin to the moment in a cooking show where the chef puts a “raw” dish in the oven, but then a few minutes later pulls out a “finished” dish that had already been cooking for the full amount of time. Our choice here was purposeful: We wanted all participants to experience success with the program that they had helped write, even if they didn’t have time to “type in” each line of the code.

We included two additional “pre-cooked” programs for participants to consider, as well—NUMGAME3, which added in additional context for the user, visual (LED) outputs, and a celebratory tone when the user guessed the correct number; and, NUMGAME4, which abstracted the program so the user determined the upper bound on the range of possible numbers and also included a counter that tracked and displayed the number of guesses the user needed to guess the number. Participants were given a few minutes to run each of these programs and then predict what the changes in the code might look like in order to result in these “enhanced” versions of the program.

Respect the Beep

Toni has written here about the “Respect the Beep” session we have led where we use the TI-Innovator and the Ultrasonic Ranger to model a vehicle’s back-up sensor. I discussed this same program (but through a pedagogical lens) in this post about Introducing CS with Flowcharts.

When we led this activity in a conference session earlier this summer, we had a sequence of three programs we were planning to write as a collective group.

Here is the finished code that we wanted to arrive at for the first program:

Toni and I decided to create and provide participants with a pre-made file with the following parts of the program already “cooked”:

Including these commands allowed us to: save a few minutes of coding time in the conference session; and, focus primarily on the theory and syntax of sending and receiving commands from the Ranger, rather than just the digital connections.

Wrapping a While loop around the data collection part of this program doesn’t take a lot of extra time, so that’s something we had participants do themselves, as well, resulting in a program of:

P.S. Highlighting text using the Shift button and then inserting a While…EndWhile loop from the Menu will insert the While loop around the highlighted text. Here’s a little GIF showing this tip:

 

However, we did run out of time for participants to code in the final branching structures that were to be housed inside the While loop. Here was our end goal:

How might we have used another “Cooking Show CS” program here to help us meet our instructional goal in the short amount of time we had with these learners? Toni and I have considered using an “almost done” version of the file that looks like this:

where participants would fill in the output commands (represented above by the highlighted blank lines) within the various branches of the program.

What are your thoughts? How might using a “cooking show” approach for a CS lesson/activity/presentation allow us to focus more on our CS instructional goal and less on aspects that participants perhaps don’t need to see or do in their entirety?

Introducing CS with Flowcharts

Toni and I have spent a lot of time over the past year thinking about pedagogical approaches that are effective for introducing CS topics to learners who are new to CS. Also, we’ve thought a lot about how to do this within relatively short learning episodes, such as a 60-minute conference presentation.

Our goal for the end of a 60-minute conference presentation is usually to have participants code out (on a calculator and also (usually) by hand) a rather complicated program — but, more importantly, to have made sense of said program.

In a recent conference session, our goal was for participants to code a program that modeled a back-up sensor on a car, complete with audio feedback based on how far the “car” was away from an object. This particular program (see Toni’s post here for more information) included sequential, branching, and iterative elements, as well as commands related to connecting to, collecting data from, and disconnecting from an actuator (or peripheral device). These are a lot of different elements for someone who is new to CS to integrate!

How might we design learning experiences to support sense-making around these varied commands/structures…in a way that is accessible for new-to-CS learners?

One approach that we have found particularly effective for this work is using flowcharts — specifically, using flowcharts that develop over time. Rather than just jumping right into this rather complicated flowchart (again, complicated for a new-to-CS learner!):

we instead provided the following blank flowchart and had participant pairs brainstorm what commands might need to go into this flowchart (and in what order) in order to read and display a distance measurement from an Ultrasonic Ranger attached to the Innovator.

Note that the task of collecting and displaying a distance measurement is not our end goal, which is to model a back-up sensor — but we deliberately wanted to decompose this program/situation into simpler situations first. In this case, before we model a full-on sensor, how might we code the Innovator just to collect and display a data measurement?

A quick debrief of ideas from the whole group (plus some information from us on what these commands look like for the Innovator) led to this filled-in flowchart:

With a completed flowchart, we quickly “translated” the pseudocode in this flowchart into the programming language of the TI-Nspire and TI-Innovator. Participants checked that their programs collected and displayed a valid distance measurement as intended.

Next, we asked participants to consider, What if we wanted to collect data measurements repeatedly, instead of just once? We provided the following blank flowchart and had participant pairs consider what commands might go in each element of the flowchart.

Participants talked through lots of important ideas here, including: What should go in the “decision diamond”? What commands should happen “outside” of the loop structure? What commands should happen again and again (i.e. inside the loop structure)?

Debriefing these ideas whole-group led to the following completed flowchart:

We quickly coded these additional commands/structures into the program we had started earlier and tested our new programs.

Now, our program collected distance measurements again and again until the distance was less than 0.01 meters. For the sake of our model, we said that this value represented the back-up sensor turning off after a collision — whoops! 🙂

However, our sensor wasn’t giving us very helpful feedback! It was displaying the distances, but who would be reading that display while backing up?! We wanted to add in audio feedback (beeps!) that alerted us if we were nearing an obstacle. Specifically, we wanted there to be two “levels” of audio feedback — warning beeps if we were nearing an object, but then a more urgent set of warning beeps when we got really close to an object.

We provided the following flowchart for participant pairs to discuss:

which led to a final debrief and this filled-in flowchart:

Here we were, finally, at our programmatic goal! We had collectively developed a program (in flowchart form and in coded form in our calculators) that modelled a back-up sensor.

Yes, it took a while to get there, but the time spent sense-making about the earlier situations and flowcharts helped participants develop and use appropriate CS structures and logic while creating this more complex program. We were thrilled with the engagement, discussions, and explanations from our participants, many of whom were new-to-CS learners!

Side Note: When leading this conference session, we ran out of time during the calculator coding of the final part of the program. 😦 We have discussed some time solutions for this for future presentations of this conference session including having participants code the first program on the calculator, but providing “almost complete” versions of parts 2 and 3 already on the calculator. This will cut time out of the session without losing any of the time that focuses on sense-making about the code.

To create these flowcharts we used the LucidCharts Diagrams Chrome extension, which allowed us to create and store these flowcharts in GoogleDrive.

Here’s a copy of our handout from the conference session; we wanted participants to leave with copies of the completed flowcharts so that they could later replicate this work on their own devices.

How else have you used flowcharts to introduce CS topics to new-to-CS learners? What other pedagogical or instructional approaches have been effective for making CS accessible to all?

Michelle Signature