COMP1400

Programming for Designers

COMP1400 header image 2

Week 10 Lab

September 27th, 2009 · No Comments

  1. Add a number of objects in a world and place some or all the objects in a list.  Next, write a function that counts and returns the number of objects in your list.  Use this function to make every object in the list say this number.  For example, if your list has 4 objects then all four objects should say “4″.
  2. Alice is still a developing language, i.e., it still contains bugs.  One of these bugs resides in the “contains” function for lists.  When you drag a list into a boolean expression (of an If/Else or While) you will have the option of selecting the “contains” function.  This function takes two inputs, a list and an object.  It should return true if the object is in the list and false otherwise.  Most of the time, this function is incorrect - verify this for yourself.  Write and test your own Boolean function that determines whether one specific object is contained in a list of objects.
  3. Start work on Assignment 3. You should have a storyboard by now. If not, develop it during this lab and show your tutor next week.

Tags: Lab

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.