Pls repair my basketball program

This is a discussion on Pls repair my basketball program within the C++ Programming forums, part of the General Programming Boards category; insert Code: [/color]can anyone repair my basketball program?? i just want to make it's output: this is my basketball program... ...

  1. #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();
    }

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    4
    plsss
    i need it for tom

  3. #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....

  4. #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

  5. #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

  6. #6
    Registered User
    Join Date
    Jan 2005
    Location
    Estonia
    Posts
    131
    Define: repair

    Define the problem itself

  7. #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.

  8. #8
    System.out.println("");
    Join Date
    Jan 2005
    Posts
    84
    I pasted your code and it doesn't even compile.

  9. #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.

  10. #10
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    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

  11. #11
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  2. newbie here.. pls help me in this program!
    By rothj0hn in forum C Programming
    Replies: 2
    Last Post: 02-01-2006, 10:40 PM
  3. Pls debug my scroll program
    By Raison in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2004, 08:30 PM
  4. Replies: 2
    Last Post: 05-10-2002, 05:16 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

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