Programming

Scratch


Scratch combines multi-media and animation with a visual programming language.

Programming language: SCRATCH http://scratch.mit.edu/

Download software: Scratch version 2.0 runs right in a web browser at the url address http://scratch.mit.edu/projects/editor/, so there is nothing to download. You can program in Scratch right in the browser from this url. However, this requires an internet connection when you program or run.

If you require a stand-alone version (e.g. if you need to program or run without an internet connection), then you will have to download a version. The Scratch 2.0 stand-alone editor is available as a beta version from http://scratch.mit.edu/scratch2download/.

Cost: Free

Instructions to setup software: Download code version 1.4; run setup (installation directions are on download url), or run version 2.0 directly in browser with no download required.

Hardware requirements: PC, Mac

Operating systems supported: Win, Mac, Linux

Difficulty level: 1 out of 5


TRY IT!

1. Launch Scratch

2. You will see the programming palette

scratch-step2

 

3. From the variables tab create two variables “degreeF” and “degreeC”

variables

 

4. From the program commands window, drag the icons for the program steps into the program area. The available programming steps are on four separate tabs. “Yellow” icons represent control flow. “Orange” icons represent variables and operations on variables. “Dark Blue” icons represent actions and motions for the animated figure, and “Green” icons represent operations on variables and within control steps.

5. Enter the statements for the temperature conversion program below by dragging the icons from the program commands tab into the statement area.

scratch-step5

 

6. Run the program by clicking on the green flag.

7. You should see a text box appear below the sprite. Enter the temperature that you want to convert.

8. Optionally, simply load this Scratch file and run it!


ABOUT THE PROGRAM — A WALK THROUGH

The yellow box starts the program. All other steps follow this block.

yellow

 

The next statement prompts the user for input and reads the value.

inputvalue

 

These statements convert the temperature.

converttemp

 

The next statement plays a note for 0.5 beats. The pitch of the beat is tuned to the degree F.

The dark blue statement moves the sprite.

spritemove

 

The next statements check the temperature.

checktemp

 

The last line terminates the program.

terminateprogram


TRY THIS

1. Change the temperatures used in the decisions – change the lower temperature from 60 to 30 degrees, for example.

2. Add some statements to have the sprite make a sound.

3. Create a new temperature range from 30 to 60 degrees and have it display – “Bring hat and gloves!”

4. Change the wording of the phrases.

5. Add another text input – ask for the wind speed, for example.

6. Add some conditional statements that evaluate the wind chill factor.

7. Add some text to display the wind chill result


LEARN MORE

http://scratch.mit.edu/ — Great tutorials and 100’s of working examples and source code


RESOURCES, TIPS, TRICKS AND HINTS

The feature programs area on the Scratch website contains really cool programs. http://scratch.mit.edu/explore/projects/featured

You can share your programs on the Scratch website.

Comments about “Scratch”

  1. scratcher 01 says:

    awesome.

  2. G_E_J_Movies says:

    The name is a scratch account I use with my friends. we have about 16 different games, and videos

  3. amzin7000726 says:

    Been using it for a while.
    amazing software

  4. JaceSolo says:

    Scratch is awesome

  5. unicorn says:

    Scratch is a great starting language. It is graphical, and can help you “think like a programmer”

Write a comment about “Scratch”

Nickname:

Type your comment:

  • 1. Safety. Do the following:
      a. Show your counselor your current, up-to-date Cyber Chip.
      b. Discuss first aid and prevention for the types of injuries or illnesses that could occur during programming activities, including repetitive stress injuries and eyestrain.

    2. History. Do the following:
      a. Give a brief history of programming, including at least three milestones related to the advancement or development of programming.
      b. Describe the evolution of programming methods and how they have improved over time.

    3. General knowledge. Do the following:
      a. Create a list of 10 popular programming languages in use today and describe which industry or industries they are primarily used in and why.
      b. Describe three different programmed devices you rely on every day.

    4. Intellectual property. Do the following:
      a. Explain how software patents and copyrights protect a programmer.
      b. Describe the difference between licensing and owning software.
      c. Describe the differences between freeware, open source, and commercial software, and why it is important to respect the terms of use of each.

    5. Projects. Do the following:
      a. With your counselor’s approval, choose a sample program. Then, as a minimum, modify the code or add a function or subprogram to it. Debug and demonstrate the modified program to your counselor.
      b. With your counselor’s approval, choose a second programming language and development environment, different from those used for requirement 5a and in a different industry from 5a. Then write, debug, and demonstrate a functioning program to your counselor, using that language and environment.
      c. With your counselor’s approval, choose a third programming language and development environment, different from those used for requirements 5a and 5b and in a different industry from 5a or 5b. Then write, debug, and demonstrate a functioning program to your counselor, using that language and environment.
      d. Explain how the programs you wrote for requirements 5a, 5b, and 5c process inputs, how they make decisions based on those inputs, and how they provide outputs based on the decision making.

    6. Careers. Find out about three career opportunities in programming. Pick one and find out the education, training, and experience required. Discuss this with your counselor and explain why this career might be of interest to you.

  • Earning the Cyber Chip can help you learn how to stay safe while you are online and using social networks or the latest electronic gadgets.

    Topics include cell phone use, texting, blogging, gaming, cyberbullying, and identity theft. Find out more about the Cyber Chip at www.scouting.org/cyberchip.