Exam Wednesday No inclass assignment this week. Friday labs will help with individual homework assignment due Friday midnight Review for exam –Tuesday.

Slides:



Advertisements
Similar presentations
Mike Scott University of Texas at Austin
Advertisements

Alice Learning to program: Part Four Creating Sounds, Making Billboards, Fun with 3-D Text, New Events, and Rotating Objects by Ruthie Tucker and Jenna.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Class-level Methods Alice. World / Class Method World method A general method that may refer to multiple objects; not closely associated with any particular.
Class-level Methods Chapter 6. Class-level Method Is specific to a class of objects We can give a class new abilities/methods Only involves this one class.
PIIT Computer Science Summer Camp - Alice July 10, 2012 Brenda Parker Computer Science Department MTSU.
Implementation with procedural methods. Recall: Step 3 Write statements (code) – a few steps at a time, not the entire program at once! Problem Statement.
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Skater World: Part Four By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 2009.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Programming in Alice Chapter 2. Today’s Agenda Designing a Program Writing Methods Executing Instructions Simultaneously Comments Tips for Setting Up.
Programming in Alice Chapter 2 Part 2. Events Editor Identifies what method is executed (run) when the “Play” button is hit 2.
Copyright 2011 Wanda Dann, Steve Cooper, Don Slater Alice Workshop Implementation Algorithm  Code World.my first method Control blocks Statements (methods,
METHODS!.  A method is a sequence of instructions or behaviors that will be carried out when requested.  You can use them to create new methods so that.
PowerPoint: Tables Computer Information Technology Section 5-11 Some text and examples used with permission from: Note: We are.
Princess & Dragon Part 4: Breathing Fire—Adding Effects to Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June.
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley This week: Whew!!! The last homework was tough! The homework for this week.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Class-level Methods Chapter 6 part 1. Classes and Objects Classes o In Alice, classes are predefined as 3D models Objects o An object is an instance of.
3–D Helium Molecule Tutorial Alice Project Duke University Professor Susan H. Rodger Gaetjens Lezin June 2008.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
Changing Color, Using Text Objects, and Random Selection in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)
Teaching a character to walk in more than one world: Parameters and Inheritance. By Lana Dyck under the direction of Professor Susan Rodger Duke University.
Alice: A Visual Introduction to Programming Chapter 1 Part 2.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Exam scores by range 3-1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Where are we? Alice is a “toy” language Fundamentals are exactly like “real”
By Deborah Nelson Duke University Professor Susan Rodger July 13, 2008.
Animating Objects in Groups: Using Arrays and Lists By Ruthie Tucker under the direction of Professor Susan Rodger Summer 2008.
Lesson 9B Adding sound and Billboards. What is a function? Give an example. How do you create a method? Give an example. What is an event? Give examples.
Lists Tutorial By Deborah Nelson Duke University Professor Susan Rodger July 13, 2008.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1,
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Alice Workshop November 2009 By: Kim Glavan New Lenox School Dist #122.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Alice 3.0 A Guided Tour Mike R-D YRDSB. Agenda General Walkthrough of Alice 3.0 Loops, Variables, Threads Methods / Properties Arrays Misc.
Review: the Dummy Marker Typically used for: Positioning large and small objects in a scene Remembering camera positions for multiple scenes Remembering.
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko under the direction of Professor Susan Rodger Duke University July 2013 Updates.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Skater World: Part Four By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1, 2009.
An Introduction to Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University, June 2009 Updated June 2014 by Ellen Yuan.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Illuminating Computer Science CCIT 4-6Sep
Headshots in Alice Duke University Professor Susan H. Rodger Gaetjens Lezin July 2008.
Princess & Dragon Part 3: A Knight Comes Riding In—Cameras & Events By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June.
Presenter: Carol Liss Timberlane Regional Middle School 6 th and 7 th grade Tech. Educator Co presenters:
An Introduction to Programming Using Alice 2.2, Second Edition Chapter 7 Recursive Algorithms.
Chapter 2: Programming in Alice
Programming in Alice Chapter 2.
An Introduction to Alice (Short Version)
Chapter 3: Variables, Functions, Math, and Strings
Chapter 3: Variables, Functions, Math, and Strings
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Chapter 2: Programming in Alice
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
An Introduction to Alice
Introduction to Object-Oriented Programming in Alice
Getting Started With Alice
Presentation transcript:

Exam Wednesday No inclass assignment this week. Friday labs will help with individual homework assignment due Friday midnight Review for exam –Tuesday 1:30-3 in Main 416 –Tuesday 7-8, in SER 005 –Posted Study Guide No make-ups given without prior approval 2-1

Review of chapter 9 Center of an object is not computed – it depends on what is most useful for the object. When you move an object to the world (0,0,0) - it will often be half beneath the ground Where should the “center” of the following be: –bat –person –fish –ball The answers depend on what the object designer thought you would want to do with it. 2-2

Starting Out with Alice: A Visual Introduction to Programming First Edition by Tony Gaddis Chapter 10: Programming in Alice

3D text – can be created like any object 2-4

You can also add a jpg, gif, or tif file… Go to file> Make Billboard Then select the file you want to include RightClick>Copy is invaluable! Be sure to use undo! That can save lots of frustration 2-5

2-6 Chapter 10 Objectives To understand: –method naming conventions –what dot notation is –what a primitive method is and which objects have them –what is meant by “calling” –what an argument is in a program. –differences in naming conventions –the steps of the program development cycle –what a logical error is –the need for commenting

Tips You will learn Alice best by exploring – like you would with a new cell phone. You take it out of the box – poke and prod. You have a general idea of what you would like to do.This directs your exploration (how can I make creation of similar instructions easier?) As you discover interesting things, them to me and I’ll post them! ALICE is the vehicle to explore algorithms, programming concepts, and logical thinking. Proficiency in ALICE is NOT THE GOAL. 2-7

2-8 Writing Methods What is a method? –set of instructions that execute –create methods by dragging tiles into the Method Editor –these tiles are the instructions my first method

2-9 Naming Conventions dot notation –world.my first method dot (period) separates pieces of information –left side: object that the method belongs to in this case…the method belongs to the WORLD object –right side: name of the method in this case… “my first method” –later on we’ll have coach.yell or frog.jump dot notation “qualifies” the command – who yells the period is called a “dot” 2.1

Method names should be meaningful 2-10 Rightclick to rename

2-11 world.my first method Events Editor identifies which method plays or is acted upon when the “Play” button is hit 2.1

2-12 world.my first method Methods play the instructions (tiles) that are dragged into the Method Editor This method of creating instructions is a bit tedious, but is done to reduce errors 2.1

2-13 Primitive Methods – ALL objects can do All objects have a common set of built-in method for performing actions. All objects can move, turn, change size, and more. Example: Hare has primitive methods to move, turn, roll, resize, say dot notation: hare.move 2.1

2-14 Terminology Calling the method. hare.move (like subject/verb) –executing or performing the instructions of a method Argument: –piece of information that a method needs in order for it to execute –hare.move…which direction? the direction…up, down, left, right…is the argument Passing the Argument: –the method is called and the arguments are presented object method argument 2.1

2-15 Editing Tag Holds possible additional arguments What appears depends on the method called –duration specifies amount of time for action to take place default (1 second) 2.1

2-16 Deleting – be sure to click on instruction itself not the object Right-click the instruction and select delete OR drag the instruction tile to the trash can 2.1

2-17 Copying Right-click the instruction and select copy Drag the instruction tile to the clipboard –when the clipboard turns green, drop the tile –Later, click on the clipboard and drag it back to the Method Editor –The clipboard only contains one thing at a time. You can request multiple clipboards. (Edit>Preferences>SeldomUsed) 2.1

2-18 Custom Methods In addition to primitive methods (the things that ALL objects can do)…some objects have custom methods When objects is selected from gallery, a listing of custom methods appears Names of the custom methods give clues as to what the method does What do you think the foottap custom method does? 2.1

2-19 namingConventions Names are known as identifiers…because they identify items in a program Use a name that provides meaning –Name of method should indicate the method’s purpose 2.2 Which one coaches the Knights and which one coaches the Cougars?

2-20 namingConventions Most programming languages do NOT recognize spaces –Alice allows spaces method.my first method When spaces are not allowed, how do you combine more than one word in naming? –Capitalize subsequent words –Called camelCase 2.2 Note the space Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Which is easier to read? onehumpcamel or oneHumpCamel

2-21 Class Names method names begin with a lower case letter Class names are capitalized This simple capitalization rule is very helpful. No spaces, so each word is capitalized –This convention is called PascalCase 2.2

2-22 Renaming Objects –Right-click object’s tile in the object tree and select rename. Methods –Select the world object –Select the method’s tab from the Details Panel –Right-click the “my first method tile” and select rename. 2.2

Let’s try the following Playing ball Two players kick ball back and forth What happens together? What if we want to add a frog on top of the ball? What if we want the ball to spin? What if we want the ball to bounce? 2-23

Orientation If you want two objects to move together, there are two choices: –they can have the same orientation (same coordinate system orientation) – orient to –one can be a vehicle for the other. (Under properties for “riding” object) 2-24

As seen by You know each object has it’s own sense of direction, but suppose we want the ball (which may be twisted) to bounce upwards with respect to the ground. Select “move up” but use “more” to request “asSeenBy = ground” 2-25

Move to Alice can move objects to a particular location, but it is more likely it moves to another location in the scene. Try using moveTo to go to the camera MoveToward allows you to move in the direction of an object without aligning center points. 2-26

2-27 Designing a Program Design requires planning…that follows the above steps Called program development cycle Cycle is repeated until there NO errors appear in the program. 2.3 Design the programWrite the methodsTest the methodsDebug the methods

Why design? It is common for students just to start! Why should they take the time to jot down a plan? –Solve the right problem –Allow for reuse – plan to use the same code. On magnets, for example, - do all the objects get to the magnet the same way? Will the instructions work from any location? Which is better for reuse? 2-28

Decomposition The machine only understands about 100 operations. What makes it difficult if the ways they are put together. Chess – only six types of chess pieces which move in simple patterns. The complexity comes with the combinations In programming we need a way of managing the pieces. used interchangeably: decomposition, stepwise refinement, top-down design 2-29

2-30 Comments A comment is a note explaining the code Crucial part of the code Makes the code understandable Alice ignores comments when it runs your program 2.4 // comment tile

2-31 Tips for Setting Up the Initial Scene Methods can also be called to help in initial positioning Use the primitive methods to setup the scene –Select the object in the Object Tree, then select a method Use the primitive methods to position the objects –Doing so from the Object Tree positions the objects outside of the program 2.5

10-32 Tips for Setting Up the Initial Scene Moving an object to the center of the world –Use the move to method and choose the entire world as the method’s argument –Places the object’s center point at the world’s center point of (0, 0, 0) 2.5

2-33 Tips for Setting Up the Initial Scene Positioning objects a specified distance apart –Use the move to method and choose asSeenBy the other object for the method’s argument –Places the object’s center point at the world’s center point of (0, 0, 0) 2.5

2-34 Tips for Setting Up the Initial Scene Moving the camera to an object –Right-click the object and choose Camera get a good look at this –Camera moves to a position so the object is in plain view 2.5

2-35 Executing Instructions Simultaneously By default, instructions are executed one after the other…in the order they appear in the Methods Editor For simultaneous actions, drag Do together into the Methods Editor Other instructions can be place within the Do together tile Make sure the duration for all items in a Do together are the same 2.6

2-36 The Do in order Structure By default, all instructions are performed in order they appear in the Methods Editor Do in order structure used when more than one set of actions must occur simultaneously…but has steps that must be done in order 2.6