Back to: Scratch Programming
What is Computer Programming?
Computer programming is the process of writing instructions to be carried out by a computer. Your computer and all of the websites you visit, your phone and all the apps you use, and any video games you play are all made possible by computer programming. Computer programming is also the driving force behind many of the world’s current technological advancements, including artificial intelligence, autonomous vehicles, and virtual reality. Just like a game designer, computer programmers constantly move through a cycle of prototyping, testing, and tinkering with their programs. This is often called the engineering design process. This process is used throughout engineering, science, and design-related fields and exists in several different versions.

- Ask
Define the problem, identify the requirements for the design (criteria) and how their choices may be limited (constraints). This includes considering the needs of users and implications of the solution. They explore materials and consider which are best suited to the challenge. - Imagine
Creatively brainstorm ways to solve the problem. - Plan
Share and select your best ideas to generate one design. Sketch a plan and list the materials it uses. - Create
Groups work together to make the solution they designed. - Test
Each group tests its solution against the performance criteria. Groups share and analyze data to determine where improvements might be made. - Improve Cycle
Students improve their design by going through another iteration of the process.
Code Blocks
In Scratch, programs are written by connecting the coloured code blocks. To start building programs, drag blocks from the block palette into the coding workspace in the center of the project editor.
Hello World! (Our first programme)
Lets make our programme using Scratch Code Blocks. Drag the following code blocks into the coding workspace.

Press SPACE to execute the program:

There are currently 119 different blocks in Scratch, divided into 8 categories:
- Motion,
- Looks,
- Sound,
- Events,
- Control,
- Sensing,
- Operators, and
- Variables.
We will introduce blocks as they come up in our code, but it is very helpful to spend some time looking through the categories and familiarising yourself with the different available blocks. Understanding the different tools at your disposal is crucial to being an effective programmer! Visit the Scratch Wiki blocks guide for detailed information about all of the different types of blocks and how they work together. Here are some general tips for working with Scratch’s code blocks:
Block shapes
Pay attention to the shapes of blocks and different blocks connect to one another. A block’s shape will tell you about how it is to be used in a program and how it will work with other blocks.

Numbers and Text
In any blocks containing numbers or text inside a white space, these numbers or text can be edited to any value you want! Just click on the text inside the block, delete it, and write whatever you want in its place.

Dropdown Options
Some blocks contain a small white dropdown arrow. Additional options can be selected for these blocks . Just click on the arrow to expose the menu, and select your option.

Finish and save your “Hello World” program
Add a Sound block in the second bottom line of the program. On the File menu select Save Now and call your program “Hello World”.

You can toggle to a Stage View to run the program by clicking See Project Page,

In Stage View you can execute your program, click the “full screen” mode button for full screen mode or See Inside to take you back to the Project Interface. The GREEN FLAG and RED STOP buttons start and stop execution of the program (Remember to press SPACE to start your program because our first line requires it).
