Presentation is loading. Please wait.

Presentation is loading. Please wait.

Xin Liu Dec 1, 2010. Sound Open lab6.a2w Import horseneigh.wav as a property Add the method “play sound” to horse.neigh Exercise Create a class-level.

Similar presentations


Presentation on theme: "Xin Liu Dec 1, 2010. Sound Open lab6.a2w Import horseneigh.wav as a property Add the method “play sound” to horse.neigh Exercise Create a class-level."— Presentation transcript:

1 Xin Liu Dec 1, 2010

2 Sound Open lab6.a2w Import horseneigh.wav as a property Add the method “play sound” to horse.neigh Exercise Create a class-level method for the cow class, named mooing. Turn the cow’s lower mouth Play the build-in sound “moo” Exercise Create a class-level method for the chicken class, named crow. Turn the chicken’s lower mouth Import and Play the sound “crow”

3 Exercise Create a world-level method named introduction Give it two parameters: The animal part that needs to be turned (mouth/lower mouth) The sound to play Call this method three times, so that the horse, cow and chicken all introduce themselves in their own languages.

4 List List is a complex data type composed of a collection of data/objects Alice supports two types of operations on lists For all in order For all together

5 Exercise Open Lab6lists.a2w Add code to world.lookToRight so that It turns to the right by 0.2 rev Replace cow.neck.head with a method cow’s part named “neck.head” Replace cow with the parameter “aCow” Turn the cow’s head back Call this function for the three cows so that they turn heads together at the beginning of the song

6 Exercise Create a list, named listOfCow, in the world Add cow, cow2, cow3 into listOfCow Make a copy of the parallel box For all cows together Call world.lookToRight Make a copy of the parallel box For all cows in order Call world.lookToRight

7 Exercise Complete the dance Add a world-level method, kick Add a world-level method, moo All cows turn individually All cows Kick simultaneously Cows moo one after another


Download ppt "Xin Liu Dec 1, 2010. Sound Open lab6.a2w Import horseneigh.wav as a property Add the method “play sound” to horse.neigh Exercise Create a class-level."

Similar presentations


Ads by Google