18
Learning to Program with Alice September 22, 2009

Learning to Program with Alice September 22, 2009

Embed Size (px)

Citation preview

Page 1: Learning to Program with Alice September 22, 2009

Learning to Program with Alice

September 22, 2009

Page 2: Learning to Program with Alice September 22, 2009

Chapter 2 – Program Design and Implementation

Vocabulary WordsStoryboardAlgorithmPseudocodeSyntaxScenarioSnapshotTextual Storyboard

Page 3: Learning to Program with Alice September 22, 2009

Storyboard

Is a design approach that is use to create a solution to a problem or plan a list of actions to perform a task.At Pixar, Disney, animators break down a long scenario into sequences of many short scenarios.A storyboard may consist of dozen of scene sketches.Another example, play writers break down a play into individual acts and the acts into individual scenes.

Page 4: Learning to Program with Alice September 22, 2009

Creating a program that animates objects in a Virtual World is a four-step process:

1. *Read the scenario (a description of the problem or task)

2. *Design (plan ahead)

3. Implement (write the program)

4. Test (see if it works)

Page 5: Learning to Program with Alice September 22, 2009

Algorithm

Step-by-step solution to a problem or task.

A procedure for solving a problem.

Example:Rise and Shine algorithm

Get out of bed

Take off pj’s

Take a shower

Get dressed

Eat breakfast

Carpool to work

Page 6: Learning to Program with Alice September 22, 2009

Pseudocode

In an artificial and informal language that helps programmers develop algorithms.

Notes to one self.

Similar to everyday language.

User friendly.

Page 7: Learning to Program with Alice September 22, 2009

Syntax

Statement structure and punctuation.

Format.

Remember:If (condition) then

statements;

Page 8: Learning to Program with Alice September 22, 2009

Scenario

A description of the problem or task.

A scenario is a problem (or task) statement that describes the overall animation in terms of what problem is to be solved or what lesson is to be taught.

Gives all the necessary details in setting up the initial scene and then planning a sequence of instructions for the animation.

Page 9: Learning to Program with Alice September 22, 2009

Scenario provides answers to the following questions:

1. What story is to be told?2. What objects are needed? Some

objects will play the leading role while some objects are the background.

3. What actions are to take place? These actions will eventually become the instructions in the program.

Page 10: Learning to Program with Alice September 22, 2009

Snapshot

Each sketch is a representation or a snapshot of a scene in animation.

It is associated with objects in certain positions, colors, sizes, an poses.

They are numbered in sequence

They are label with necessary information.

Page 11: Learning to Program with Alice September 22, 2009

Textural Storyboard

For the inpatient programmers!

Look like a ‘to-do-list’

Allows us to prepare a planned structure for writing program code.

Example:Do the following steps in order:

Alien moves up

Alien says, ‘Take me to your leader”

Robot’s head turns around

Etc.

Page 12: Learning to Program with Alice September 22, 2009

Evaluate and revise! A good idea.

Once the storyboard has been designed, it is a good idea to take an objective look to decide what might be changed.

Ask the following questions:1. Does the action flow from scene to

scene, as the story unfolds?2. Do any transitions need to be added to

blend one scene to the next?3. Did you overlook some essential part of

the story?4. Is there something about the story that

should be changed?

Page 13: Learning to Program with Alice September 22, 2009

Your Assignment! Lets Review!

Create a visual (see page 23) and a textual (see page 25) storyboard for each of the following scenarios:

A child’s game: Alice, the white rabbit, and the Cheshire cat enjoy a game of musical chairs in a tea party scene. One of the characters yells “switch” and they all run around the table to stand beside the next chair. After the switch, a chair is tipped over and the character standing next to it is eliminated from the game (moves away from the table).

Page 14: Learning to Program with Alice September 22, 2009

Description: Alice, the rabbit, Cheshire cat are waiting to play a game of musical chairs.

Sound: None

Text: None

Scene Number: 1

Page 15: Learning to Program with Alice September 22, 2009

Description: Game starts! Alice calls out “switch” and they all run around the table to stand beside the next chair.

Sound: None

Text: Alice calls out “Switch”.

Switch

Scene Number: 2

Page 16: Learning to Program with Alice September 22, 2009

Scene Number 3

Description: The characters have ran around the table and stand beside the chair. One chair is to be tipped over. (The Rabbit).

Sound: NoneText: None

Page 17: Learning to Program with Alice September 22, 2009

Scene Number 4

Description: A chair is tipped over and the character standing next to it is eliminated from the game and moves away from the table.

Sound: None

Text: Alice calls out, “You are out Rabbit!”

You are out Rabbit!

Page 18: Learning to Program with Alice September 22, 2009

Your Assignment:

Part One:Page 59/47 Exercises: 1 b (A Video Game) and 1 c (An Olympic simulation).Use the handouts!

Part Two:• Continue to finish Chapter 2 – First

Encounters Example• Chapter 2 Tips & Techniques