learning to program with alice 1st semester september 11, 2008

34
Learning to Program with Alice 1st Semester September 11, 2008

Upload: hannah-morgan

Post on 17-Jan-2018

216 views

Category:

Documents


0 download

DESCRIPTION

Chapter 1 – Getting Started with Alice Vocabulary Words: Computer Programmer Alice Object(s) Program Documentation Sequential processing Conditional processing Looping Function Object-oriented programming Virtual World 3D (three dimensional) models Six Degrees of freedom Center

TRANSCRIPT

Page 1: Learning to Program with Alice 1st Semester September 11, 2008

Learning to Program with Alice

1st SemesterSeptember 11, 2008

Page 2: Learning to Program with Alice 1st Semester September 11, 2008

What are you going to do?

You will be creating programs by dragging and dropping program elements (if/then statements, loops, variables, etc.) in a mouse-based editor that prohibits syntax error.You don’t need to write code! The software will do that for you. So, you should not have any syntax errors.Good thing about your programs is that you run Alice programs in a World Wide Web browser. So you can post your work to a Web page!You will be able to create complex programs (say, 300 – 3,000 lines) by the end of the quarter/semester.

Page 3: Learning to Program with Alice 1st Semester September 11, 2008

Chapter 1 – Getting Started with Alice

Vocabulary Words:

Computer ProgrammerAliceObject(s)ProgramDocumentationSequential processingConditional processingLoopingFunctionObject-oriented programmingVirtual World3D (three dimensional) modelsSix Degrees of freedomCenter

Page 4: Learning to Program with Alice 1st Semester September 11, 2008

Computer Programmer

A programmer or software developer is someone who writes computer software. The term computer programmer can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software. A programmer's primary computer language (C, Java, C++, etc.).

Page 5: Learning to Program with Alice 1st Semester September 11, 2008

AliceIt is software that will teach you to program a computer.It allows you become a director of a movie, or the creator of a video game, where 3D objects in an on-screen virtual world move around according to the directions you give them. It was named in honor of Charles Lutwidge Dodson. (Pen name was Lewis Carroll)

He wrote ‘Alice in Wonderland and Through the Looking Glass’.

Page 6: Learning to Program with Alice 1st Semester September 11, 2008

Object(s)

Are things that you can actually see.Some examples:

PersonAnimalTableChair

Page 7: Learning to Program with Alice 1st Semester September 11, 2008

Program

A SET OF INSTRUCTIONS THAT TELL THE COMPUTER WHAT TO DO!

Page 8: Learning to Program with Alice 1st Semester September 11, 2008

Documentation

Comments in the program, a web page for reference, or an accompanying written document that help another human being understand what you were trying to do.

Page 9: Learning to Program with Alice 1st Semester September 11, 2008

Sequential processing

Running a single task to completion.They are statements in a program that are executed one after the other in the order in which they are written.Example: “Beat the eggs, mix in flour, sugar, and shortening, pour into baking pan, then bake at 375 degrees for 45 minutes” .

Page 10: Learning to Program with Alice 1st Semester September 11, 2008

Conditional processing

Remember VB?These are your if statements!Example: ‘If it is raining, than take an umbrella’

Page 11: Learning to Program with Alice 1st Semester September 11, 2008

Looping

This is a repeating behavior.An action that is repeat over and over again until a condition turn false.Example: ‘As long as there are cookies on your plate, keep eating the cookies’

Page 12: Learning to Program with Alice 1st Semester September 11, 2008

Function

Compute a result.It is a question!Example: ‘How much does the baby weigh? Or What is Rebecca’s phone number?’

Page 13: Learning to Program with Alice 1st Semester September 11, 2008

Object-oriented programming

Is programming that uses "objects" and their interactions to design applications and computer programs.

Page 14: Learning to Program with Alice 1st Semester September 11, 2008

Virtual World

A virtual world is a computer-based simulated environment intended for its users to inhabit and interact via avatars (is computer user's representation of himself or herself, whether in the form of a three-dimensional model used in computer games) the form of two or three-dimensional graphical representations of humanoids (or other graphical or text-based avatars). Most, but not all, virtual worlds allow for multiple users.Is a video game or simulation implemented in 3D.Using a virtual world lends a sense of reality to the simulator and increases its effectiveness.

Page 15: Learning to Program with Alice 1st Semester September 11, 2008

3D modelsIs like a blue print used to design a house.The blue print provides a model of what the house will look like.In Alice, 3D models tells Alice how to create a new object in the scene.They provide instructions on how

to draw the object, what color it should be,

what parts it should have, its size (height, width, and depth).

They are located in Local Gallery and additional models can be found on www.alice.org

Page 16: Learning to Program with Alice 1st Semester September 11, 2008

Six Degrees of freedomThe amounts to six possible directions in which an object may move.An object has six degrees of freedom to move around in a world.It’s the object possible direction of motion.

UpBackRightLeftForwardDown

Page 17: Learning to Program with Alice 1st Semester September 11, 2008

Center

Each object in Alice has a unique “center”.The center point of an object is at the center of its bounding box or as near to the center of mass as the graphic artist could determine.The center point provides a reference for a pivot or spin type of movement.

Center located between their feet

Page 18: Learning to Program with Alice 1st Semester September 11, 2008

Chapter 2 – Program Design and Implementation

Vocabulary WordsStoryboardAlgorithmPseudocodeSyntaxScenarioSnapshotTextual Storyboard

Page 19: Learning to Program with Alice 1st Semester September 11, 2008

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 20: Learning to Program with Alice 1st Semester September 11, 2008

Algorithm

Step-by-step solution to a problem or task.A procedure for solving a problem.Example:

Rise and Shine algorithmGet out of bedTake off pj’sTake a showerGet dressedEat breakfastCarpool to work

Page 21: Learning to Program with Alice 1st Semester September 11, 2008

Pseudocode

In an artificial and informal language that helps programmers develop algorithms.Notes to one self.Similar to everyday language.User friendly.

Page 22: Learning to Program with Alice 1st Semester September 11, 2008

Syntax

Statement structure and punctuation.Format.Remember:

If (condition) thenstatements;

Page 23: Learning to Program with Alice 1st Semester September 11, 2008

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 sequenceThey are label with necessary information.

Page 24: Learning to Program with Alice 1st Semester September 11, 2008

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 25: Learning to Program with Alice 1st Semester September 11, 2008

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 26: Learning to Program with Alice 1st Semester September 11, 2008

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 upAlien says, ‘Take me to your leader”Robot’s head turns aroundEtc.

Page 27: Learning to Program with Alice 1st Semester September 11, 2008

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 28: Learning to Program with Alice 1st Semester September 11, 2008

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 29: Learning to Program with Alice 1st Semester September 11, 2008

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 30: Learning to Program with Alice 1st Semester September 11, 2008

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

Sound: NoneText: None

Scene Number: 1

Page 31: Learning to Program with Alice 1st Semester September 11, 2008

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

Sound: NoneText: Alice calls out “Switch”.

Switch

Scene Number: 2

Page 32: Learning to Program with Alice 1st Semester September 11, 2008

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 33: Learning to Program with Alice 1st Semester September 11, 2008

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: NoneText: Alice calls out, “You are out Rabbit!”

You are out Rabbit!

Page 34: Learning to Program with Alice 1st Semester September 11, 2008

Your Assignment:

Part One:Page 47 Exercises: 1 b and 1 c.Use the handouts!

Part Two:Study for test on Friday! You can use

your notes.