Accidental Discoveries When Teaching Coding with Geometry

Having used coding for this school year, it seems like there are so many teachable moments to use with my class that I did not know existed.  I want to outline three accidental discoveries while I was teaching geometry.

1. Teaching the characteristics of shapes is in the Code

I have taught characteristics of shapes countless times in my career.  It wasn’t until I integrated coding that I discovered an amazing way to teach this lesson.  Coding forces kids to read the characteristics of shapes.  Lisa Floyd particularly likes this lesson.  Look at this code:

Screen Shot 2015-06-03 at 6.08.11 PM

To identify this shape, students would examine the code and point out:

  • All of the sides are equal (Move Forward 300)
  • There are more than one 72 degree angles (more on this point later)
  • It repeats 5 times

Knowing the above, a student might guess that the shape is a pentagon.

2. To code a shape, students have to know the exterior angle as well as the interior angle

I remember an EQAO question that asked students the exterior angle of a shape similar to this drawing I showed my class:

Screen Shot 2015-06-03 at 6.10.48 PM


To code a pentagon using Hopscotch, students discovered and told me that the character has to travel in a complete 360 degrees so that he returns where he started.  In coding a pentagon, you would divide 360 by 5.  So a student would place 72 degrees in the code repeated 5 times.  This fact allowed me to focus on that EQAO question that stumped my class years ago.  To code Sphero, a student would follow the same code so that the robotic ball follows the correct path.

Screen Shot 2015-06-03 at 6.31.41 PM

3. When a shape repeats and draws, it always forms a circle

After coding a shape, students wanted to rotate the shape slightly and make the drawing repeat countless times.  They considered it fun.  No matter which shape was coded, it always created a circle when it was repeated.  This concept is hard to explain and perhaps these images will explain my accidental discovery best.  The code on the top, produces the pentagon / circle pattern seen below:

Screen Shot 2015-06-03 at 6.08.25 PM  Screen Shot 2015-06-03 at 6.09.48 PM

Students were genuinely fascinated to learn these geometry points in an authentic way.  They were also motivated by the fact that I did not intent to teach these accidental discoveries.  Isn’t learning best when teachers are surprised too?  I look forward to hearing your thoughts and maybe you can share your accidental discoveries in using coding.



Filed under Coding

8 Responses to Accidental Discoveries When Teaching Coding with Geometry

  1. I love the curriculum connections you’ve made here, Enzo, and how you’ve gotten the students to think more about the properties of shapes (in a meaningful way). Have you had any students struggle because they cannot visualize how the numbers values to the shape? If so, how could we still use coding, but provide the additional visual support? I keep on thinking about this, and I’d be curious to know what others have tried. Thanks!


    • Hi Aviva!
      The short answer is “yes.” This approach does not work for all students and some can not visualize the shape according to numbers. Any approach taken will not appeal to everyone. At the sometime, coding appealed to many students in identifying the shapes. Teachers need a variety of approaches at their disposal and coding wasn’t the “be-all” in my teaching of characteristics of shapes. An interesting side note, some students guessed the incorrect shape, because a certain characteristic (i.e. angle) was common to more than one shape. They still had to recall characteristics even if they were incorrect. Some students required additional visuals, concrete materials, diagrams and computer software . . . to name a few. Coding is a tool to help those who understand it. Thanks for your comment ~ Enzo

      • Thanks Enzo! I definitely agree with this, and am certainly a big proponent of choice in learning (for much this reason). I wonder though if a visual couldn’t be connected to the coding (to help those students that can’t visualize start to “see it” based on the visual). Maybe as the answers are being discussed, and the correct answer is revealed, the “think aloud” strategy coupled by the visual could help students “see” what they couldn’t see before. Maybe visuals could be out on the floor to help students make the connections between the values and the shapes. I’ve never tried any of these approaches before, and I would definitely be the student that couldn’t visualize based on numbers alone (and sometimes even with the visual in front of me), but I wonder in multiple options merged together would work. What do you think?


        • Of course! The shape / visual was included and referred to. To appeal to more learners, and draw those links . . . it would have to be. In writing this blog, I did not feel the need to constantly have visuals because my audience is obviously different. I remember hanging the visual shape beside its code (practically game show style “you’re right!”) Incorporating shapes and visuals would strengthen this lesson without a doubt. ~Enzo

          • Oh yes, for sure, Enzo! Thanks for sharing a bit more about what you did. I can totally see this idea working, and I’m glad to hear that it did. Do you think that the use of visuals could help more students successfully work with coding (almost like scaffolding of sorts)? I’m wondering now what these visuals might look like in primary grades, and how these programs might be used in younger grades as well. Thanks for giving me more to think about!


  2. I could see providing the shape for assisting with code absolutely and for sure. That would be excellent scaffolding. However, I would think that scaffolding would still be for the junior / intermediate thinker. In our discussion, Aviva, you know I struggle with coding in primary. It’s not that coding can not be done with primary students. But I think it would look completely different (i.e. kodable). The strategy I outlined is probably more suited for the junior grades at least. I have never taught primary, so I can’t pretend to be all-knowing and provide a simple answer. I would love to see how primary teachers have used coding . . . . ~Enzo

    • Thanks Enzo! I continue to vacillate when it comes to coding in primary. I see some benefits for sure (especially when it comes to thinking and problem solving), but it’s making these curriculum connections that can be more challenging (especially for young primary students). I know that Grade 1 students, for example, don’t need to know angle measurements, but they are supposed to explore the properties of shapes. I can’t help but wondering if coding, to some extent, could help with this (especially with a visual provided for more scaffolding). I’m not sure. I have to think this one through more, but I’m tempted to do some experimenting in my classroom before school ends. Maybe I need to do some playing around by myself first. You’ve inspired me to try, Enzo … thank you!


  3. Donna Rosenberger

    When I am using this with students supplementary angles are very important. I also use regular shapes. I show two examples, one like yours then one that draws the shape and moves ( rather than turn ) between shapes. This shows a big difference in the look of the pattern. I also have students add things to shapes like a pole to a rectangle to make a flag.

Leave a Reply

Your email address will not be published. Required fields are marked *