Scratch Programming Notes PDF
Document Details
Uploaded by Deleted User
Tags
Summary
These notes provide an overview of Scratch programming concepts, including commands, algorithms, sequences, iterations, subroutines, variables, and selection. They are designed for students to understand different programming constructs. The notes focus on fundamental programming concepts applicable across various programming languages.
Full Transcript
Scratch Programming with pen extension Student notes Command A command is a single instruction. It is sometimes referred to as a statement. Algorithm A sequence of commands to achieve a particular outcome. e.g. an algorithm could be a set of commands to draw a zigzag line Prog...
Scratch Programming with pen extension Student notes Command A command is a single instruction. It is sometimes referred to as a statement. Algorithm A sequence of commands to achieve a particular outcome. e.g. an algorithm could be a set of commands to draw a zigzag line Programming concept - sequence The order in which commands are executed. e.g. the same range of commands in a different order can produce different outcomes. Programming concept - iteration Iteration relates to the repetition of commands/sets of commands. There are different types of looping structures, for example in Scratch there is a FOREVER loop and a REPEAT loop Subroutines (a procedure is a type of subroutine) Subroutines are predefined sets of commands that can be called / invoked by using the name of them in the script. The images below show the subroutine, triangle, and how it is used: Variable A named placeholder for data. It can store different types of data and the value of the data can be changed. In programming two impotant types of variable are: Global variables – these exist outside a procedure and can be used by different procedures Local variables – these are used within a particular procedure Thinking about global and local variables, in Scratch, a variable can be made for a single sprite, or all sprites. Programming concept - selection Selection is where conditions are used to determine when commands should be executed. An IF ELSE statement is an example of selection.