I got bored with asking my son for multiplication tables, so we programmed together a little game with Scratch.
Tags: productivity, teachingprogrammingtokids, parenting, learning
Published: 2020-02-17 10:28:48

---
title: I got bored with asking my son for multiplication tables, so we programmed together a little game with Scratch.
published: true
description: teaching programming to kids, spending time together, learning math.
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/e05869uljdvq5qun39h9.png
tags: #productivity, #teachingprogrammingtokids, #parenting, #learning
---

Last Sunday my son had to prepare for a Math test in primary school. We spent the week asking him the _Ein-mal-Eins_ ( the multiplication tables) and that morning, while I took some time off any screen and was reading a book, I noticed that my wife spent lots of time to write on a couple of sheets of paper tens of math questions.  
Since my son was playing out with [Scratch](https://scratch.mit.edu/) (he got a Scratch programming book for Xmas and he likes it a lot), I had an idea.

Why not combine the two things? Why not save our precious time and be more **efficient**, have him learn the multiplication tables and learn / play programming at the same time? 

### Let´s build a very simple Math game with Scratch together!

![Math Scratch Game](https://dev-to-uploads.s3.amazonaws.com/i/ll6wkqnaesvskzty0unv.jpg)

Of course, it´s a very very simple game:

> just the character asking random Math operations and making _yeah_ or _boo_ sounds when you enter the results and jumping forwards or backward until you reach the end of the screen and win or lose.  

but both my kids had lots of fun implementing all the features and it was very interesting to see **how they approach the typical coding workflow and share with them some of the joys and pains of our job**.

### Expectations vs Reality

In the beginning, they had very high expectations of what they wanted to achieve, but you have to **start small and proceed with small iterations**.

> You can´t immediately have a flying cat with smooth animations and sparkling explosions while a clock is ticking and randomize math tables with increasing difficulties! 

You have to think at the basic functionality, implement it then improve it and add more details and features:

- Keep it [simple](https://dev.to/dvddpl/strive-for-simplicity-2131).
- Make it run, make it right, make it fast
- Stop, Think, [Iterate](https://dev.to/dvddpl/stop-think-code-iterate-4d56)

We already built some other small projects, but I found this more challenging and fun to do with them because they could be introduced with lots of concepts: 
- timers 
- loops
- concatenating string 
- randomize the values to be used in the multiplication questions
- organizing the code to avoid duplication
- broadcasting messages

While programming it was amazing to see their determination, their creativity - after the basic implementation (just asking a question ´check the result and respond with a sound/jump) they immediately wanted to add a ticking sound and a countdown, an Entry and Game Over screen, etc, how they were disappointed when they found bugs and did not want to leave the computer to have dinner until they smashed that bug. 
( Actually they did not want to stop at all, wanting more and more details.  At some point, I had to tell them laughing that that was just a prototype, an MVP - Minimum Viable Product and that if they want, they can start writing down ideas, and implement them one by one in the future.)


And the look on the face of my little one realizing that **the computer can do the Math!** was priceless.

![wow](https://media.giphy.com/media/1ym5LJ17vp77BL8X5O/giphy.gif)

In the end, we had lots of fun and they learn a lot, both for programming and math,  and the next day my kid showed it to his teacher that was very impressed... and **invited me to hold a workshop for the entire class**.  

I will be 25 kids, in german...  quite scary.  but I am definitely thinking about it. 

---
Photo by Chris Liverani on Unsplash