Skip to content

Instantly share code, notes, and snippets.

@pscollins
Created May 16, 2014 23:45
Show Gist options
  • Save pscollins/042ac067e75103b62a2b to your computer and use it in GitHub Desktop.
Save pscollins/042ac067e75103b62a2b to your computer and use it in GitHub Desktop.
import java.util.Scanner;
import java.util.ArrayList;
class StarMatrix {
ArrayList<ArrayList<Boolean>> stars;
public StarMatrix (Scanner inputScanner) {
stars = new ArrayList<ArrayList<Boolean>>();
String currentLine;
Integer maxY = inputScanner.nextInt();
Integer maxX = inputScanner.nextInt();
System.out.printf("maxX: %d, maxY: %d\n", maxX, maxY);
inputScanner.nextLine();
for (int i = 0; i < maxY; i++) {
ArrayList<Boolean> currentBools = new ArrayList<Boolean>();
for(char c : inputScanner.nextLine().toCharArray()) {
currentBools.add(c == '-');
}
System.out.println("Read line:");
System.out.println(currentBools);
stars.add(currentBools);
}
System.out.println(stars);
}
}
public class Stars {
public static void main(String[] args) {
System.out.println("Test");
Scanner inputScanner = new Scanner(System.in);
StarMatrix currentMatrix = new StarMatrix(inputScanner);
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment