Many years ago, when classroom computers first became available, we created Computer Labs at each of the three middle schools in our district. Every student cycled through a lab, for one period a day, for a semester. We wrote our own curriculum and two-thirds of the class time was spent teaching the kids Logo, the first kid-friendly programming language to originate at MIT. Logo, like Scratch, makes it very easy to turn the normally static study of geometry into a very dynamic experience for the kids.
As middle school students, they were also butting heads against an algebra class and it wasn’t a pleasant experience for most of the kids. In the computer lab, we spent a lot of time working on the variable concept giving the kids problems and projects to program that required the use of one or more variables in the code.
One of our programming goals was to have the kids develop a generalized polygon procedure (script). View this short, one-minute video to see the generalized polygon script in action.
A lot of geometry content is used in building the script. For years we saw unusually high scores in the geometry section of the standardized math tests the students took every year. Alas, as I write this, every one of the labs is gone in that district.
I've written a detailed explanation of how to build the generalized polygon script in Scratch. To obtain a free copy, email your request to firstname.lastname@example.org and I will email you the pdf file.
Go to this link
to download a Scratch program file that includes the ant, the two sliders, and the sand background ready for you to build the script as instructed in the above pdf file.