CS320n - Assignment 2

This is individual work. You may talk to other students in the course about your design and for ideas, but you are to complete the Alice program by yourself. You may receive help from the instructor or the TA.

This assignment is based on the Cleanup Robot project  the Learning to Program with Alice textbook.

  1. Download the initial Alice world. (If you wish to create the initial scene on your own, you can. Just make it look somewhat similar to the scene below.)

  2. The initial scene shows a room with four objects scattered around the room. (a barbell, glass slipper, toy ball, and a green bottle) and a gorilla robot.

     

  3. The goal of the program is to show the gorilla robot in action. When your program is complete the gorilla robot will pick up the objects in the room one at a time and put them in the closet. (Behind the closet door in the room.) In the initial scene the robot is standing in the middle of the floor.
  4. Your program should show the robot picking up each object and putting it in the closest and then moving on the the next object. When the program is over the green bottle, barbell, toy ball, and class slipper will all be in the closet.
  5. Write three methods named pickUp, putDown,  and putInCloset.. pickUp and putDown should be class level methods for the robot gorilla. putIntCloset should be a world level method.
  6. The pickup and putdown methods should have one object parameter that is the object to be picked up or putdown.
  7. The pickUp method should make the robot pick up an object in its hand.
  8. The putDown methods should have the robot put the object down.
  9. The puInCloset method should make the robot turn to face the closet and move to the door. The door opens and the robot moves a short way into the closet and puts the object in its hand down and then returns to its original position in the middle of the floor. The method will need one parameter, what to put in the closet. (Hint: use an invisible object or a dummy object below the floor to mark the starting position.)
  10. When these methods have been written, complete my First Method. Make 4 calls to putInCloset passing each object in the room once. When complete all objects should be put away and the robot is back in the same spot it started.
  11. Use the Save As option to save the world with a new name. The name of your world shall be your UTEID followed by a dash and a2. For example, my UTEID is scottmd3 so my world would be named scottmd3-a2.a2w
  12. Turning in your assignment. The assignment must be turned in no later than 11 pm on Friday, February 13. To turn in your assignment you must have your Microlab account id and password. Use these to turn in the program electronically using the Microlab turnin web page. Refer to this web page for instructions on using the turnin web page.

Hints and Tips