really long code below
I think this is against the rules?
void all_moves_wbishops(){
int rlm5;
rlm5=0;
int rrm5;
rrm5=0;
int inourway5=0;
while(wbishopsmoves<121){
int wbishopsread = Wbishops[wbishopsmoves];
if(wbishopsread==2){
bfx=11;
while(bfx<=77){
if(Wbishops[wbishopsmoves+bfx]==-1){
rlm5=1;
}
if(rlm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves+bfx] ==0){
Wbishops_pos[wbishopsmoves+bfx]=1; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=1;
inourway5=1; //did we land on a black piece? 
}
}
}
}
bfx+=11;
}
bfx=11;
inourway5=0;
rlm5=0;
while(bfx<=77){
if(Wbishops[wbishopsmoves-bfx]==-1){
rlm5=1;
}
if(rlm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves-bfx] ==0){
Wbishops_pos[wbishopsmoves-bfx]=1; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=1;
inourway5=1; //did we land on a black piece? 
}
}
}
}
bfx+=11;
}
bfx=13;
inourway5=0;
while(bfx<=91){
if(Wbishops[wbishopsmoves+bfx]==-1){
rrm5=1;
}
if(rrm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves+bfx] ==0){
Wbishops_pos[wbishopsmoves+bfx]=1; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=1;
inourway5=1; //did we land on a black piece? 
}
}
}
}
bfx+=13;
}
bfx=13;
inourway5=0;
rrm5=0;
while(bfx<=91){
if(Wbishops[wbishopsmoves-bfx]==-1){
rrm5=1;
}
if(rrm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves-bfx] ==0){
Wbishops_pos[wbishopsmoves-bfx]=1; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=1;
inourway5=1; //did we land on a black piece? 
}
}
}
}
bfx+=13;
}
}
//------------------------------------------------
if(wbishopsread==4){
bfx=11;
while(bfx<=77){
if(Wbishops[wbishopsmoves+bfx]==-1){
rlm5=1;
}
if(rlm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves+bfx] ==0){
Wbishops_pos[wbishopsmoves+bfx]=3; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=3;
inourway5=1; //did we land on a black piece? 
}
}
}
}
bfx+=11;
}
bfx=11;
inourway5=0;
rlm5=0;
while(bfx<=77){
if(Wbishops[wbishopsmoves-bfx]==-1){
rlm5=1;
}
if(rlm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves-bfx] ==0){
Wbishops_pos[wbishopsmoves-bfx]=3; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=3;
inourway5=1; //did we black on a white piece? 
}
}
}
}
bfx+=11;
}
bfx=13;
inourway5=0;
while(bfx<=91){
if(Wbishops[wbishopsmoves+bfx]==-1){
rrm5=1;
}
if(rrm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves+bfx] ==0){
Wbishops_pos[wbishopsmoves+bfx]=3; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves+bfx]==1){
Wbishops_pos[wbishopsmoves+bfx]=3;
inourway5=1; //did we land on a black piece? 
}
}
}
}
bfx+=13;
}
bfx=13;
inourway5=0;
rrm5=0;
while(bfx<=91){
if(Wbishops[wbishopsmoves-bfx]==-1){
rrm5=1;
}
if(rrm5==0){
if(inourway5==0){
if(Wbishops[wbishopsmoves-bfx] ==0){
Wbishops_pos[wbishopsmoves-bfx]=3; //here is a possible move for the bishop
if(Wpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=0;
inourway5=1; //did we land on one of our pieces? cant move there then
}
if(Bpieces[wbishopsmoves-bfx]==1){
Wbishops_pos[wbishopsmoves-bfx]=3;
inourway5=1; //did we land on a black piece? 
}
}
}
}
bfx+=13;
}
}
wbishopsmoves++;
}
if(wbishopsmoves>121){
wbishopsmoves=0;
all_moves_wpawns(); // move on to next function
}
}