Coding Matter

For this fun activity I collaborated with Matt Caratachea at Glen Allen Elementary. The 5th grade students have been learning about how atoms move in each state of matter. Today we introduced them to coding in Scratch by creating these projects to show how atoms move.

For the solid, we provided the students with a template. They remixed and created a bunch of atoms arranged in neat rows to show how the atoms in a solid are tightly packed and vibrate. Originally the Lego block was a sprite, but we had trouble with the atoms moving behind the block, so for this remix, I made it the background for this project.
[iframe allowtransparency=”true” width=”485″ height=”402″ src=”//scratch.mit.edu/projects/embed/203160673/?autostart=false” frameborder=”0″ allowfullscreen>]

For the liquid, students selected a background of their choice from the library within Scratch. The only rule was that it had to be a location that had water. Students used the drawing tool to draw a circle for the atom and fill it in with a gradient. Students used the x/y coordinates to code the atoms to stay within the areas with water. Then they programmed the atom to glide to a random position within that x/y range.
[iframe allowtransparency=”true” width=”485″ height=”402″ src=”//scratch.mit.edu/projects/embed/204022920/?autostart=false” frameborder=”0″ allowfullscreen>]

Originally, I had planned for the gas to glide to a random position as well, but at a faster speed. A student in the first class suggested that we use “Forever” and “Go to Random Position.” This was an awesome suggestion because it involved less code and had the effect that we wanted with the gas flying all over the screen. For this state of matter, student drew a sky background and selected the orange ball sprite from the library. After they had it coded to always go to a random position, they simply had to duplicate the atoms to have more fly around the screen.
[iframe allowtransparency=”true” width=”485″ height=”402″ src=”//scratch.mit.edu/projects/embed/206244421/?autostart=false” frameborder=”0″ allowfullscreen>]

One of the great things about Scratch is that there is always more than one way to code and it allows the students and I to try out different codes, reflect, change it up, and share ideas. True problem solving and critical thinking in action!
[iframe src=”https://drive.google.com/file/d/1Rr6TWQWJqjYK8Vhy3KrfHiWVqQNELcQz/preview” width=”640″ height=”480″>]