Class Work - Simple Alice Programs

1. Complete Chapter 2, exercise 4 on page 48 from the Learning to Program with Alice textbook. The problem is restated here for those who do not have the book.

Circling fish. Create an island world with a fish in the water. Position the fish and the camera point of view so the scene appears as illustartedd below. Write a program that has fish swim around in a circle in front of the island. Next have the fish swim around the island. You may wish to have the fish move asSeenBy the island. (asSeenBy is described in the Tips & Techniques 2). Finally have the fish jump out of the water and then dive down into the water. The final scene should look somewhat like the initial scene, with the fish back in roughly the same position as where it started.

The Fish object is in the Animals subfolder.

The Island object is in the Environments subfolder.

Expected fish movement as seen from above.

 

2. Complete Chapter 2, exercise 5 on page 48 from the Learning to Program with Alice textbook. The problem is restated here for those who do not have the book.

Tortoise Gets a Cookie. Create a world having a tortoise. (Animal subfolder), a stool (link to the stool object. You will have to download this from the web. Then in Alice select the File menu and Import. In the import window choose A2C(Alice Object Files) as the file type and then navigate to where you downloaded the stool and select it.) and a cookie (Kitchen -> Food subfolder), as shown below. Position the tortoise and the stool side by side and then use a move method to move the tortoise 2 meters away from the stool. (This way you know exactly how far the tortoise is to the stool.) Use a turn to face method to be sure the tortoise is facing the stool. Write a program to move the tortoise to the stool to get the cookie. Have the tortoise show its thanks for the cookie by looking at the camera and waving an arm.