Distributing (Fun + Learning): The Distributive Property By: Peggy Li Under the direction of Professor Susan Rodger Duke University, June 2011 1.

Slides:



Advertisements
Similar presentations
Visual Lists By Chris Brown under Prof. Susan Rodger Duke University July 2012.
Advertisements

Space Man Sam: Grammar Mistakes By Aleis Murphy Duke University, Under the direction of Professor Susan Rodger July 2010.
Texture Maps Alice Project 2008 Duke University Professor Susan H. Rodger Gaetjens Lezin July 2008.
Alice Learning to program: Part 1 by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Lesson 5+: Using He- Builder/She-Builder And Adding Text! Slides are adapted from aliceprogramming.net or
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Skater World: Part One By Deborah Nelson Duke University Under the direction of Professor Susan Rodger May 29,
Coloring Randomly: Random Selection in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University Feb. 24, 2007.
Alice Learning to program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke.
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
1 Quiz Template: Click on the match By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 2009.
Shorter of two objects and changing color Functions, events and setting the color Susan Rodger, Duke University June 2008.
Animated Charting Using the Alice Bar Chart Template World By Elizabeth Liang under the direction of Professor Susan Rodger Duke University December 2010.
Line up By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Distributing (Fun + Learning): The Distributive Property By: Peggy Li Under the direction of Professor Susan Rodger Duke University, June 2011.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Making a Timer in Alice.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Texture Maps Duke University Professor Susan H. Rodger Gaetjens Lezin July 2008 Updates made June 2014 by Ellen Yuan.
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
Shorter of two objects and changing color V2 Functions, events and setting the color in sequence and randomly This is a modification of the Changing Color.
3–D Helium Molecule Tutorial Alice Project Duke University Professor Susan H. Rodger Gaetjens Lezin June 2008.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Changing Color, Using Text Objects, and Random Selection in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
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.
Distributing (Fun + Learning): The Distributive Property By: Peggy Li Under the direction of Professor Susan Rodger Duke University, June
By Deborah Nelson Duke University Professor Susan Rodger July 13, 2008.
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
A Simple Quiz: Ask User Functions. By Lana Dyck under the direction of Professor Susan Rodger Duke University June 2009, added Part 2 July 2011.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
Making a Timer in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
1 ball, 2 ball, red ball, blue ball By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1,
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Can I get your number? By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Distributing (Fun + Learning): The Distributive Property 1 Peggy Li Under the direction of Professor Susan Rodger Duke University, July 2011.
The Essentials of Alice (Bunny) By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
1 Quiz Template: Using the ‘ask user’ functions By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 2009.
Balancing the scales: Inequalities By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Nonvisual Arrays by Chris Brown under Prof. Susan Rodger Duke University June 2012.
The Essentials of Alice Mrs. Jayne Slease SBMS CTE Computer Science and Animation Credit to Duke Students under the direction of Professor Susan Rodger.
Ready, SET, go! By Melissa Dalis Professor Susan Rodger Duke University July 2011.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
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.
Learning to Program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Skater World: Part Three By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 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.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
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.
The Essentials of Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University May 2009.
By Melissa Dalis Professor Susan Rodger Duke University June 2011
A Simple Quiz for Alice 3.2:
An Introduction to Alice (Short Version)
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko
Changing Color, Using Text Objects, and Random Selection in Alice
Let's Race! Typing on the Home Row
Skater World: Part Three
A Simple Quiz for Alice 3.2:
An Introduction to Alice
Princess & Dragon Part 3: A Knight Comes Riding In—Cameras & Events
Professor Susan Rodger
Professor Susan Rodger
Presentation transcript:

Distributing (Fun + Learning): The Distributive Property By: Peggy Li Under the direction of Professor Susan Rodger Duke University, June

Overview This tutorial will help you make an Alice world that lets you practice the distributive property. An expression in the form a(bx+c) will appear, where a, b, and c are nonzero integers. A possible answer for the expanded form will also show up. The user clicks Y if he/she thinks it is right, and N if he/she thinks it is wrong. Concept can be further developed to practice more advanced concepts like adding algebraic expressions or using fractions. 2

1.Open Alice and create a new world. 2.Select a template of your choice. (This tutorial uses Grass, but any other works too.) 3.Click Open to start building your world. 4.Remember to save your world somewhere you can find it later! Creating a new world 3

1.Click the green Add Objects button. 2.In the Local Gallery, scroll to the right until you reach the People folder. Click on the folder. 3.Scroll to the right until the very end. 4.You can use hebuilder and shebuilder to create your own character. Adding a person 4

Just a quick explanation! You might have noticed there are lots of other cool people to choose from in the People folder! We’re going to use the Character Builder because it comes with some built-in methods that will be helpful later on. Once you’re comfortable working in Alice, you can use an existing character and create new methods for it. Why hebuilder/shebuilder 5

1.Customize your person! You can choose: Body: head, torso, and legs Face: skin tone, eyes, and lips Hair: length/style and color Clothing: shirt, pants, and shoes 2.Give your character a name and enter your name in the Created By box. Now click OK! Note: The person in this tutorial is named Guide. This will come up in future slides. Customizing your person 6

1.Your person’s arms will be spread out like in the picture. Let’s move them back down to his/her side. 2.Find the Object Tree on the left. 3.Click the + next to your person’s name, then click the + next to upperBody and Chest. 4.You should now see parts called rightUpperArm and leftUpperArm. Rotating the arms 7

1.Right-click on rightUpperArm in the Object Tree. 2.Now go to Methods, select roll, and right. Click on Other and type in Do the same for leftUpperArm, but this time roll it to the left, again by Your person’s arms should look like this: Rotating the arms 8

1.Click on Add Objects again and return to the Local Gallery. 2.Scroll all the way to the right until you reach Create 3D Text, and click that. 3.Enter “a(bx+c)= ” for the text. 4.If you want, you can change the font. The tutorial will use Arial bold. 5.Make another 3D Text that says “abx+ac”. Adding 3D text objects 9

1.In the Object Tree, right-click on the first 3D Text you made and rename it “expression”. 2.Rename the second one “answer”. 3.Right-click on expression in the Object Tree. Go to Methods >> turn to face >> camera. 4.Repeat Step 3 for answer. 5.Both objects should now be facing you. Renaming and turning 3D text 10

1.Locate the object control buttons. Use them as needed to move and resize the objects until they look roughly like this: Repositioning objects 11

1.We can change the color of the expression and answer text objects. 2.To do this, click expression in the Object Tree and go to the Properties tab. 3.Click the arrow next to color and choose any color. This tutorial will use blue. 4.Do the same for answer. The tutorial will use magenta. Changing 3D text color 12

1.Now let’s make two answer buttons: one Y (yes/correct) and one N (no/wrong). 2.Go to Local Gallery >> Shapes folder and add two squares to your world. 3.Rename them yesButton and noButton. 4.Turn both squares to face the camera by right-clicking and going to methods >> turn to face >> camera. 5.In their Properties tabs, change the yesButton color to green and the noButton color to red. Making answer buttons 13

1.Now create two new 3D text objects, one that says “Y” and the other that says “N”. You can choose a font; the tutorial uses Arial, bold. 2.Rename them Yes and No and them to face the camera. 3.Move and resize them so that each is directly in front of the corresponding square. 4.Under Properties, set the vehicle of Yes to yesButton and No to noButton. This “glues” the letter to the square. Making answer buttons 14

1.Move the answer buttons forward and/or down (resize if needed) so they look like this: Positioning answer buttons 15

1.Let’s make a new method that will give us a random expression in the form a(bx+c). 2.Click on world in the Object Tree, go to the methods tab, and click create new method with the name getExpressions. 3.Click create new variable and make a new variable with name a and type number. Set its value to 0 (select other and type in 0). 4.Make two identical variables called b and c. Getting a random expression 16

1.Now we’ll set random values for a, b, and c. 2.Drag a while into the method and select true. 3.From the variables list, drag a over true, select a ==, and set b to 0. Setting random numbers 17

1.Drag another a, this time into the while loop. Select set value, and choose any number (we will change this in a moment). 2.Go back to world in the object tree. Under the functions tab, find the random number (under the third section Random). 3.Drag random number into the method, over the value you set a equal to. Setting random numbers 18

1.Click the more right next to random number and set the minimum to Repeat Step 1 to set the maximum to 11 and integerOnly to true. 3.When we get a random number, it can include the minimum, but goes up to not including the maximum. Here we want numbers from -10 to 10, so maximum = We want integerOnly so the numbers are easy to work with – not long decimals! Setting random integers 19

1.Click the more arrow at the end of the line and set duration to 0 seconds. 2.Drag the entire while loop to the clipboard in the upper right, to “copy” the contents. 3.Drag the clipboard back into the method, under the while loop, to “paste” the contents. 4.Repeat Step 3. You should have a total of three while loops in the method right now. Getting a random expression 20

1.In the second while, change both instances of a to b. Then, in the third while, change both instances of a to c. 2.The while statements ensure that a, b, and c are all nonzero so we don’t get anything too easy like 0(0x+2). Remember that a, b, and care were all set to 0, so the while loop makes sure a new number is generated until the variable is no longer equal to 0. Getting a random expression 21

1.Now create two new number variables and name them ab and ac. Set both values to 0. 2.Drag ab into the method (below third while), and select set value >> expression >> a. 3.Click the arrow by a and choose math >> a* >> expression >> b. This just means a x b. 4.Repeat Steps 2-3 for ac, but remember to choose c instead of b. 5.Set the duration for both ab and ac to 0. Getting a random expression 22

1.Go to world’s functions tab, and scroll down until you find absolute value of a in Math. 2.Drag absolute value into the method, over the entire a*b (not just a). Repeat for a*c. 3.This means that ab and ac are both positive. We do this for formatting reasons, as we will see shortly. Getting a random expression 23

1.Create five new variables, all type String and set to default value. Name them aString, bString, cString, abString, and acString. 2.Drag aString into the method and set its value to default string for now. 3.Under world’s functions, find and drag the what as a string over default string. Choose expressions >> b. 4.Repeat steps 2-3 for the other four variables. Make sure you use the matching number! 5.Set the duration for each line to 0. Getting a random expression 24

1.Scroll to the bottom of world’s functions and find int a as a string. Drag this over a, b, c, ab, and ac in the five lines and reselect the right variable name in expression. 2.What this does is remove the decimal format that otherwise comes with making an integer a string using just what as a string. In other words, when 4 becomes a string, it is now just 4 instead of You do need to keep what as a string in addition to int a as a string. Casting integers to strings 25

Setting integers as strings 26 This is how the last five lines should look now. Make any changes or corrections if needed.

1.Drag an if/else into the method. Formatting the expression 27

1.Go back to world’s methods tab and create a new method called shuffle. This will put the answers in random order in the array. 2.Click create new parameter to make a new parameter named answerArray. Make it an array of type Other >> String. Shuffling the answers array 28