Mr. Truncale - Robert E. Lee High School
  • Home
  • Digital Media
    • HTML
  • Video Game Design
  • Comp. Programming I
  • Comp. Programming II
  • AP Computer Science
  • 3D Printing
  • Teacher Resources
  • Contact Me

Scratch Loops and If's - Lab set 2


Conditions

In programming, a condition is something that must be true in order for something to happen. A condition is thus said to "evaluate to true" or "evaluate to false." In Scratch, any block whose label says "if," "when," or "until" is a sort of conditional construct. 

One such block is:
Picture
The construct above is generally known as an "if construct." With it can we instruct a sprite to say hello only if, say, the user has depressed the mouse button: 
Picture
A related construct is the "if-else construct":
Picture
With the above construct can we instruct a sprite to say hello or goodbye, depending on whether the user has depressed the mouse button: 
Picture
Realize that these constructs can be nested to allow, for example, for three different conditions: 
Picture
The above construct could be called an "if-else if-else construct".

Labs

Complete the following and upload below
1.loops_boxbug_lab_scratch_aplus.doc
File Size: 48 kb
File Type: doc
Download File

2.loops_drawingbug_lab_scratch_aplus.doc
File Size: 43 kb
File Type: doc
Download File

3.loops_dna_lab_scratch_aplus.doc
File Size: 55 kb
File Type: doc
Download File

dna.sb
File Size: 19 kb
File Type: sb
Download File

4.loops_scroller_lab_scratch_aplus.doc
File Size: 60 kb
File Type: doc
Download File

scroller.sb
File Size: 17 kb
File Type: sb
Download File

TURN IN

Robert E. Lee High School
1809 Market
Baytown, TX 77520
281-420-4535
digital media | computer programming I and II | BIM
ap computer science | architectural cad | video game design
national technical honor society | contact me