Skip to content

Instantly share code, notes, and snippets.

@adamtowerz
Created May 4, 2018 22:15
Show Gist options
  • Save adamtowerz/463e5b0fe47cfe3bcb2f98c20dad5f16 to your computer and use it in GitHub Desktop.
Save adamtowerz/463e5b0fe47cfe3bcb2f98c20dad5f16 to your computer and use it in GitHub Desktop.
UW CSE 142 Au2010 Midterm: Problem XO
public static void xo(int a) {
for (int i = 0; i < a; i++) { // rows
for (int j = 0; j < a; j++) { // columns
if (j == i || j == a - 1 - i) {
System.out.print("x");
} else {
System.out.print("o");
}
}
System.out.println();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment