Skip to content

Instantly share code, notes, and snippets.

@paxswill
Forked from anonymous/Joe's Problem
Last active December 14, 2015 19:29
Show Gist options
  • Save paxswill/5137192 to your computer and use it in GitHub Desktop.
Save paxswill/5137192 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'}};
for(int x = 0; x < 8; x++)
{
for(int y = 0; y < 8; y++)
{
if ( x == y)
{
chessboard[x][y] = 'X';
}
else
{
chessboard[x][y] = 'O';
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment