University of Toronto - Spring 1998
Department of Computer Science

CSC 148: INTRODUCTION TO COMPUTER SCIENCE



Announcements and Advice about Assignment 4
(Toy Train Set)

Tuesday 07 April: Part E, question 1

Question 1 asks you to "describe briefly what kind of nodes are in each of the following sets at any one time..." Here, I am referring to "node" in the abstract sense of a node in a graph. I am not referring to node classes in the code, such as VertexNode.

This question is asking you to characterize the set C and the set S (as well as their intersection and their "complement" -- the things that are not in either set). All nodes that are in set S have some thing or things in common. What are they? Perhaps they all have at least 3 adjacent nodes, or they all are coloured with colour 1. This is the sort of thing I'm looking for.



Monday 06 April: Downtown students -- Extension

Because the cdf-pc lab was down over the weekend, downtown students have a one day extension on assignment 4. It is now due Thursday at 6 p.m.

This means that grace days cannot be used to hand the assignment in beyond Thursday. (Friday is a statutory holiday, the university is closed and buildings are locked.)

This extension applies to downtown students only.



Monday 06 April: Persons leaping around

Question: I think there is a bug that cause people to shift from place to place, this might be the problem... also, should I fix it?

} else if (targetLocation.col != currentLocation.col) { 
 
     // Move horizontally. 
     int colMod = (currentLocation.col < targetLocation.col) ? 1 : -1; 
     registerMove(new GridLoc(currentLocation.col, 
                                              ^^^ this should be row 
     currentLocation.col+colMod)); 
Could any TA comfirm this? Thanks.

Answer, from head TA Paul Gries: Confirmed. Thanks for finding this. You don't need to fix it, although if it's bugging you to have the Persons leaping around the screen by all means feel free to do so.

Friday 03 April: Do I need to hand in a report?

No. Just hand in what it says in each section of the assignment handout. So, for example, you won't be handing in any testing. And for your new Animal class, it is enough to describe it in the comments for that new class.

If you feel that you need to explain something to the marker in more detail than is appropriate for comments, it is okay if do submit an additional, brief, written component.



Friday 03 April: Part F FlexList -- insert1() or insert2()?

For Part F, you should implement FlexList using insert2().

Thursday 02 April: Small bug in Plot.getAnimals()

In method Plot.getAnimals(), the second for-loop currently counts up to numAnimals:
    for (int i=0; i < numAnimals; i++) {
It should count up to numEntities:
    for (int i=0; i < numEntities; i++) {
Thanks to James Ho for pointing this out.

Thursday 02 April: Small bug in Car.takeTurn()

In method Car.takeTurn(), the line
    crashed = true;
should read
    crash();
Otherwise, the Animals won't go free when an Engine crashes, since Engine.crash() never gets called. Thanks to Adam Foster for pointing this out.

Tuesday 31 March: Nothing happens when you run A4?

Question: I successfully unzipped A4.zip, successfully compiled all of it, and tried "java A4Main". Nothing happens. What am I missing?
Answer: Here is a potential fix:
First, comment out this line in TrainSet.TrainSet():

    buildTrack();

And in A4Main.main(), replace

    trainSet.setVisible(true);

with these two lines:

    trainSet.show();
    trainSet.buildTrack();



Back to the csc148 home page