CSCI A201 and A597

Introduction to Programming I

Week 1

Course Overview and Introduction to Alice

Prof. Chris Haynes

Author:Christopher Haynes
Email:chaynes@indiana.edu
Affiliation:Indiana University
Course:BL CSCI A201
Date:2008-01-10

Copyright © 2007 2006, Christopher Haynes—all rights reserved.

A little about me

gto250.jpg


A little about you

Please fill out a piece of paper with the following:

  1. Your name and username (optional)
  2. Your school or degree program
  3. Does this course fulfill a degree requirement for you (other than general credit hours)
  4. What do you hope to learn from this course
  5. What is your greatest concern with respect to this course
  6. If you have ever done any programming, what was the context and the language
  7. Anything else you'd like to add

Why learn programming?

Programming languages we'll use

Overview of the course web

Now note especially

What's a clicker?

cpsrfHighEd.jpg


Why clickers?

Why Alice?

aliceWithGlobeTransparent.jpg
  • Makes it easy to do 3D movies and interactive animations
  • Fun and intuitive programming model
    • you can see the objects you are programming
  • Highly visual programming environment
    • don't have to memorize syntax
  • Great way to introduce fundamental programming concepts
  • Why the name Alice?
    • she's the central character in Lewis Carroll’s classic children's story Alice in Wonderland


Demo: Getting started

For Your Information

FYI When you see in any course web material a link to a file (as in the last slide), you can right-click it to download the file.

FYI FYI items, like these two, are just For Your Information: you may find them useful, but they're not course content you are responsible for.

Demo: Creating a new Alice world

Picture1.jpg
  • File > New World
  • Templates tab
  • double click desired template


Demo: Adding objects


Picture2.png Picture3.png


Saving your Alice world

Some Alice tools and techniques

Center of an object

Picture6.png


Picture7.png


Picture8.png


Object-oriented programming concepts

An object has

Objects in Alice and other languages

Alice object parts

Picture10.png
Picture11.png


Class

FYI In Alice objects are classes (they can be copied to create instances of themselves), but most languages distinguish objects and classes

dogs.png


Galleries

Picture9.png



Steps for Alice movie programming

Story boards

Picture12.png


Example: Penguin cheerleaders scenario

Scenario

White and pink penguins are on a snow-covered landscape. The pink penguin says "Go Team!" and jumps on the head of the white penguin. But they sink. The white penguin says "I'm sinking.", and the pink penguin says Yikes!. The pink penquin then dives off, while the white penguin rises up.

Storyboard Option—Screen shots

capture00.png capture01.png


capture02.png capture03.png


Storyboard Option—Text Form

A textual storyboard describes the action in each scene

Penguin cheerleaders

  • Pink penguin turns to face white penguin.
  • Pink penguin jumps on white penguin and says "Go Team!"
  • Penguins sink and white penguin says "I'm sinking!"
  • Pink penguin says "Yikes!" and dives of, while whtie penguin rises up.

Demo: penguins.a2w

Penguin1.png
(continued)


penguins.a2w demo continued

Penguin3.png


Alice programming: The big picture

Documenting code

Comments in Alice

Statements

Statement blocks in Alice

Picture20.png


Do together and Do in order blocks

Methods may have arguments

clicker How do you program an Alice object to perform an action?

  1. Type the name of the object, a dot, the name of the corresponding method, and then the argument list
  2. Select the functions tab and drag the corresponding function onto the object
  3. Select the object, and then drag the corresponding method from the method tab into the right place in the program
  4. A or C

Answer: C

clicker An object may contain

  1. methods
  2. properties
  3. other objects
  4. A and B
  5. all of the above

Answer: E

Alice vehicle property

Alice asSeenBy motion

Saving a scene after method calls

Testing

Programming style

How to avoid a lot of programming trouble!

Warning

When students in this course are having more difficulty than they should, the most common reason is inadequate attention to planning.

A plan for problem solving

STAIR steps for problem solving:

S.T.A.I.R.: State, Tools, Algorithm, Implement, Revise

Thinking about thinking

Will this course be too hard?

Tip

Please come see me, and/or one of the lab instructors. We can help you make the most of your effort.

Other concerns