DOC PREVIEW
TRINITY CSCI 1311 - Looping Through Lists
Pages 6

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Looping Through Lists2/13/20082Opening Discussion■Let's look at some solutions to the interclass problem.3A Little More Lists■Last class we created two lists and went through them in different ways.The list of objects to tag we went through with the doAllTogether operation.The list of strings we went through using the index of a for loop.■We didn't use the functionality that Alice provides for adding to lists or removing from them. Let's write some code now that will do that. We will cheat and throw in a mouse event as well.■There are some challenges with lists of objects in Alice. I view these as a limitation on the Alice type system.4Animating Lists/Arrays■If you tried to animate your list by giving the objects on your list a walk method you probably found there was a problem. Alice won't let you say item_from_list.walk. This is because item_from_list could be any object in the Alice world and not all objects in Alice have a walk method.■How then do we animate objects using a list/array in Alice? The partNamed method lets us pull of sub-parts of an object to move for the animation.■This is more tedious than I would like, but it follows the strong static typing of Java and the lack of subtyping in Alice.5Random Numbers■For your project you might want some things to happen a bit differently every time it runs. For this you need random numbers.■The world has two methods to return pseudo-random boolean and double values. (For our purposes a double is just a number.)6Minute Essay■Is there any part of your project where you might use random numbers? If so, when?■You can also let me know if you have any questions about lists or arrays.■Quiz #3 will be at the beginning of next class.■Interclass Problem – Do problem 5.5 of


View Full Document

TRINITY CSCI 1311 - Looping Through Lists

Course: Csci 1311-
Pages: 6
Documents in this Course
Arrays

Arrays

12 pages

Arrays

Arrays

10 pages

Applets

Applets

5 pages

Arrays

Arrays

8 pages

Methods

Methods

12 pages

Drawing

Drawing

8 pages

Load more
Download Looping Through Lists
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Looping Through Lists and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Looping Through Lists 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?