Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW8-Spring08


public int nextINT( int radix){
  Scanner sc= new Scanner(new File("bumpers"));
  while(sc.nextINT(){
    int nextINT= sc.nextINT();
  }


should this work for the first part


once we create a method for file input in the Model class - where are we supposed to call it?
The doPaint method I believe....Dawn Finney

When I run this, it never enters the while loop but it also doesn't stop running and I don't get any error messages.

public static int[] cellInput() throws java.io.FileNotFoundException
{

String cellinputfile = FileChooser.pickAFile();
System.out.println("working");
int cellarray[] = new int[104];
System.out.println("working");
StringTokenizer st = new StringTokenizer(cellinputfile,",");
System.out.println("working");
int i = 0;

while(st.hasMoreTokens());
{
System.out.println("working");
int cellvalue = Integer.parseInt(st.nextToken());

cellarray[i] = cellvalue;

System.out.println(cellarray[i]);
i++;
}
System.out.println("working");
return cellarray;

}


yes my file has commas after every number

I don't understand what the data file is supposed to have.

when I add my file input method (which is static) to the doPaint() method I get an error stating i must declare a file not found exception for that method and then any other method that calls doPaint() even though i already declared one for the file input method itself - is this supposed to happen and if not what should I do?

if our input method is supposed to have a filechooser and we are supposed to call it in doPaint - won't this ask for a file every timer tick since doPaint is called every timer tick?

we are confused on what we should do after we write the scanner.

hi,in recitation it was said that the homework was going to have the grace period extended until friday...is that true.

can we assume you will use the starting configuration file we submit with the hw?

Since it only needs to be done once, why couldn't we put our scanner code in the Model() constructor?

When I apply the GridLayout to Global.myPanel in the doPaint() method, nothing changes. On that note... I can't find doPaint() being called anywhere in the code, but the background color is changing, and the only place that's done is in the doPaint() method. If I try to apply the layout in the constructor (which doesn't really make sense, I guess), I get a NullPointerException.

is there a checklist for this hw


my game works but some of the larger configurations that I input lead to progressions that run for a pretty long time - should all original configurations lead to progressions that die off or reach a stable state relatively quickly
The one that keeps running is a 40 by 40 grid with about half of the cells originally alive. Is it just too big or is there something wrong with how I executed the rules?

I can see the stable state figures popping up every now and then so I think the I executed the rules correctly
Also some of my smaller (10 by 10) configurations actually do end up in stable states or dying off


this line freezes everything, any idea why?

Scanner scan = new Scanner(new File(FileChooser.pickAFile()));

For some reason, only the first "move" in my game of life works correctly. After that, cells don't generate and die by the rules. The way I'm updating is by creating a new matrix based on an application of the rules to the old matrix, then setting the old matrix equal to the new matrix. Is there something wrong with this methodology?



Link to this Page