Created
May 4, 2018 22:15
-
-
Save adamtowerz/463e5b0fe47cfe3bcb2f98c20dad5f16 to your computer and use it in GitHub Desktop.
UW CSE 142 Au2010 Midterm: Problem XO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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