Example 1: Hello World - Raspberry Pi A User Manual

Hide thumbs Also See for Raspberry Pi A:
Table of Contents

Advertisement

C H A P T E R 1 1

Example 1: Hello World

When learning a new programming language, it's traditional to start with a very basic pro-
gram: one that displays a single line of text. This is typically referred to as a Hello World
program, and it's the first step towards learning how to create your own programs.
Unlike a traditional programming language, Scratch doesn't expect the user to memorise the
names of instructions like
and dropping blocks of code and arranging them into a logical pattern.
To begin, load Scratch by double-clicking its icon on the desktop or clicking on its entry in
the Programming menu. After a few seconds, the main Scratch interface will appear (see
Figure 11-1). If it's off-centre or small, click the Maximise button—the middle of the three
window control buttons on the right side of the top title bar—to fill the screen.
The Scratch interface is split into multiple panes. At the left is the block palette, which holds all
the different code blocks you can use to create a program. A list of objects in the program,
known as sprites, appears at the bottom-right along with a control for the stage on which the
sprites appear. The stage itself is at the top-right of the window, which is where you will see the
program running. Finally, the middle of the window is where the program itself is constructed.
A N I N T R O D U C T I O N T O S C R A T C H
or
. Instead, almost everything is done by dragging
print
inkey$
159
Figure 11-1:
The main
Scratch
interface, shown
running on the
Raspberry Pi

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Raspberry pi b

Table of Contents