# a Recursion : 8 Queens On a Chess Board

Email
 Submitted on: 1/2/2015 7:12:00 PM By: Alon Ben David (from psc cd) Level: Intermediate User Rating: By 7 Users Compatibility: C, C++ (general), Borland C++ Views: 5908

the program find a place to put queens on a chess board in any size ,using recursion.

code:
Can't Copy and Paste this?
 ``` //************************************** // Name: a Recursion : 8 Queens On a Chess Board // Description:the program find a place to put queens on a chess board in any size ,using recursion. // By: Alon Ben David (from psc cd) // // Side Effects:a great example of recursions . //************************************** /* this program made by alon ben david */ #include #define N 8 int Chess(char Arr[N][N] , int row); int check(char Arr[N][N],int row,int line); //double count; int main() { char chess[N][N]={0}; Chess(chess,0);/* The call to the function*/ { int i,y; for(i=0;i= 0 && l >= 0) { if(Arr[r][l]=='Q') return 0; --r; --l; } l=line; r=row; while(l < N && r >= 0) { if(Arr[r][l]=='Q') return 0; ++l; --r; } l=line; r=row; while(r >= 0) { if(Arr[r][l]=='Q') return 0; --r; } return 1; }```

Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)