Skip to content

Instantly share code, notes, and snippets.

Created March 11, 2013 19:56
Show Gist options
  • Save anonymous/5137185 to your computer and use it in GitHub Desktop.
Save anonymous/5137185 to your computer and use it in GitHub Desktop.
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