Skip to content

Instantly share code, notes, and snippets.

@bkyrlach
Created February 16, 2020 16:02
Show Gist options
  • Select an option

  • Save bkyrlach/16fe2f8ac45e027717bd8505b3000997 to your computer and use it in GitHub Desktop.

Select an option

Save bkyrlach/16fe2f8ac45e027717bd8505b3000997 to your computer and use it in GitHub Desktop.
List<List<Piece>> board = new ArrayList<List<Piece>>();
for(int i = 0; i < 3; i++) {
List<Piece> row = new ArrayList<Piece>();
board.add(row);
for(int j = 0; j < 3; j++) {
row.add(Piece.SPACE);
}
}
for(int i = 0; i < 3; i++) {
List<Piece> row = board.get(i);
for(int j = 0; j < 3; j++) {
System.out.print(row.get(j));
}
System.out.println();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment