===========================================================================
CODING
#include<all.h>
void main()
{
int i,y,s,q,x,sum,X,Y,S_no,n;
char b;
first();
second();
third();
clrscr();
textcolor(BLACK);
cprintf("Enter number of Overs: ");
cscanf("%d",&n);
getch();
clrscr();
for(S_no=1,X=37,Y=19;S_no<=n;S_no++,X=X+3,Y=19)
{
for(y=1;y<=10;y++)
{
for(x=1;x<=80;x++)
{
gotoxy(x,y);
cprintf(" ");
}
}
for(y=11;y<=25;y++)
{
for(x=1;x<=28;x++)
{
gotoxy(x,y);
cprintf(" ");
}
}
gotoxy(37,1);
cprintf("CRICKET");
gotoxy(1,3);
cprintf("»Enter Runs in OVER %d:-",S_no);
gotoxy(3,5);
cprintf("►Ball 1: ");
gotoxy(3,6);
cprintf("►Ball 2: ");
gotoxy(3,7);
cprintf("►Ball 3: ");
gotoxy(3,8);
cprintf("►Ball 4: ");
gotoxy(3,9);
cprintf("►Ball 5: ");
gotoxy(3,10);
cprintf("►Ball 6: ");
gotoxy(3,15);
cprintf("R");
gotoxy(3,16);
cprintf("U");
gotoxy(3,17);
cprintf("N");
gotoxy(3,18);
cprintf("S");
gotoxy(13,23);
cprintf("B");
gotoxy(16,23);
cprintf("A");
gotoxy(19,23);
cprintf("L");
gotoxy(21,23);
cprintf("L");
for(i=0,x=6,y=20;i<=6;i++,y--)
{
gotoxy(x,y);
cprintf("%d",i);
}
for(i=0,x=8,y=20;i<=7;i++,y--)
{
gotoxy(x,y);
if(i==0)
cprintf("┴");
else if(i==7)
cprintf("▲ ");
else
cprintf("┤");
}
for(i=1,x=10,y=20;i<=6;i++,x=x+3)
{
if(i==1)
{
gotoxy(x-1,y);
cprintf("─");
}
gotoxy(x,y);
if(i==6)
cprintf("╨─►",i);
else
cprintf("╨───",i);
gotoxy(x,y+1);
cprintf("%d",i);
}
for(x=29,y=11;y<=25;y++)
{
gotoxy(x,y);
cprintf("│");
}
gotoxy(30,15);
cprintf("R");
gotoxy(30,16);
cprintf("U");
gotoxy(30,17);
cprintf("N");
gotoxy(30,18);
cprintf("S");
gotoxy(40,23);
cprintf("O");
gotoxy(43,23);
cprintf("V");
gotoxy(46,23);
cprintf("E");
gotoxy(49,23);
cprintf("R");
for(i=0,x=33,y=20;i<=6;i++,y--)
{
gotoxy(x,y);
cprintf("%d",i);
}
for(i=0,x=35,y=20;i<=7;i++,y--)
{
gotoxy(x,y);
if(i==0)
cprintf("┴");
else if(i==7)
cprintf("▲ ");
else
cprintf("┤");
}
for(i=1,x=37,y=20;i<=n;i++,x=x+3)
{
if(i==1)
{
gotoxy(x-1,y);
cprintf("─");
}
gotoxy(x,y);
if(i==n)
cprintf("╨─►",i);
else
cprintf("╨───",i);
gotoxy(x,y+1);
cprintf("%d",i);
}
for(i=1,y=19,s=10,sum=0;i<=6;i++,y=19,s=s+3)
{
label:
gotoxy(12,i+4);
b=getche();
if((int)b>54 || (int)b<48)
{
gotoxy(12,i+4);
cprintf(" ");
goto label;
}
for(q=1;q<=b-48;q++)
{
gotoxy(s,y);
cprintf("║");
y=y-1;
if(q==b-48)
{
gotoxy(s,y+1);
cprintf("╦");
}
}
sum=sum+(b-48);
}
sum=sum/6;
for(i=1,y=Y,x=X;i<=sum;i++)
{
gotoxy(x,y);
cprintf("║");
y=y-1;
if(i==sum)
{
gotoxy(x,y+1);
cprintf("╦");
}
}
textcolor(RED+BLINK);
gotoxy(52,1);
if(S_no==n)
cprintf("Press any Key to END PROGRAM");
else
cprintf("Press any Key to Continue....");
textcolor(BLACK);
getch();
}
}
CODING
#include<all.h>
void main()
{
int i,y,s,q,x,sum,X,Y,S_no,n;
char b;
first();
second();
third();
clrscr();
textcolor(BLACK);
cprintf("Enter number of Overs: ");
cscanf("%d",&n);
getch();
clrscr();
for(S_no=1,X=37,Y=19;S_no<=n;S_no++,X=X+3,Y=19)
{
for(y=1;y<=10;y++)
{
for(x=1;x<=80;x++)
{
gotoxy(x,y);
cprintf(" ");
}
}
for(y=11;y<=25;y++)
{
for(x=1;x<=28;x++)
{
gotoxy(x,y);
cprintf(" ");
}
}
gotoxy(37,1);
cprintf("CRICKET");
gotoxy(1,3);
cprintf("»Enter Runs in OVER %d:-",S_no);
gotoxy(3,5);
cprintf("►Ball 1: ");
gotoxy(3,6);
cprintf("►Ball 2: ");
gotoxy(3,7);
cprintf("►Ball 3: ");
gotoxy(3,8);
cprintf("►Ball 4: ");
gotoxy(3,9);
cprintf("►Ball 5: ");
gotoxy(3,10);
cprintf("►Ball 6: ");
gotoxy(3,15);
cprintf("R");
gotoxy(3,16);
cprintf("U");
gotoxy(3,17);
cprintf("N");
gotoxy(3,18);
cprintf("S");
gotoxy(13,23);
cprintf("B");
gotoxy(16,23);
cprintf("A");
gotoxy(19,23);
cprintf("L");
gotoxy(21,23);
cprintf("L");
for(i=0,x=6,y=20;i<=6;i++,y--)
{
gotoxy(x,y);
cprintf("%d",i);
}
for(i=0,x=8,y=20;i<=7;i++,y--)
{
gotoxy(x,y);
if(i==0)
cprintf("┴");
else if(i==7)
cprintf("▲ ");
else
cprintf("┤");
}
for(i=1,x=10,y=20;i<=6;i++,x=x+3)
{
if(i==1)
{
gotoxy(x-1,y);
cprintf("─");
}
gotoxy(x,y);
if(i==6)
cprintf("╨─►",i);
else
cprintf("╨───",i);
gotoxy(x,y+1);
cprintf("%d",i);
}
for(x=29,y=11;y<=25;y++)
{
gotoxy(x,y);
cprintf("│");
}
gotoxy(30,15);
cprintf("R");
gotoxy(30,16);
cprintf("U");
gotoxy(30,17);
cprintf("N");
gotoxy(30,18);
cprintf("S");
gotoxy(40,23);
cprintf("O");
gotoxy(43,23);
cprintf("V");
gotoxy(46,23);
cprintf("E");
gotoxy(49,23);
cprintf("R");
for(i=0,x=33,y=20;i<=6;i++,y--)
{
gotoxy(x,y);
cprintf("%d",i);
}
for(i=0,x=35,y=20;i<=7;i++,y--)
{
gotoxy(x,y);
if(i==0)
cprintf("┴");
else if(i==7)
cprintf("▲ ");
else
cprintf("┤");
}
for(i=1,x=37,y=20;i<=n;i++,x=x+3)
{
if(i==1)
{
gotoxy(x-1,y);
cprintf("─");
}
gotoxy(x,y);
if(i==n)
cprintf("╨─►",i);
else
cprintf("╨───",i);
gotoxy(x,y+1);
cprintf("%d",i);
}
for(i=1,y=19,s=10,sum=0;i<=6;i++,y=19,s=s+3)
{
label:
gotoxy(12,i+4);
b=getche();
if((int)b>54 || (int)b<48)
{
gotoxy(12,i+4);
cprintf(" ");
goto label;
}
for(q=1;q<=b-48;q++)
{
gotoxy(s,y);
cprintf("║");
y=y-1;
if(q==b-48)
{
gotoxy(s,y+1);
cprintf("╦");
}
}
sum=sum+(b-48);
}
sum=sum/6;
for(i=1,y=Y,x=X;i<=sum;i++)
{
gotoxy(x,y);
cprintf("║");
y=y-1;
if(i==sum)
{
gotoxy(x,y+1);
cprintf("╦");
}
}
textcolor(RED+BLINK);
gotoxy(52,1);
if(S_no==n)
cprintf("Press any Key to END PROGRAM");
else
cprintf("Press any Key to Continue....");
textcolor(BLACK);
getch();
}
}
===========================================================================