// 8vazir dar khanehaye shatranj // in barname tavasote seyyed amir neveshte shode ast. // seyyed.a@gmail.com // yahoo id: dry_gulf // 3baradar.blogfa.com #include #include int temp[9][3]; int vazirha[100][9]; int vn; int check(int satr,int sotoon, int tmp_num); /////^^^^^^^^^^^^^^^ MAIN ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ int main() { clrscr(); int satr; for(int sotoona=1;sotoona<=8;sotoona++){ satr=1; //if(!check(satr,sotoona,satr-1)) //continue; //else{ temp[satr][1]=satr; temp[satr][2]=sotoona; //} for(int sotoonb=1;sotoonb<=8;sotoonb++){ satr = 2; if(!check(satr,sotoonb,satr-1)) continue; else{ temp[satr][1]=satr; temp[satr][2]=sotoonb; } for(int sotoonc=1;sotoonc<=8;sotoonc++){ satr=3; if(!check(satr,sotoonc,satr-1)) continue; else{ temp[satr][1]=satr; temp[satr][2]=sotoonc; } for(int sotoond=1;sotoond<=8;sotoond++){ satr=4; if(!check(satr,sotoond,satr-1)) continue; else{ temp[satr][1]=satr; temp[satr][2]=sotoond; } for(int sotoone=1;sotoone<=8;sotoone++){ satr=5; if(!check(satr,sotoone,satr-1)) continue; else{ temp[satr][1]=satr; temp[satr][2]=sotoone; } for(int sotoonf=1;sotoonf<=8;sotoonf++){ satr=6; if(!check(satr,sotoonf,satr-1)) continue; else{ temp[satr][1]=satr; temp[satr][2]=sotoonf; } for(int sotoong=1;sotoong<=8;sotoong++){ satr=7; if(!check(satr,sotoong,satr-1)) continue; else{ temp[satr][1]=satr; temp[satr][2]=sotoong; } for(int sotoonh=1;sotoonh<=8;sotoonh++){ satr=8; if(!check(satr,sotoonh,satr-1)) continue; else{ temp[satr][1]=satr; temp[satr][2]=sotoonh; clrscr(); cout << "tabrik\n shoma be javab residid \n\n"; //sotoona=sotoonb=sotoonc=sotoond=sotoone=20; //sotoonf=sotoong=sotoonh=20; cout << "vazirha = "; int amir; for (amir=1;amir<=8;amir++){ vazirha[vn][amir]=temp[amir][2] ; } vn++; cout << vn << "\n"; if(vn>100){ sotoona=sotoonb=sotoonc=sotoond=sotoone=20; sotoonf=sotoong=sotoonh=20; }//end if } }///// for sotoon-h }///// for sotoon-g }///// for sotoon-f }///// for sotoon-e }///// for sotoon-d }///// for sotoon-c }///// for sotoon-b }///// for sotoona cout << "\n\n entehaye batname\n"; for(int chap=0;chap