123 Eng

### Engineering the engineers™

Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

Computer Science / IT
Electronics
Electrical
Mechanical
Chemical
Civil

CAT / MBA

GMAT / Foreign MBA
Latest Jobs

Displaying  Source Code(s)

 Graphics Eight Queen (Mini Project) -------------------------------------------------------------------------------- Description : Solving the eight queens problem using graphics which helps the beginner to know well about graphics Code : //8 QUEEN PROBLEM USING BACKTRACKING #include #include #include int col[9],o,f=0,C1=DETECT,C2; gra(); place(int x); void main() { int row,q; clrscr(); col[1]=0; row=1; printf(" TOTAL NO OF ATTEMPT 92 "); printf(" NO OF ATTEMPT 'U' WANT : "); scanf("%d",&o); while(row>0) { col[row]=col[row]+1; while(col[row]<=8&&place(row)==1) col[row]=col[row]+1; if(col[row]<=8) { if(row==8) { f++; gra(); if(f==o) break; } else { row=row+1; col[row]=0; } } else row=row-1; } getch(); } /* PLACING THE QUEEN */ place(int x) { int i,p,q,r; for(i=1;i=0;i--) { line(i,10,i,y); line(x-i,10,x-i,y); delay(20); } t1=10; t2=8; t4=1; i=1; if(f==o) { for(t3=0;t3<=40;t3++) { if(t4==10) { i++; t4=1; } t4++; if(t3>=0&&t3<=30) { setcolor(i); outtextxy(t1*t3+8,t2*t3,"H"); outtextxy(620-(t3*9),t2*t3,"Y"); outtextxy(324,t2*t3,"N"); outtextxy(t1*t3+16,480-(t3*8),"A"); outtextxy(615-(t3*8+16),480-(t3*8),"O"); outtextxy(332,480-(t3*8),"K"); outtextxy(t1*t3,240,"T"); outtextxy(608-(t3*8),240,"U"); } if(t3>=10&&t3<=39) { setcolor(16); outtextxy(t1*(t3-10)+8,t2*(t3-10),"H"); outtextxy(620-(t3-10)*9,t2*(t3-10),"Y"); outtextxy(324,t2*(t3-10),"N"); outtextxy(t1*(t3-10)+16,480-(t3-10)*8,"A"); outtextxy(615-((t3-10)*8+16),480-(t3-10)*8,"O"); outtextxy(332,480-(t3-10)*8,"K"); outtextxy(t1*(t3-10),240,"T"); outtextxy(608-(t3-10)*8,240,"U"); } delay(50); } } return(0); }

Contribute content or training reports / feedback / Comments
job placement papers