Collatz Conjecture in Scratch

It’s not the first time I have extolled the virtues of Scratch. It is a fantastic platform by which people can be introduced into programming. I fancied doing something creative this evening and playing about in Scratch. I was going to make a little game but then I thought about illustrating an aspect of the Collatz conjecture in Scratch.

I decided to do this as a code-along where I code and just narrate my thoughts while coding. It’s a nice way of coding because it is quite organic (versus a formally planned approach) and so you end up generating small issues and then by troubleshooting them, get a better understanding of why and how things do and don’t work. Whilst dinner was in the oven, I prepared a quick death-by-powerpoint slideshow, setup the video stream, watched an episode of Picard, and then jumped right in.

Apologies for any mumbling etc. in the video but this was quite impromptu but I think I survived it. As ever, hopefully somebody, somewhere will have some benefit. Enjoy.

The code for the project is also available at and is shown below:

Leave a Reply