Chapter 7: Repetition 7.1 Definite loops (counted) 7.2 Conditional loops (indefinite)

Slides:



Advertisements
Similar presentations
The people Look for some people. Write it down. By the water
Advertisements

Getting Started With Alice: The Basics By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
As you come in… Sign in (in back) and pick up Badge Name Card – on computer… Log in: Launch/Start Alice Any questions? (of any kind) DOWNLOADS FOR TODAY:
Recursion Alice.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010 modified July 2011.
As you come in…  Sign in (in back) and pick up  Badge  Name Card – write your first name LARGELY on back  Any questions? (of any kind)  Put on index.
As you come in…  Sign in (in back) and pick up  Badge  Name Card – write your first name LARGELY on back  Log in:  Launch/Start Alice  Any questions?
Princess & Dragon – Version 2 By Michael Hoyle under the direction of Professor Susan Rodger Duke University July 2012 Part 2: Using Methods.
Princess & Dragon – Version 2 By Michael Hoyle under the direction of Professor Susan Rodger Duke University July 2012 Part 3: Billboards, Events, Sounds,
How Tall Are You? Introducing Functions By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made June 2014 by.
As you come in…  Sign in (in back) and pick up  Badge  Name Card – write your first name LARGELY on back  Any questions? (of any kind)  Put on index.
Fall 2009ACS-1805 Ron McFadyen1 Ch 7 Loops Alice has two control structures for controlling the repeated execution of statements Loop While.
Repetition: Definite Loops Alice. Repetition In many kinds of animations, especially simulations and games, some actions happen again and again. Example:
CS320n –Visual Programming Indefinite Loops (Slides 7-2) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Rodger Duke University, July 2008.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University Feb. 24, 2007.
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.
Lecture 11 Alice Project Deliverable 1: Extension to Midnight! Midterm next class – Midterm review 4-6pm WED Pepper Canyon Hall 106 – Red scantron (1/2.
Line up By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Chapter 6: (Expressions,) Functions, and If/Else First we had animations – They “ran”/played the same way every time. – Neat, but a bit boring Then we.
Tutorial for Arrays and Lists By Ruthie Tucker. Description This presentation will cover the basics of using Arrays and Lists in an Alice world This presentation.
Making a Timer in Alice.
Code Club Session 2 Dance Party. What will we learn ?  How to change the background  How to create animations  How to make objects talk to each other.
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June
Spiral Rider PAGE 1. Set Up Scene 1.Add Stage-underwater scene 2.Add crab sprite 3.Add two fish sprites PAGE 2.
Past tense Things that have already happened! Start.
Sight Words.
Getting started with Alice Adapted from presentations by Jenna Hayes, Duke University Donna Gavin, UWP Computer Science and Software Engineering.
Chapter 4: Classes, Objects, and Parameters 4.1 World-Level methods.
Tutorial on Kangaroo visiting his animal friends - parameters, events.
CS320n –Visual Programming Introduction to Recursion (Slides 8-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
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,
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops 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.
Illuminating Computer Science CCIT 4-6Sep
Repetition: Definite Loops Alice. Repetition In many kinds of animations, especially simulations and games, some actions happen again and again. Example:
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.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
ForLoopsInAlice1 Stephen Cooper Wanda Dann Randy Pausch Barb Ericson Oct 2009 Counted (For) Loops in Alice.
Tutorial on Kangaroo visiting his animal friends - parameters, events Susan Rodger Duke University 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.
CS320n –Visual Programming Definite / Counted Loops (Slides 7-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
Repetition: Definite Loops Sec 53 Web Design. Objectives The Student will: Understand loops and why they are used Understand definitive loops Know how.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Repetition: Definite Loops Alice. Repetition In many kinds of animations, especially simulations and games, some actions happen again and again. Example:
Using Placeholders to Simplify your Methods: Learning Methods, Part 2 By Deborah Nelson Duke University Professor Susan Rodger June 16, 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.
How Tall Are You? Introducing Functions for Alice 3 By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made.
The speed of a wave depends on the amplitude of a wave. A.True B.False.
Getting Started With Alice: The Basics. Step 1: Background Open up Alice, and choose a background for your Alice world. Your world is something you can.
Created By Sherri Desseau Click to begin TACOMA SCREENING INSTRUMENT FIRST GRADE.
Jonathon Kuo Under the Direction of Dr. Susan Rodger
Getting Started With Alice: The Basics
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
Professor Susan Rodger
Things that have already happened!
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Repetition: Definite Loops
Counted (For) Loops in Alice
Repetition: Definite Loops
Repetition: Definite Loops
Tutorial for Arrays and Lists
Getting Started With Alice: The Basics
YOUR text YOUR text YOUR text YOUR text
Presentation transcript:

Chapter 7: Repetition 7.1 Definite loops (counted) 7.2 Conditional loops (indefinite)

Why is “Loop” also called “Counted Loop” A.The loop makes things happen an indefinite number of times dependent on object positioning B.The loop makes things happen exactly 10 times C.The loop makes things happen a definite number of times

The program below has a guy walk toward a girl waving… A.Before he walks toward her B.As he walks toward her C.Once he finishes walking toward her

When the code is done, how far will the guy have walked? A.2 meters B.5 meters C.7 meters D.10 meters

A blinking neon sign

What does this code do? How many times does it flash… Start off with 3-D text objects at opacity 0 (invisible)

How many times does it flash… EatAtJoes A2 times3 times B2 times6 times C3 times2 times D3 times6 times STOP, ASK PARAPHRASE Another EXAMPLE (change the #s)

How can I mess around with this code? Make EatAt flash and disappear, before Joes flashes 3 times. Make EatAt appear at the same time as Joes flashes 3 times Make Joes come on first, and EatAt flash several times while Joes is on… Change the number of times each flashes… Add a third 3-D text saying “Crab Shack” and have that flash 5 times for each time EatAt flashes 1 time Add a third 3-D text saying “Crab Shack” and have that flash 5 times for each time Joes flashes 1 time

Bunny Square Dance We want to direct the bunny to hop in a square pattern. The “length” of each side of his square should be 5 hops. Here’s the structure of our code, what numbers would you put in for each missing number?

Outer Loop countInner Loop countTurn parameter A45.25 B451 C54 D541 Goal: Hop in a square, 5 hops on each side

What does this code do? A.Makes the guy move “up close” to the girl B.Makes the guy move toward the girl, but not all the way toward her C.Makes the guy move toward the girl and then go on past her D.I don’t know 3 meters

The primary benefit of using a function to control the number of times a loop runs is… A.The function can be used to make the loop run a fixed number of times B.The state of the world can be used to calculate how many times a loop should run C.The function can be used to allow the loop to run forever. D.I don’t know STOP, ASK PARAPHRASE EXAMPLE

Games: Infinite loops and events Set up: – A bunny, a cat, and a hawk all “continuously move” in “squares” 2.5 meters on a side moving forward.5 meters at a time – An anvil hovers above their head Game: – When I click on an animal, the anvil drops down and “smooshes” them (they go invisible) then the anvil returns to it’s place so I can click again – An infinite loop is used to keep all the animals continuing to move in their square patterns

In the nested loops that control this code how many times should the loops run? Outer LoopInner Loop A55 B5Infinite C 5 D E: I don’t know

After I click on an object (say the bunny) and call goBye that object stops moving around A.True B.False C.I don’t know