Friday, 28 November 2014

Make Snowflakes with Code for Hour of Code!

Oh the weather outside is frightful, but the fire is so delightful. And since we've no place to go, let it snow, let it snow, let i snow virtual python turtle snowflakes across my Raspberry Pi screen!

Yes, it is that time of year when I break out my christmas jumper, put Frozen on repeat and start eating Lebkuchen by the bucketload. coincidentally, it is also Computer Science Week 8th December to 14th December 2014 and are asking everyone to take part in just one hour of code. They have created a website full of activities for any ability or interest and one really caught my eye. It is called 'Artist with Anna and Elsa from Frozen'!

I love making patterns with code, as you may remember from episode 27! There is a wonderful python module called turtle. In fact turtle has been around for a long time, and I fondly remember typing my first computer code into a BBC micro to make a turtle draw a square. Therefore I have a bit of a head start, and so the Anna and Elsa activity on only took me a few minutes. As I like a challenge I thought I'd see just how far I could push myself with python turtle to create similar snowflakes. 

I created a python program to draw snowflakes at random places in a window with random pen colour!

If you would like to learn how you can create snowflake shapes with code then check out my latest episode:

If you would like to take a look at my final code then you can clone if from my github page or just take a look here!

1 comment: