Hi everybody. I've recently written a code for the function rulls in the game ckeckers but it has one error which is a syntax error and I cannot fix it . I will appreciate any help with my code. Thanks.
#include <stdio.h>
#include <stdlib.h>
int board[8][8]={0,2,0,2,0,2,0,2,2,0,2,0,2,0,2,0,0,2,0,2,0,2,0,2, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0, 1,0,1,0,1,0,1,1,0,1,0,1,0,1,0};
int rulls_home(int a1,int b1, int a2, int b2);
int main(){
{
int x1,x2,y1,y2;
scanf("%d",&x1);
scanf("%d",&y1);
scanf("%d",&x2);
scanf("%d",&y2);
printf("%d",rulls_home(x1,y1,x2,y2));
system("PAUSE");
return 0;
}
int rulls_home(int a1,int b1, int a2, int b2){
int turn,i,j;
scanf("%d",&turn);
for(i=0;i<=7;i++){
for(j=0;j<=7;j++){
if((i%2==0&&j%2==0)||((i-1)%2==0&&(j-1)%2==0)){
if(board[i][j]==board[a2][b2]){
return 0;
}
}
}
}
if(turn==0){
if(a1<=7&&a2<=7){
if(b1<=7&&b2<=7){
if(board[a1][b1]==1||board[a1][b1]==3){
if(board[a2][b2]==0){
return 1;
}
return 0;
}
return 0;
}
return 0;
}
return 0;
}
else{
if(turn==1){
if(a1<=7&&a2<=7){
if(b1<=7&&b2<=7){
if(board[a1][b1]==2||board[a2][b2]==4){
if(board[a2][b2]==0){
return 1;
}
return 0;
}
return 0;
}
return 0;
}
return 0;
}}
}