/* Blah blah blah read in N. By the way, the first line is still N alone and then the CSV starts on the next line */ // RuntimeConfig.CSV is a flag I set in a static class that also has my debug flag in it if (RuntimeConfig.CSV) { // Move to first actual line of cells StdIn.readLine(); int lineNum = 0; String[] line; while (StdIn.hasNextLine() && !(StdIn.isEmpty())) { line = StdIn.readLine().toString().split(","); for (int xi = 0; xi < n; xi++) { if (Integer.parseInt(line[xi]) == 1) { p.open(xi, (n-1) - lineNum); } } lineNum++; } } else { /* Do whatever else you want */