Making a programme from Scratch!
Well, I think your first question will be “what is Scratch?” Scratch is a programing language that almost everyone can understand. It’s blocks look like blocks of colour and you can find different ones by clicking on buttons like the ones below (these buttons don’t have any links).
[button bg_color=”#d130cc” border=”#d627d6″]looks[/button] [button bg_color=”#0900ff” border=”#0900ff”]motion[/button]
[button bg_color=”#ff0048″ border=”#fc002a”]variables[/button] [button bg_color=”#96e3ff” border=”#96e3ff”]sensing[/button]
[button bg_color=”#ffea00″ border=”#ffea00″]control[/button] [button bg_color=”#0dff00″ border=”#0dff00″]operators[/button]
[button bg_color=”#e0a100″ border=”#e0a100″]events[/button]
For example, if you click on the [button bg_color=”#ffea00″ border=”#ffea00″]control[/button] button then all the [button bg_color=”#ffea00″ border=”#ffea00″]control[/button] bocks will come up in the middle of the screen. The [button bg_color=”#0900ff” border=”#0900ff”]motion[/button] blocks are used to move Sprites (Sprites are charecters).
If you want to go to the scratch website, click on the [ilink url=”http://scratch.mit.edu/”]Scratch[/ilink].
Scratch is a very fun way to learn to program, and I do it on my own computer. But my computer is not an ordinary, fast computer that many people own. It is not even a laptop. It is a Pi. More on that at the end of this post.
Some of the blocks are shaped like a squashed and bumpy letter C. These are from the [button bg_color=”#ffea00″ border=”#ffea00″]control[/button]
Those are called “loops”. There are “if loops”,”repeat___ loops”, “forever loops”, “if – else loops” and “forever if loops”. “If loops”, and “forever if loops” can have [button bg_color=”#96e3ff” border=”#96e3ff”]sensing[/button] blocks added in.
You can make [button bg_color=”#ff0048″ border=”#fc002a”]variables[/button] by clicking the [button bg_color=”#d1bebe” border=”#d1bebe”]make a variable[/button] button and entering a variable name.
[button bg_color=”#ff0048″ border=”#fc002a”]variables[/button] are like small boxes; they can fit words, values and strings(strings are messages). One thing you can do is use the “ask_______and wait” and “answer” blocks that can be found in the [button bg_color=”#96e3ff” border=”#96e3ff”]sensing[/button] area. You can use the “set___to___” from the [button bg_color=”#0dff00″ border=”#0dff00″]operators[/button] area to set the answer to a variable. For example, where a is a variable: “set ‘a’ to answer” will store the answer in the variable “a”.
The most useful blocks are the [button bg_color=”#e0a100″ border=”#e0a100″]events[/button]. They let you run a program and start it. They are shaped like a slide with smooth steps on the other side. The “broadcast” and “when I recieve” blocks let one Sprite react to another Sprite or the stage.
I hope this has inspired you to make your own Scratch projects; Scratch is free and all you need is Adobe Flash Player. Scratch is easy to download (just click the link saying “Scratch” and it wil download. If you want to share your projects online make a profile by clicking “join Scratch” on the website).
It’s as easy as Pi!
Now if you’re wondering “What on earth is a Pi? Is it this like this: π? Is it the kind you eat?” Well, it isn’t either of those. It is a mini computer.
This is a picture of my Pi:
If you want to learn more about the Pi, click this [ilink url=”http://www.raspberrypi.org/”]Pi computer[/ilink].
1 Comment
Fantastic work Sameul. Looking forward to seeing it when we are over. Love Mark