3.2 Race to Finish: Day 1

Students are introduced to Pseudocode and create the descriptively names game assets: sprites and backdrop.

OBJECTIVES:



OBJECTIVES: By the end of this lesson, students will:

    • write pseudocode for Race to the Finish game.

    • recall importance of naming sprites descriptively.

    • produce assets for Race to the Finish game.

TEACHER RESOURCES:

Standards

    • CSTA 2-AP-10: Use flowcharts and/or pseudocode to address complex problems as algorithms.

    • CSTA 2-AP-19: Document programs in order to make them easier to follow, test, and debug.

CSTA

DO NOW:

Do Now Impacts of Computing (5 minutes)

    1. Watch Erica Kochi, UNICEF's Innovation Unit (1:59)

    2. Discuss:

      • Why are human rights more relevant than ever before?

      • Erica says" We will constantly be torn between wanting to be safe and advance" . Can you think of an example?

TEACHER GUIDANCE:

We are at the start of the 4th industrial Revolution. We need to protect, include and design for all as we move forward.

Location Sensors: It know where you are, which is useful for google maps and delivering parcels etc, but this information infringes on our privacy.

UNICEF's apps have helped register children's births, immunize for HIV, help children stay in school and most importantly they give people a voice.

Mini-Lesson (5-10 minutes)

Mini-Lesson (5-10 minutes)

Students preview completed project on the student page.

Scaffold students as they write pseudocode for this project using student handout.

      • Pseudocode are instructions for your computer program, written in plain English.

      • Pseudocode is a form of planning.

              • In the movie industry you create storyboards before you start to film.

              • In computer science you create pseudocode before you start to program.


The advantages of pseudocode are:

        • you articulate and clarify your ideas.

        • It is independent of the programming language you eventually choose.

Project (20-30 minutes)

This is Day1 of a two Day PROJECT. Today students create pseudocode and develop assets for their game.

Students will use student handout and video found on student page, to create sprites and backdrops needed in this game.

        • Pair program: two students to one computer. (Pair sharing is a real-world practice that encourages collaboration).

TEACHER GUIDANCE:

    • Some students will paint the finish line on the background, rather than creating a finish line sprite.
      If they do this they will need to test <touching color>, rather than <touching finishLine> Sprite.

    • To avoid this pitfall, teachers could model creating a "finish line" sprite with their class. This also creates an opportunity to talk about giving sprites meaningful names.
      Sprites that have meaningful names, makes code more readable and makes debugging problems simpler.


Difference between Algorithm and Pseudocode:

    • An Algorithm is an ordered series of steps to follow when solving a problem. Recipes for baking a cake, instructions for building a table, or directions to your house, are algorithms. Pseudocode is the intermediary between an Algorithm and a Programming language. Pseudocode is written in simplified human language, that uses syntax which is common to many programming languages. A good example is decision-making syntax like if-then structures; another is looping syntax: eg "for-loops".

    • An Algorithm is a high level (steps) design phase. Pseudocode is the detailed (syntax compatible) lower-level design phase, that can be easily translated into any programming language.

Close-Out (5 minutes)

Close-Out (5 minutes)

Discuss the following questions:

    1. Why do you want to name sprites that you create?

    2. Why is pseudocode helpful?

Potential Responses

    • Using meaningful names will make your code more readable for the programmer and others. Since code is often worked on by many members of a team, it should be easier Clear readable code means less errors are introduced and it is easier to debug.

    • Pseudocode helps the programmer to clearly workout coding steps and syntax associated with these steps, before they start to program. It helps to make the design robust and cuts down on frustrating structural errors.