piit computer science summer camp - alice july 9, 2012 brenda parker computer science department...

Post on 12-Jan-2016

215 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

PIIT Computer Science PIIT Computer Science Summer Camp - AliceSummer Camp - AlicePIIT Computer Science PIIT Computer Science Summer Camp - AliceSummer Camp - Alice

July 9, 2012July 9, 2012Brenda ParkerBrenda Parker

Computer Science DepartmentComputer Science DepartmentMTSUMTSU

04/21/23 Brenda Parker - Alice Workshop

2

Welcome

• MTSU• Computer Science Department• Computer Lab – KOM 267• Alice Camp

04/21/23 Brenda Parker - Alice Workshop

3

Introduction• Introduce yourself to your

neighbor• Prepare to introduce your

neighbor to the class– Name– School– Interesting fact!

04/21/23 Brenda Parker - Alice Workshop

4

Rules• Feel free to take a break when

needed• Restrooms are out the door to

your right in the main hallway• Feel free to ask questions• No talking during presentations

04/21/23 Brenda Parker - Alice Workshop

5

Purpose of Workshop• Learn some of the fundamental

concepts involved in programming in a “fun” way

• Learn to use Alice to create animations, games and videos.

Sample Student Projects

• evilrobotloss.avi• FroggerProject.avi

TRY AN ALICE GAME!• Start Alice (Click on the Alice 2.2

icon on the desktop)• Choose EXAMPLES • Double click on flightSimulator• Click PLAY• Close ALICE when finished!

CREATING GAMES and Videos

• You have a lot to learn to create good games and videos in Alice

• Each day you will learn Alice concepts

• Try to use knowledge learned each day to create a “great” final project!

04/21/23 Brenda Parker - Alice Workshop

9

Workshop Agenda• Short explanations on Alice will be given• Practice sessions will be interspersed

during each day• Short questions or game after each

practice session (Prizes on last day of workshop to winners on best scores!)

• Participants will be asked to demonstrate their creations

04/21/23 Brenda Parker - Alice Workshop

10

Part I – Alice BasicsAlice Workshop

• What is Alice?• Why use Alice?• Alice Basics – The Alice

Environment• Example Worlds• Alice Texts

04/21/23 Brenda Parker - Alice Workshop

11

What is Alice?• Software

– Free– Educational programming language– Named after Lewis Carroll’s Alice in

Wonderland– offered by Carnegie Mellon University– Download at http://www.alice.org

04/21/23 Brenda Parker - Alice Workshop

12

What is Alice?• Software

– uses a 3D programming environment – makes it easy to create an animation for

telling a story, playing an interactive game, or a video to share on the web.

– designed to be a first exposure to programming.

– creates a virtual world with objects (people, animals, vehicles, etc) and animate the objects

04/21/23 Brenda Parker - Alice Workshop

13

What is Alice?• Software

– Allows the creation of passive and interactive animations• Passive animations (watch the resulting

video)• Interactive animation (user participates

in the animation – game)

What is computer programming?

• Computer program – step-by-step set of instructions telling a computer how to perform a specific task.

• Computer language – a language a programmer may use to create a computer program: C, C++, Java, BASIC, etc

04/21/23 14Brenda Parker - Alice Workshop

What is computer programming?

• Programmers must learn the needed programming language

• Programming in Alice is easy– All instructions are on tiles– Use drag and drop instructions to create a

program

• Learning Alice makes it easy to learn other programming languages!

04/21/23 15Brenda Parker - Alice Workshop

Terms• Object – anything that can be manipulated by

a computer program.– Dog– Cat

• Instance of an object– Oscar – is an instance of a dog– Spot – is an instance of a dog

• Method – program that manipulates an object– Oscar.hop()– Spot.bark()

04/21/23 16Brenda Parker - Alice Workshop

Terms• Properties – values that describe

an object– Example: Oscar’s properties may be:

• Black• 30 pounds• Hyper-active

04/21/23 17Brenda Parker - Alice Workshop

TermsA Function is - • method that computes and returns

a value• Example: Suppose that we have 2

penguins in our world (Sam and Joe). We can use a function to calculate the distance between Sam and Joe!

04/21/23 Brenda Parker - Alice Workshop

18

Questions1. What is a program?2. Who creates programs?3. Name a programming language.4. What is an “object”?5. What is a “method”?6. What is a “function”? 7. Dog is an object and Oscar is an

_________ of a dog object.

04/21/23 19Brenda Parker - Alice Workshop

How do we create programs in Alice?

1. Choose a world2. Place objects in our world3. Choose methods for our objects

04/21/23 20Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

21

Alice Basics• Environment• How to Create a Passive Animation• How to Create an Interactive

Animation

Alice Environment• When programming, users are

required to use an IDE (Integrated Development Environment)

• An IDE is a program that helps users create computer programs.

• We will be using the Alice IDE

04/21/23 22Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

23

Object Tree

Details Area Editor Area

Events Area

04/21/23 Brenda Parker - Alice Workshop

24

EnvironmentObject Tree Window

• Lists the predefined objects in the world– Camera– Light– Ground

• Lists objects placed by the user– Penguin– Snowman

04/21/23 Brenda Parker - Alice Workshop

25

EnvironmentDetails Area Window

• Shows information about selected object in the Object Tree

• Properties– Tell color, size, etc

• Methods– Each method does something (shows what the

object can do)– Sam.flapWings

• Functions– Each function computes and returns something

• Penguin’s width is 18.

Alice Methods• In Alice, there are two kinds of

methods:– Primitive – basic behaviors for objects

(provided by the Alice IDE)– User-defined methods – methods that

the programmer creates• We will work with Primitive

Methods first!

04/21/23 26Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

27

Practice I1. Place your flash drive into your

computer.2. Create a folder on your flash drive

called YourLastNameAliceFiles3. Open Alice 2.24. Close the Welcome Window We will now set preferences so that all

pictures and videos will be saved on your flash drive.

How to Set Preferences5. Choose EditPreferences 6. Choose

GeneralBrowseE:/yourLastNameAliceFilesSet Directory

7. Choose ScreenGrabBrowse

E:/yourLastNameAliceFilesSet Directory8. Set the base filename to: YourLastName9. Click OK

04/21/23 Brenda Parker - Alice Workshop

28

Practice I10. Click on an object in the Object

Tree11. Examine the Properties,

Methods and Functions associated with the selected object

04/21/23 Brenda Parker - Alice Workshop

29

Practice Test I1.

C

D

A

B

04/21/23 30Brenda Parker - Alice Workshop

Practice Test I2. What is the purpose of the “methods” tab? 3. What is the difference between “methods”

and “functions”? 4. Name a property of the ground object. 5. Name a method listed for the camera object. 6. Name a function listed for the light object. 7. How do we select an object? 8. In the above picture, which object is selected?

04/21/23 31Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

32

Alice BasicsHow to Create Passive

Animations• 4 Step Process to create an

animation– STEP 1: Choose a world– STEP 2: Choose objects for your world– STEP 3: Choose activities (methods)

for your objects– STEP 4: Play your animation

04/21/23 Brenda Parker - Alice Workshop

33

STEP 1Choose your world

environment

1.Click FileNew World

2.Click Templates

3.Click desired World

4.Click OPEN

04/21/23 Brenda Parker - Alice Workshop

34

STEP 2Choose Objects for your world

1. Click “Add Objects”

04/21/23 Brenda Parker - Alice Workshop

35

STEP 2Choose Objects for your world

2. Choose “Local Gallery”

ST

04/21/23 Brenda Parker - Alice Workshop

36

STEP 2Choose Objects for your world

3. Choose desired 4. Choose desired

gallery object

04/21/23 Brenda Parker - Alice Workshop

37

STEP 2Choose Objects for your world

5. Click “Add instance to World”

04/21/23 Brenda Parker - Alice Workshop

38

STEP 2Choose Objects for your

world

6. Name objects if desired!Right click on object in the object tree and choose rename

04/21/23 Brenda Parker - Alice Workshop

39

Step 2Choose Objects for your

world7. Position objects in your world

-Use “Click and Drag”

-Use sub-circuit buttons”

04/21/23 Brenda Parker - Alice Workshop

40

Step 2Add Objects to your

World8. Click when all objects

have been added and positioned.

04/21/23 Brenda Parker - Alice Workshop

41

Practice II1. Click FileNew World2. Choose Templates3. Choose World (Double click on desired world)4. Add Objects- Add at least 2 animals + 2 Nature5. Position Objects6. Rename objects (right click on object in Object

Tree and choose rename)7. Click DONE8. Save your world in your folder on your flash

drive and call it day1.a2w (FileSave World)

Practice II Test1. What is the first step in creating an animation

in Alice? 2. Name three types of worlds users may choose

from when creating an animation. 3. What does “passive” animation mean? 4. Explain how to rename an object.5. What do the following mouse controls buttons

do?

6. What button should be pushed when all objects have been added and positioned?

7. How can you change the color of an object in your world?

04/21/23 42Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

43

Step 3Choose activities

(methods) for your objects

1. Click on desired object in the Object Tree.

2. Choose desired method from the list of Methods.

3. Drag the desired method to the Editor Window.

Choosing Activities for Objects

Note that all objects have sub-parts. To see the sub-parts, click on + in the Object Tree.

04/21/23 44Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

45

Step 3Choose activities

(methods) for your objects

1. Click on desired object in the Object Tree.

04/21/23 Brenda Parker - Alice Workshop

46

Step 3Choose activities

(methods) for your objects

2. Click METHODSand choose desired method from the Method List for that object.

04/21/23 Brenda Parker - Alice Workshop

47

Step 3Choose activities

(methods) for your objects

3. Drag the desired method to the Editor Window.

04/21/23 Brenda Parker - Alice Workshop

48

Step 4Play Animation

• Example AnimationslakeSkater.a2wSnow_man_story.a2w

04/21/23 Brenda Parker - Alice Workshop

49

Practice III1. Click on one object2. Click and drag 2 methods for that

object to the Editor Window3. Click on another object4. Click and drag 2 methods for that

object to the Editor Window5. Play your video!6. Save your world – (day1.a2w)!

Practice III Test1. When creating activities for the objects in

your world, you must first ___________________________.

2. Which tab in the Details Area should be chosen when choosing activities for the objects in your world?

3. When choosing activities for your objects, you should drag the desired _____ from the ______________ to the ___________

4. What button should be selected to actually see your animation?

5. How many methods can be placed in the Editor Window?

04/21/23 50Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

51

FYIIt is easy to create a picture from your

Alice world.How?1. Make sure Alice knows where to save

your picture (We set preferences to take care of this!)

2. Click Play3. Click Pause4. Click Take Picture

Practice IV1. Play your video and take a picture

at the end of your video!2. Choose one of the following:

1. Page AL 53 – Japanese Fan Dancer2. Page AL 54 – A Penguin Demonstration3. Page AL 56 – American Chicken

Famers Association

04/21/23 52Brenda Parker - Alice Workshop

For your information

1. How can we remove undesired objects and methods?

----Drag object/method to the “trash can”

04/21/23 53Brenda Parker - Alice Workshop

For your information

2. How do we use the Camera Control Arrows?----VERY CAREFULLY! DO NOT USE!

04/21/23 54Brenda Parker - Alice Workshop

04/21/23 Brenda Parker - Alice Workshop

55

Part II- Control StructuresAlice Camp

• Do in order• Do together• Loop• Decision Structure

04/21/23 Brenda Parker - Alice Workshop

56

Control Structures

• Do in order– Instructions placed inside this

structure will be executed in the order that they appear

– Example:

04/21/23 Brenda Parker - Alice Workshop

57

Control Structures• Do in order

– Advantage• Easy to learn about sequential logic• Easy to delete a group of statements

04/21/23 Brenda Parker - Alice Workshop

58

Control Structures

• Do together– Allows multiple actions to occur at

the same time– Provides an interesting effect!– Example: 4 penguins form a chorus

line!

04/21/23 Brenda Parker - Alice Workshop

59

Control Structures• Loop

– Easy way to perform same instructions multiple times

04/21/23 Brenda Parker - Alice Workshop

60

Control Structures• If Else

04/21/23 Brenda Parker - Alice Workshop

61

Examplechorusline.a2wchorusline2.a2wchorusline.a2wchorusline2.a2w

Practice V1. Open your day1.a2w file (if it is

not already open)2. Add two control structures to your

Alice world. You can use a Loop or a Do together or a Do in Order.

3. Save your video4. Play your video5. Save a picture.

04/21/23 Brenda Parker - Alice Workshop

62

Practice VIChoose from 1 of the following:1. Page AL 120 – Three Penguin

Dance2. Page AL 27 – Create a New

Ice Skater World3. Create your own Alice world

which tells a story AND contains Control Structures

04/21/23 63Brenda Parker - Alice Workshop

Practice IV Test1. How do you change the default settings in Alice? 2. What is the purpose of “Screen Grab”? 3. Why would you want to change the default setting in

Alice? 4. Name two advantages for using the “Do in order”

control structure. 5. What is the purpose of the “Do together” structure? 6. What is a “Loop”? 7. Where on the Alice screen are the control structures

located?8. Name 4 control structures found in Alice. 9. How do you save a picture of your world in Alice? 10. When instructed to do so, where does Alice save a

picture of your world? 11. When a world picture is saved, what file name is the

picture given?

04/21/23 64Brenda Parker - Alice Workshop

How to Print your Program

• To print your program, you will need to export your program to a web page.

• Go to AL48 in your Alice text and following the instructions listed.

• Make sure that your code is exported to your folder on your flash drive

CONTESTCreate a new world of your

choosing, add and position objects in your new world.

We will vote on the most creative and interesting WORLD and story!

04/21/23 Brenda Parker - Alice Workshop

67

References• http://aliceprogramming.net

– Helpful information on Teaching with Alice

• http://alice.org– Download Alice

• http://visualization.sju.edu– Archive of Alice newsletters, grants, useful

information

04/21/23 Brenda Parker - Alice Workshop

68

Part IVReferences

• http://www.cs.duke.edu/csed/alice/– Workshop materials & tutorials

• http://www.cis.uab.edu/programs/alice-festival/– Alice Contest in UAB

04/21/23 Brenda Parker - Alice Workshop

69

Part IVReferences

• http://www-groups.dcs.st-and.ac.uk/~history/BiogIndex.html– Index of famous Mathematicians

• http://www.alice.org/kelleher/storytelling/index.html– Download StoryTelling Alice (appeals

to middle school students)

04/21/23 Brenda Parker - Alice Workshop

70

Part IVReferences

• http://www.cs.duke.edu/csed/des/demos/Animations.html– Screen shots of student Alice worlds

• http://www.cis.uab.edu/gray/Pubs/npr-4-3-07.mp3– Interview on NPR radio regarding UAB’s K-12

outreach efforts in Alabama (5 minute discussion on CS education, job market, Alice)

04/21/23 Brenda Parker - Alice Workshop

71

Part IVReferences

• Randy Pausch – Carnegie Mellon professor gives The Last Lecture with comments regarding Alice

• http://www.youtube.com/watch?v=ji5_MqicxSo

04/21/23 Brenda Parker - Alice Workshop

72

Class DemonstrationsVolunteers????

04/21/23 Brenda Parker - Alice Workshop

73

GREAT JOB!

Thank you for your attention today!

top related