8 Queens on A Chessboard

Previous routines can be in used in various ways. Following is one example and another example can be seen on this website here.

Example Use 

 int main (int argc, char* argv[]) {

  if (argc != 3) {
     printf("Please enter 3 Arguments exactly\n");
     printf("Usage: <cmd> <x-coordinates> <y-coordinate>\n");
     return 0;
  }

  int x, y;
  x = argv[1][0] – 48;
  y = argv[2][0] – 48;

  if (place_a_queen(x,y) == 0)
    printf ("Unable to place Queen at x, y\n");

  // Start with row 0
  recurse_queen (0,x);
 }

 

This article can be discussed at forum. Comments are welcome.

Disclaimer, the evil necessity: Posted views are of author only and this website is no way responsible for any damages caused by usage of this information.

Leave a Reply

Your email address will not be published. Required fields are marked *