CS 40 - Lecture 3

Cover page image

Cay S. Horstmann

Lecture 2 Recap

???

Survey Questions (3 slides)

Please log in to ActiveLecture.org. Click Discuss, type A B C, click Send.

What computer can you use outside class?

  1. I have a laptop
  2. I have a desktop at home/in my dorm
  3. I need to use a computer in a computer lab

How Can You Get Alice Outside Class?

  1. I already installed it
  2. I brought my laptop today so I can get installation help
  3. I will bring my laptop next Tuesday so I can get help
  4. I will install it myself over the weekend and use the eCampus discussion feature if I have problems
  5. I need to use a computer in a lab that has Alice preinstalled

How Was the Lab Work on Tuesday?

  1. Too easy/boring
  2. Just right
  3. Too hard/confusing

Thanks for your feedback!

From Scenario to Code

Create Initial World

Break Scenario Into Scenes

Break Scene Into Tasks

Top-Down Design

???

  1. Start with written scenario
  2. Break down into scenes
  3. Break each scene into tasks
  4. Translate into program

Code Reading

???

Code Reading

???

Code Reading

What is the purpose of those long expressions

spiderRobot.body.xxxLegLegBase.xxxXxxLegUpperjoint.turn...

in plain English? (Answer in ActiveLecture.org)

Code Reading

Some statements are in a do together block, others in a do in order block.

What would happen if they were all in a do in order block? (Answer in ActiveLecture.org)

Lab Work

Add to the "First Encounter" Story.

Scene 1. The alien reappears. The robot says "Take me to your leader".

Scene 2. The alien and the robot walk away into the distance.

Hint: You may need to turn the camera when they walk away.

Reminder

???