CompSci 94 - Classwork 21- November 26, 2013
Today's classwork first gives you practice with topics again, this time
with Alice 3.
Implement the following in Alice 3
- Add in six chickens and a person with all in a line except one chicken
in front of everyone and all the chickens showing their profile.
- Have the chicken out front turn to face the person and
say something to them. Have the person bow and straighten back up.
Then have the chicken move over to the person in increments of 0.25
until they are close to the person. Then have them circle the person.
Then have the person move back 1 meter and to their right so you can see
- Create an array of the chickens.
- For each chicken less than 3 meters from your person, paint them
- For each chicken randomly generate a 0, 1 or 2 and have your person
say the number generated. If the number is 1, then double the size of
that chicken. If the number is 2, then triple the size of that chicken.
If the number is 0, leave their size the same.
- For each chicken one at a time, have them turn to face the
camera and move forward 1 meter.
- For every chicken together, have them turn around once.
- Write a function called NumberOfChickensOfSize with two parameters, an
array of chickens and a number called height.
This function should return the number of chickens that are of size height
- Back in world.myFirstMethod, compute the number of large, medium and
small chickens and have your person say how many of each there are. You
should call your function you wrote to compute this.
- Write a function called NumberChickensOfColor with two parameters,
an array of chickens and a paint color. Return the number of chickens of
color. (This is optional, and a bit tricky because Alice 3 is not setup so
well to do this easily).
- Have the person say how many yellow chickens there are by calling your
function. (This is optional but easy if you were able to do the previous step.)
- Fill out
this form to give your impressions of Alice 3.