C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 12-10-2006, 08:13 AM   #1
Registered User
 
Join Date: Dec 2006
Posts: 4
Smile Pls repair my basketball program

insert
Code:
 
[/color]can anyone repair my basketball program??
 
 
i just want to make it's output:
 
 
this is my basketball program...
 
 
 
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
 
void display(int score);
void display2(int x);
void ballshohoku();
void ballshohoku();
void ballryonan();
void ballryonan();
void ballteam();
void ballteam2();
void akagi();
void kogure();
void miyagi();
void sakuragi();
void rukawa();
void mitsui();
void sasaoka();
void sendo();
void ouzumi();
void ikagami();
void fukuda();
void aida();
void kiyota();
void maki();
int addscore(int recscore);
int addscore(int recscore);
int shoshoot();
int shoshoot2(int x);
int ryoshoot();
int ryoshoot2(int x);
void exit();
 
 
main()
{
int x=0;
clrscr();
display(x);
getch();
return 0;
}
 
void display(int score)
{
int x,y;
clrscr();
gotoxy(24,3);
{
textcolor(GREEN);
cprintf("S L A M D U N K");
}
gotoxy(29,5);
{textcolor(YELLOW);
cprintf("SHOHOKU vs RYONAN");
}
{
gotoxy(2,8);
textcolor(RED);
cprintf("- Shohoku Team Players - - Ryonan Team Players -");
textcolor(BLUE);
cprintf("\n * * * * SCORE BOARD * * * * ");
printf("\n\n (1) Takenori Akagi * SHOHOKU RYONAN * (1) Akira Sendo");
printf("\n (2) Kiminobu Kogure (2) Jun Ouzumi");
printf("\n (3) Ryota Miyagi * %d %d * (3) Ryogi Ikegami",score);
printf("\n (4) Hanamichi Sakuragi (4) Kicchou Fukuda");
printf("\n (5) Kaede Rukawa * * (5) Hikoichi Aida");
printf("\n (6) Hisashi Mitsui^ (6) Nobunaga Kiyota^");
printf("\n (7) Satoro Sasaoka^ * * * * * * * * * * * * * * (7) Shinichi Maki^");
printf("\n\n NOTE: ( ^ ) - for substitute");
printf("\n\n PRESS 0 - start game, 999 - view scores, 99 - exit program ");
scanf("%d",&x);}
if(x==0)
    {ballteam();}
if(x==99)
    {exit();}
else
    printf("\tInvalid entry!");
getch();
}
 
void display2(int score)
{
int x;
clrscr();
gotoxy(24,3);
{textcolor(GREEN);
cprintf("S L A M D U N K");
}
gotoxy(29,5);
printf("SHOHOKU vs RYONAN");
gotoxy(2,8);
printf("- Shohoku Team Players - * * * * SCORE BOARD * * * * - Ryonan Team Players -");
printf("\n\n (1) Takenori Akagi * A B * (1) Akira Sendo");
 
printf("\n (2) Kiminobu Kogure (2) Jun Ouzumi");
printf("\n (3) Ryota Miyagi * %d * ",score);
gotoxy(23,14);
printf("(3) Ryogi Ikagami");
printf("\n (4) Hanamichi Sakuragi (4) Kicchou Fukuda");
printf("\n (5) Kaede Rukawa * * (5) Hikoichi Aida");
printf("\n (6) Hisashi Mitsui^ (6) Nobunaga Kiyota^");
printf("\n (7) Satoro Sasaoka^ * * * * * * * * * * * * * * (7) Shinichi Maki^");
printf("\n\n\t\t\t NOTE: ( ^ ) - for substitute");
printf("\n\n Press 999 - view scores, 99 - exit program ");
scanf("%d",&x);
if(x==99)
    {exit();}
else
    printf("\tInvalid entry!");
ballteam2();
shoshoot2(score);
getch();
}
 
void ballteam()
{
int x;
printf(
"\n\n\t\t\tLET THE GAMES BEGIN! \nJUMPBALL!");
repeat:
printf("\n\n\t\tWhich team got the ball? (1) Shohoku or (2) Ryonan?");
scanf("\t%d",&x);
if(x==1)
    {ballshohoku();}
else
goto repeat;
getch();
}
 
 
void ballshohoku()
{
int y;
printf("\n\n\tEnter Player number who got the ball: ");
scanf("\t%d",&y);
if(y==1)
{akagi();}
if(y==2)
{kogure();}
if(y==3)
{miyagi();}
if(y==4)
{sakuragi();}
if(y==5)
{rukawa();}
if(y==6)
{mitsui();}
if(y==7)
{sasaoka();}
else
printf("\t\nAy nako!");
getch();
}
 
void akagi()
{
int pn;
printf("\n\n\tPlayer is Takenori Akagi");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {shoshoot();}
if(pn==2)
    {ballshohoku();}
else
{printf("\n\t\t\tInvalid entry!");}
getch();
}
 
void kogure()
{
int pn;
printf("\n\n\tPlayer is Kiminobu Kogure");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {shoshoot();}
if(pn==2)
    {ballshohoku();}
else
{printf("\n\t\t\tInvalid entry!");}
getch();
}
 
void miyagi()
{
int pn;
printf("\n\n\tPlayer is Ryota Miyagi");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {shoshoot();}
if(pn==2)
    {ballshohoku();}
else
{printf("\n\t\t\tInvalid entry!");}
getch();
}
 
void sakuragi()
{
int pn;
printf("\n\n\tPlayer is Hanamichi Sakuragi");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {shoshoot();}
if(pn==2)
    {ballshohoku();}
else
{printf("\n\t\t\tInvalid entry!");}
getch();
}
 
void rukawa()
{
int pn;
printf("\n\n\tPlayer is Kaede Rukawa");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {shoshoot();}
if(pn==2)
    {ballshohoku();}
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
void mitsui()
{
int pn;
printf("\n\n\tPlayer is Hisashi Mitsui");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {shoshoot();}
if(pn==2)
    {ballshohoku();}
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
void sasaoka()
{
int pn;
printf("\n\n\tPlayer is Satoro Sasaoka");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {shoshoot();}
if(pn==2)
    ballshohoku();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
int shoshoot()
{
int shoscore;
printf("\n\n\tWhat score did he obtain? (0) miss, (1) point, (2) points, (3) points");
scanf("\t%d",&shoscore);
if(shoscore==0)
{ballteam();}
if(shoscore>=1)
{addscore(shoscore);}
 
getch();
}
 
 
void ballteam2()
{
int x;
printf("\n\n\t\t\tWhich team got the ball? (1) Shohoku or (2) Ryonan?");
scanf("\t%d",&x);
if(x==1)
    {ballshohoku();}
else
{printf("\tAy nako!");}
getch();
}
 
int addscore(int recscore)
{
int newscore;
newscore=(newscore+recscore);
display(newscore);
getch();
}
 
int addscore2(int recscore)
{
int newscore;
newscore=(newscore+recscore);
display2(newscore);
getch();
}
 
int shoshoot2(int x)
{
int shoscore;
printf("\n\n\tWhat score did he obtain? (0) miss, (1) point, (2) points, (3) points");
scanf("\t%d",&shoscore);
if(shoscore==0)
{ballteam();}
if(shoscore>=1)
{addscore(shoscore);}
getch();
}
 
 
void exit()
{
clrscr();
getche();
}
 
void sendo()
{
int pn;
printf("\n\n\tPlayer is Akira Sendo");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {ryoshoot();}
if(pn==2)
    ballryonan();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
void ouzumi()
{
int pn;
printf("\n\n\\tPlayer Jun Ouzumi");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {ryoshoot();}
if(pn==2)
    ballryonan();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
 
void ikagami()
{
int pn;
printf("\n\n\\tPlayer Ryogi Ikagami");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {ryoshoot();}
if(pn==2)
    ballryonan();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
void fukuda()
{
int pn;
printf("\n\n\\tPlayer Kicchou Fukuda");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {ryoshoot();}
if(pn==2)
    ballryonan();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
void aida()
{
int pn;
printf("\n\n\\tPlayer Hikoichi Aida");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {ryoshoot();}
if(pn==2)
    ballryonan();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
void kiyota()
{
int pn;
printf("\n\n\\tPlayer Nobunaga Kiyota");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {ryoshoot();}
if(pn==2)
    ballryonan();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
void maki()
{
int pn;
printf("\n\n\\tPlayer Shinichi Maki");
printf("\n\n\tWhat happened to the ball? \t(1) - Shoot (2) - Pass (3) - Steal");
scanf("\n\t\t%d",&pn);
if(pn==1)
    {ryoshoot();}
if(pn==2)
    ballryonan();
else
printf("\n\t\t\tInvalid entry!");
getch();
}
 
void ballryonan()
{
int y;
printf("\n\n\tEnter Player number who got the ball: ");
scanf("\t%d",&y);
if(y==1)
{sendo();}
if(y==2)
{ouzumi();}
if(y==3)
{ikagami();}
if(y==4)
{fukuda();}
if(y==5)
{aida();}
if(y==6)
{kiyota();}
if(y==7)
{maki();}
else
printf("\t\t\t Wrong Input !");
getch();
}
death_messiah12 is offline   Reply With Quote
Old 12-10-2006, 08:13 AM   #2
Registered User
 
Join Date: Dec 2006
Posts: 4
plsss
i need it for tom
death_messiah12 is offline   Reply With Quote
Old 12-10-2006, 08:16 AM   #3
Registered User
 
Join Date: Dec 2006
Posts: 4
and pls make it as possible as it can determine the MVP of the game while viewing the scores of the teams


pls use array

i need ur help
pls make it as soon as you can....
death_messiah12 is offline   Reply With Quote
Old 12-10-2006, 08:20 AM   #4
Registered User
 
Join Date: Jan 2005
Location: Estonia
Posts: 131
Here's a solution for you problem.
Have fun

http://cboard.cprogramming.com/annou...t.php?f=3&a=39
hardi is offline   Reply With Quote
Old 12-10-2006, 08:30 AM   #5
Registered User
 
Join Date: Dec 2006
Posts: 4
input
Code:
Quote:
Originally Posted by hardi
Here's a solution for you problem. Have fun :) http://cboard.cprogramming.com/annou...t.php?f=3&a=39
pls help me
death_messiah12 is offline   Reply With Quote
Old 12-10-2006, 08:39 AM   #6
Registered User
 
Join Date: Jan 2005
Location: Estonia
Posts: 131
Define: repair

Define the problem itself
hardi is offline   Reply With Quote
Old 12-10-2006, 08:44 AM   #7
Registered User
 
Join Date: Jan 2005
Location: Estonia
Posts: 131
I would help you if you first tell me the problem description and the algorithm that the game is based on and the constraints on the program itself.
hardi is offline   Reply With Quote
Old 12-11-2006, 12:37 AM   #8
System.out.println("");
 
Join Date: Jan 2005
Posts: 84
I pasted your code and it doesn't even compile.
Loctan is offline   Reply With Quote
Old 12-11-2006, 12:48 AM   #9
System.out.println("");
 
Join Date: Jan 2005
Posts: 84
After looking through it, you need to start over IMO. You are using goto statements, have random braces and this isn't even C++. It's C.

I will be up late tonight so if you want to post your requirements I can try to help you through it with any questions you have so you can get it done, but I won't do it all for you.
Loctan is offline   Reply With Quote
Old 12-11-2006, 02:40 AM   #10
In the Land of Diddly-Doo
 
g4j31a5's Avatar
 
Join Date: Jul 2006
Posts: 373
A little OOT actually, but please repair your indentation. It's painful for the eyes.

The text mode cursor positioning with gotoxy isn't available in in C++. You have to make your own assembly routines for this. You should look at this link:

http://p2p.wrox.com/topic.asp?TOPIC_ID=435
g4j31a5 is offline   Reply With Quote
Old 12-11-2006, 05:15 AM   #11
Its hard... But im here
 
swgh's Avatar
 
Join Date: Apr 2005
Location: England
Posts: 1,466
I suggest making several structures ( since you know C ) and try to bind several peices of data together of the same type. Like above, indent to a min of three spaces each time.
__________________
I'm just trying to be a better person - My Name Is Earl
swgh is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with my program... Noah C Programming 2 03-11-2006 07:49 PM
newbie here.. pls help me in this program! rothj0hn C Programming 2 02-01-2006 10:40 PM
Pls debug my scroll program Raison Windows Programming 7 06-02-2004 07:30 PM
Please could someone help me with my 8-function calculator program? Geeth Asokan C Programming 2 05-10-2002 04:16 PM
My program, anyhelp @licomb C Programming 14 08-14-2001 10:04 PM


All times are GMT -6. The time now is 02:02 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22