Exploring Artificial Intelligence in Scratch (just a start)

three_robots.png

Three weeks ago, one of my fifth grade students asked me (as if it was a perfectly normal thing to ask), "Can we make AIs?"  I was happy to respond with "Yes!"  Since then, my students and I have been exploring the possibilities for creating "smart" robots that could appear to have a conversation with us.  

Over the weeks we came to three basic types of "robot conversation programs." The first uses the ask/answer block to "parrot" back user responses in a new context.   The second stores answers in variables for later use, and the third adds conditional statements to give different responses to different answers.  The illustration on the left highlights the key lines of each robot's script.  You can test each in this Scratch project

As we worked, I posed the question to students:  Does the computer "know" anything?  They had interesting responses, like: "No, they are programmed to say they know things but they don't really know them."  And, "It's like they know it but they don't know they know it."

Also, one student spontaneously started calling variables "memory banks" and I think this bit of movie-language really helped some other students remember the "variable" concept.  I now call variables "memory banks" and it is much more fun that way. 

Of course, this is just the tip-of-the-tip-of-the-iceberg when it comes to AI.  I'm sure someone out there in machine learning land can put these in some bigger CS categories. 

 

Yum: Vector-Based Popcorn

Working with vector graphics is a little like working with clay.  You start with flexible lumps of "stuff" (rectangles and ellipses), then push, pull, bend, and layer until you have something.  I made the graphic below and an accompanying Scratch project to illustrate that basic idea. I plan to pass it out to my classes on Tuesday. 

vector_mode_helper_bacal.png

The four panels of the popcorn bag, and the two bits of red stripe each began their lives as rectangles.  Gradients were added to the fill, and points were added to the paths.  Points were pushed and pulled here and there.  The kernels were made with ellipses.  They all come together to give the illusion of a bag of popcorn.  I hope you find this useful!  I made it my design goal to use no words - I wonder what adding some would do?

Lo-Fi Cut-Out Scratch Blocks

lofi_thumb.png

In class, I sometimes use some faux Scratch blocks I have cut out from foam board.  The foam has worn over the months, so I thought I'd make a fresh batch - maybe smaller sets printed on card-stock?  I am thinking it would be good to do some more gross-motor code-it-on-the-floor stuff.  One thing that is fun is to have one kid be the sprite and another pair assemble scripts - and the sprite kid acts it out.    The class gets to "evaluate" and see if the Sprite was following the directions.  Another thought would be to glue this on thicker-still-foamy stuff, and cut those out.  Or blow it up and use it as a template to cut out the big ones.  Who knows? If you like, you can download a PDF of these lo-fi blocks by clicking here:  Download PDF

Starfish in a Hot Air Balloon

Here is a concept kit I made in Scratch to teach the use of conditionals with a loop and operator.  Here is a link to the puzzle, and here is a link to the solution

starfish_balloon_1.png

Starfish, naturally, would like to fly his hot air balloon.  As the programmer, your job is to create scripts that

   1. Make gravity slowly pull the balloon down until it hits the ground.  Since Starfish is in a balloon, we can forget acceleration. 

   2. Make the balloon go up if Starfish turns on the gas (spacebar), and then fall again if he lets go.  

   3. Show the Starfish's response to the action.  

This project went through a number of iterations.  I had some versions with all kinds of variables to calculate acceleration and create states for the Starfish, but I kept seeing if I could make things simpler.

 

 

 

Concept Kits in Scratch

I have been experimenting with various formats for introducing concepts and skills in Scratch for my 3-6th grade classes.  In particular,  I have been working on ways to engage those kids who have a harder time "getting it" early on.    

I have created a few projects that I'm calling "kits."  They have simple goals, and some scaffolds built in (e.g. pre-dragged-out blocks).   They are somewhere between a Scratch card and a blank slate.   Today I took the same basic concept from 1.4 "forever-if" and used it to make a 2.0 version: "Conditional Kit #1

Slides for Teaching "Forever If" in Scratch

Here is a slide show I made to explain the big idea behind "forever if" in Scratch 1.4.  My goal was to make a project that would illustrate these ideas with as little code as possible, as I had a number of students frustrated by this.   All the necessary bits can be seen on the last slide, which I kept up for the working period.  If you are on 2.0, the forever and if blocks are separate.  The keynote file has animations...(download)

Direct Instruction, ok I said it.

That sums up the debate I go through just about every day as an educator.   Despite a whole lot of progressive training and thinking, I too sometimes wish "they would just get it so we can keep going..." 

For some kids,  just seeing the first two scratch blocks connect and the cat move as a result of a space-bar press is enough send them off and clicking, experimenting and watching results, picking up understandings on the fly.   For many others, I've reluctantly found that more direct instruction at the get-go has helped them get engaged sooner. 

Thinking about this after class last year, I wondered: "What criteria should I use to decide when to offer a student 'direct instruction'?  What do I even mean by that term?

At first, there seemed to be an obvious answer: "When the student is asking for help, answer their specific question."   When students feel confident and curious enough to ask a question, they make our job easy and gratifying.  They ask a dream question like: "How do I get him to move in the other direction?"

But it turns out these are often exactly the students who really don't need the direct instruction.  They ask, and we get to respond like the teacher from a book we read in grad school: "Well, take a look at how you made him go to the right. What are those blocks saying? What do you think?"  Then they get back to puzzling and we move on. Yay.  I didn't have to do any direct instruction after all. 

I think it gets complicated when students are in a far more hazy, and less happy/engaged zone, and they are asking something that indicates we might just be about to lose their interest,  something like, "Wait, so what is the cat supposed to do..."?

If I answer, "It's not supposed to do anything, you get to invent something for it to do!" I may get a smile and observe a renewed sense of confidence, but I will just as likely get a look of disbelief and see the student slump down a notch.  The thought bubble pop up: "I really don't get this."

These are the moments, I think, to decide on a kind of direct instruction where we go from "teacher" to "pushy experience-sharing person."  I might say something like, "Here's something I think is cool, can I show you what I was thinking when I was trying to figure it out?"