21 March 2014
Back in the 80s and 90s, I used to write programs for Amstrad computer magazines. One of the best features was the 10-liners pages in Amstrad Computer User, which challenged programmers to come up with something interesting, fun or useful in no more than 10 lines of code. In many ways, it was a precursor to the coding competitions that still run today, with a limit on the final file size. You can see one of my contributions here:
I got around to thinking about what could be done in up to 10 blocks of Scratch. If you haven't heard of it, Scratch is a highly visual educational programming language. I've been using it a lot at my Code Club, and I wrote the book Scratch Programming in Easy Steps.
It's been an interesting challenge: You could pack quite a lot of instructions into one line of Amstrad BASIC (as you can see from the program above), but 10 blocks of Scratch means just ten instructions or functions. The upside is that the core purpose of the demo really shines through. I've used some of my 10-block programs with my Code Club, and they've enjoyed their simplicity, and the ease with which they can experiment with them. Quite simple ideas, like adding a password to a program, or making one sprite control another have really captured their imaginations.
Here are the 10-block demos I've created so far. Click each one to find tips on how they work, and demos that show them in action:
Feel free to share those images and links on your social networks.
I have a few more ideas, so I've set up a page for 10-block Scratch demos which I'll update as I publish new examples. Do you have any ideas for simple examples you'd like to see? Leave a comment below.