Code:
#include <stdio.h>
#include<conio.h>
#include<ctype.h>
void new_game1();
void blue(int q,int r, int s, int t, int u);
void green(int v,int w, int x, int y, int z);
void player1();
void exit();
void game();
void one();
void scores();
void main()
{int a,c;
clrscr();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\tLet's Play Basketball!!!");
printf("\n\n\n\n\n\t\t\t 1 - start new game");
printf("\n\n\t\t\t 2 - quit game");
printf("\n\n\n\n\n ");
scanf("%d",&a);
if(a==1)
{new_game1();}
else if(a==2)
{exit();}
else
printf("\n\n\t\t\tYou've entered an invalid choice.");
getch();
}
void new_game1()
{
int a,b,c,d,e,f,g,h,i,j,k,l;
clrscr();
printf("\tTEAM BLUE");
printf("\n\n\n\t 1");
printf("\n\n\n\t 12");
printf("\n\n\n\t 2");
printf("\n\n\n\t 9");
printf("\n\n\n\t 8");
printf("\n\n\n\t 21");
printf("\n\n\n\t 25");
printf("\n\n\n\t 5");
printf("\n\n\n\t 13");
printf("\n\n\n\t 14");
printf("\n\n\t\tPlease choose 5 players from each team.");
printf("\n\n\t\t1st player: ");
scanf("%d", &b);
printf("\n\n\t\t2nd player: ");
scanf("%d", &c);
printf("\n\n\t\t3rd player: ");
scanf("%d", &d);
printf("\n\n\t\t4th player: ");
scanf("%d", &e);
printf("\n\n\t\t5th player: ");
scanf("%d", &f);
printf("\n");
printf("\tTEAM GREEN");
printf("\n\n\n\t 3");
printf("\n\n\n\t 11");
printf("\n\n\n\t 7");
printf("\n\n\n\t 4");
printf("\n\n\n\t 5");
printf("\n\n\n\t 9");
printf("\n\n\n\t 2");
printf("\n\n\n\t 6");
printf("\n\n\n\t 10");
printf("\n\n\n\t 14");
printf("\n\n\t\tPlease choose 5 players from each team.");
printf("\n\n\t\t1st player: ");
scanf("%d", &g);
printf("\n\n\t\t2nd player: ");
scanf("%d", &h);
printf("\n\n\t\t3rd player: ");
scanf("%d", &i);
printf("\n\n\t\t4th player: ");
scanf("%d", &j);
printf("\n\n\t\t5th player: ");
scanf("%d", &k);
printf("\n\nThe players you have chosen for Team Blue are %d,%d,%d,%d,%d",b,c,d,e,f);
printf( "\n\nThe players you have chosen for Team Green are %d,%d,%d,%d,%d",g,h,i,j,k);
printf("\n\n\n\n");
printf("Let's start the game!!!");
printf("\n\n\n\nJUMPBALL!!!");
printf("\n\n\n\n\n\n\n\nBall possesion goes to Team?");
printf("\n\n\t\t\t1 - Team Blue");
printf("\n\n\t\t\t2 - Team Green");
printf("\n\n\t\t\tEnter your choice:");
printf(" ");
scanf("%d", &l);
if(l==1)
blue(b,c,d,e,f);
else if(l==2)
green(g,h,i,j,k);
}
void exit()
{
printf("\n\n\t\t\tThank you for using this program");
getch();
}
void blue(int q,int r, int s, int t, int u)
{int a;
clrscr();
printf("\n\n\t\t\tThe players of Team Blue:");
printf("\n\n\n\t\t\t %d",q);
printf("\n\n\n\t\t\t %d",r);
printf("\n\n\n\t\t\t %d",s);
printf("\n\n\n\t\t\t %d",t);
printf("\n\n\n\t\t\t %d",u);
printf("\n\n\n\t\t\tWhich player has the ball?");
printf("\n\n\n\t\t\tEnter the number of the player: ");
scanf("%d",&a);
if(a==1)
one();
getch();
}
void green(int v,int w, int x, int y, int z)
{printf("%d,%d,%d,%d,%d", v,w,x,y,z);
}
void one()
{
int a ;
int x[20];
printf("\n\n\n\t\tPlayer number 1 of Team Blue has shoot the ball.");
printf("\n\n\n\t\t\t1- one point for free throws");
printf("\n\n\t\t\t2- two points for lay-up shot");
printf("\n\n\t\t\t3- for three point shot");
printf("\n\n\n\t\t\tEnter a score: ");
scanf("%d", &a);
scores();
getch();
}
void scores()
{clrscr();
printf(" TEAM BLUE\t\tscores\t\t\TEAM GREEN\t\tscores");
printf("\n\n\n\n 1\t\t\t\t\t 3");
printf("\n\n\n 12\t\t\t\t 11");
printf("\n\n\n 2\t\t\t\t\t 7");
printf("\n\n\n 9\t\t\t\t\t 4");
printf("\n\n\n 8\t\t\t\t\t 5");
printf("\n\n\n 21\t\t\t\t 9");
printf("\n\n\n 25\t\t\t\t\t 2");
printf("\n\n\n 5\t\t\t\t 6");
printf("\n\n\n 13\t\t\t\t\t 10");
printf("\n\n\n 14\t\t\t\t\t 14");
getch();
}
threept(int a)
{int c;
c=a+3;
return c;
}
onept(int a)
{int c;
c=a+1;
return c;
}
twopt(int a)
{int c;
c=a+2;
return c;
}
this is the whole code.....