Exploring Artificial Intelligence in Scratch (just a start)


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. 


Help the emoticon with Scratch or JavaScript!

See the Pen Help the Emoticon! by Joseph Bacal (@bacalj) on CodePen

For a while I have been interested in investigating how Scratch can enlighten my learning of other programming technologies, and vice-versa.  Lately I have been working on my front-end web skills - HTML, CSS3, and JavaScript While trying to grasp the basics of CSS animations, I landed on the simple goal of making a sad emoticon who, when clicked, would cheer up.   

I thought this simple thing would make a good project to duplicate in Scratch, and then use to compare how things work in each.    The CodePen (HTML/CSS/JS) version is "live" above, and the "twin" scratch project is here.   You can compare the code by "seeing inside" on the Scratch project and visiting the project on CodePen and/or clicking the code tabs above. 

0-99 Chart with CodePen

The 0-99 Chart - the surprisingly powerful standby of early and middle elementary math. Use it to visualize calculations, discover patterns, play games.  

I made this clickable one in CodePen, which is an amazing tool that you can use to play and experiment with front-end code.   CodePen is a lot like Scratch - you can click the HTML, CSS and JS tabs to "see inside" and you can click "fork" to "remix"! Use the chart and/or go crazy with the code! 

See the Pen 0-99 Chart by Joseph Bacal (@bacalj) on CodePen