Professional Documents
Culture Documents
SE-1001Lab01 Fall 2023
SE-1001Lab01 Fall 2023
Scratch Programming:
Scratch is block-like programming language to create visual program and also write code for
other innovative problems easily using visual block of codes.
With Scratch, you can program your own interactive stories, games, and animations.
Using Scratch, users can create online projects and develop them into almost anything by using a
simple block-like interface.
Scratch Environment:
Sprite: Is an actor in scratch programming which shows the result/output for the written block of
code in Script area.
Script Area: The area in which statement block dragged from Script block and drop to the script
area.
Task01 (degree.sb)
Create script to change the direction of sprite 15 degree in clockwise direction.
Example 02
To move a sprite 10 step in forward direction with when click condition
Task02 (move.sb)
Create a script to move 50 steps
Example 03
Task03 (thinking.sb)
Create script for join puzzle in which sprite think for problem solving and wait for 2 seconds
repeatedly three times.
Example 04
Example 05
Usage of Operators
Task05 (cube.sb)
Create script to take a number from user and print its cube.
Decision making Block: Decides whether certain criteria (condition) is true or not. If true it
executes if block otherwise it executed else block.
Example 06
Decision making Statement-checks whether you typed zero-(without else block)
Task06 (SpellCheck.sb)
Create script to ask name from user and check if its Pakistan then sprite said Pakistan for 5 sec using
if block.
Example 07
Decision making Statement -checks whether you typed a positive number or a negative number
(with else block)
Task07 (above100.sb)
Create script to ask string from user tell whether it’s greater than 100 or not.
Example 08
Repeat Block
Task08 (MultiChange.sb)
Create script to ask number from user and check if its negative then play sound (mew) else play
drum (Hand clap) repeatedly 10 times.
Example 09
Forever Block: Repeats itself forever, it has no repetition limit defined.
Forever Block
Task09 (bounce.sb)
Create script to move sprite in any direction forever if it touches the any side of edge then
bounce and move.
Learning Assignment 01
Problem01 (signup.sb)
Take a user name, password and age as input and create account of the user if he/she is above 18 years.
Problem02 (login.sb)
Take a username and password as input and validate if password is equals to 12345 then login to the system.
Problem03 (change.sb)
Take a number as input if the number is less than 0 then change the color of sprite else change the position
of the sprite by 2 points by y.