Created
March 11, 2013 19:56
-
-
Save anonymous/5137185 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class Queens | |
{ | |
public static void main(String args[]) | |
{ | |
char[][] chessboard = {{'X','X','X','X','X','X','X','X'}, | |
{'O','O','O','O','O','O','O','O'}, | |
{'O','O','O','O','O','O','O','O'}, | |
{'O','O','O','O','O','O','O','O'}, | |
{'O','O','O','O','O','O','O','O'}, | |
{'O','O','O','O','O','O','O','O'}, | |
{'O','O','O','O','O','O','O','O'}, | |
{'O','O','O','O','O','O','O','O'}}; | |
int incrementor = 0; | |
for(int x = 0; x < 8; x++) | |
{ | |
for(int y = 0; y < 8; y++) | |
{ | |
chessboard[x][y + incrementor] = chessboard[x][y]; | |
chessboard[x][y] = 'O'; | |
incrementor++; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment