Xin November 22, 2010. Exercise start Skater turns towards skater2 Skater2 turns towards skater Skater moves to pose 2 Skater2 moves to pose 2 Bunny move.

Slides:



Advertisements
Similar presentations
Learn to Juggle.
Advertisements

ROBOTC for CORTEX While Loops Part 1
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
1 Fall 2009ACS-1805 Techniques for designing code Storyboards Text (aka pseudocode) Diagrams Flowcharts (a procedural technique shown in text) Directed.
Fall 2007ACS-1805 Ron McFadyen1 Ch 7 Loops Alice has two control structures for controlling the repeated execution of statements Loop While.
Fall 2009ACS-1805 Ron McFadyen1 Ch 7 Loops Alice has two control structures for controlling the repeated execution of statements Loop While.
While: Indefinite Loops Sec 8-14 Web Design. Objectives The student will: Understand what an Indefinite Loop is Understand how create an indefinite loop.
CS320n –Visual Programming Indefinite Loops (Slides 7-2) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for slide ideas.
Autonomy using Encoders Intro to Robotics. Goal Our new task is to navigate a labyrinth. But this time we will NOT use motor commands in conjunction with.
1 Fall 2008ACS-1805 Techniques for designing code Storyboards Text (aka pseudocode) Diagrams Flowcharts (a procedural technique) Text presents one of these.
Intro to Java while loops pseudocode. 1 A “Loop” A simple but powerful mechanism for “making lots of things happen!” Performs a statement (or block) over.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 3 Programming - Putting Together the Pieces.
Infix to postfix conversion Use a loop to read the tokens one by one from a vector infixVect of tokens (strings) representing an infix expression. For.
CS320n –Visual Programming LabVIEW Control Structures.
Programming: Simple Control Structures Alice. Control Statements We have been using Do in order and Do together to control the way instructions are executed.
Tell the robot exactly how to draw a square on the board.
Unit 5 – “Watch Out!”. Introduction New Topics Case Structures New Functions Less? Comparison Function Ultrasonic Sensor.
Programming: Simple Control Structures Alice. Control Statements We have been using Do in order and Do together to control the way instructions are executed.
1 Fall 2007ACS-1903 Techniques for designing code Storyboards Text (aka pseudocode) Diagrams Flowcharts (a procedural technique) Text presents one of these.
Control Structures CPS120: Introduction to Computer Science Lecture 5.
Mathematical Expressions, Conditional Statements, Control Structures
Design of Bio-Medical Virtual Instrumentation Tutorial 2.
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
Conditionals-part21 Conditionals – part 2 Barb Ericson Georgia Institute of Technology Nov 2009.
The while-statement. The loop statements in Java What is a loop-statement: A loop-statement is a statement that repeatedly executes statements contained.
Repetition Structures Chapter 5 Part The While Instruction  Combines Loop and the condition that is also used in If/else statements  The loop.
Programming: Simple Control Structures
ITK 168 Decisions Dr. Doug Twitchell September 20, 2005.
Obj: Programming: Simple Control Structures HW: Read section 3 – 2 AC3 D2 Do Now: 1.Log on to Alice. Open the file firstEncounter.a2w located in the folder.
Programming with LabVIEW Intro to programming and.
Programming: Simple Control Structures Sec 46 Web Design.
TestScore < 80 testScore * 2 >= < w / (h * h) x + y != 2 * (a + b) 2 * Math.PI * radius
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4-1 Lecture Objectives To understand: –what values can be stored in a Boolean.
PYTHON WHILE LOOPS. What you know While something is true, repeat your action(s) Example: While you are not facing a wall, walk forward While you are.
Loops. About the Midterm Exam.. Exam on March 12 Monday (tentatively) Review on March 5.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
Sensor Information: while loops and Boolean Logic.
Programming: Simple Control Structures
Programming: Simple Control Structures
Understanding the Geometric Shape Code
Introduction To Robot Sensors
Repetition Control Structures
Factors, multiple, primes: Factors from prime factors
Learning Outcomes Understand While Loop
LESSON 11 – WHILE LOOPS UNIT 5 – 1/10/17.
Looping and Repetition
Programming: Simple Control Structures
CPS120: Introduction to Computer Science
LRobot Game.
Programming: Simple Control Structures
Factors, multiple, primes: Prime factors
Recap the basics Lesson 1.
Programming: Simple Control Structures
IF Statements.
Programming: Simple Control Structures
Which way does the robot have to turn to get to the charger?
Programming: Simple Control Structures
Recap the basics Lesson 1.
Python While Loops.
Lego MINDSTORMS EV3.
Factors, multiple, primes: Multiples
Fractions: Simplifies to a unit fraction?
Functions.
Flow of Control Flow of control is the order in which a program performs actions. Up to this point, the order has been sequential. A branching statement.
Programming: Simple Control Structures
Standard Form: Multiplying powers of 10
Standard form: In standard form?
Coordinates: Naming 2D coordinates – quadrant 1
Looping and Repetition
Presentation transcript:

Xin November 22, 2010

Exercise start Skater turns towards skater2 Skater2 turns towards skater Skater moves to pose 2 Skater2 moves to pose 2 Bunny move up by 0.5m Bunny turns legs Skater moves to pose 3 Skater2 moves to pose 3 Bunny move down Bunny turns legs back end

Conditional expression The condition must be a Boolean value, i.e., True or False. Use lab3If1.a2w for practice

Using relational operators ==, !=, >, >=, <, <= Hare’s height <= 2 Husky scratch ears Husky barks 2 seconds Husky walks circles equal to hare’s height TrueFalse

randomness Set the hare’s size to a random size at the beginning Set the random value between.1 and 1.5

Repeatation Use lab3Rep.a2w Kick left leg Point Cannon forward Resize by 0.9

While loops Terminate the loop when certain condition is satisfied

Exercise Revise the program so that the robot stops when its height > 1 Add a fighter to your world Revise your program, so that the fighter is enlarged by 1.2 while the robot is moving, until the fighter is larger than the robot. The fighter move downwards by half its distance above the robot.