Thread: lol can some one help me with this code

  1. #1
    Registered User Joe100's Avatar
    Join Date
    Jul 2003
    Posts
    63

    Unhappy lol can some one help me with this code

    plz help me straighten out this code o and if possible can you help me and give me some ideas
    __________________________________________________ _
    #include <iostream.h>
    #include <conio.h>
    #include <stdio.h>
    using namespace std;
    int main()
    {
    char name [100];
    int typeclass
    void drawmenu()
    cout << "\t\t /************Start Menu***********\ \n";
    cout << "\t\t * * \n";
    cout << "\t\t * 1.start game * \n";
    cout << "\t\t * 2.save game * \n";
    cout << "\t\t * 3.load game * \n";
    cout << "\t\t * * \n";
    cout << "\t\t * * \n";
    cout << "\t\t \*******************************/ \n";
    }
    void main()
    {
    intchoice=0
    while(stillplaying)
    }
    switch(choice)
    {
    case 1: cout << "you chose start game! \n";
    break
    case 2: cout << "you chose save game! \n";
    break
    case 3: cout << "you chose load game! \n";
    break
    }
    cout << "Please enter you character name \n"
    cin.get(name,100,'\n';
    cout << "welcome to hades"<<name<<"\n";
    cout << "please choose a character class \n";
    {
    cout << \t\t /***********Character classes***********\ \n";
    cout << \t\t * * \n";
    cout << \t\t * 1.archer * \n";
    cout << \t\t * 2.fighter * \n";
    cout << \t\t * 3.magician * \n";
    cout << \t\t * * \n";
    cout << \t\t \************************************/ \n";
    }
    int typeclass
    case 1: cout << "you chose the archer class \n";
    case 2: cout << "you chose the fighter class \n";
    case 3: cout << "you chose the magician class \n";
    cin >> choice;
    cout << "thank you for choosing"<<choice<<"\n";
    {
    _________________________________________________

  2. #2
    Registered User Joe100's Avatar
    Join Date
    Jul 2003
    Posts
    63
    ahhhhhhhhhhhhh sorry bout this u guys the starts r supposed to be lined up o well thats really it give me some feedback on this crapy half ass text game

  3. #3
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Use [code][/code] tags when posting code.
    Away.

  4. #4
    ‡ †hë Ö†hÈr sîÐè ‡ Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    1st and very inportant use code tags //pls see the very first post on all forms

    now your code.
    what are you trying to do?
    where do you think your problems are?

    if its not having problems then what are you asking.
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

  5. #5
    Registered User Joe100's Avatar
    Join Date
    Jul 2003
    Posts
    63
    i dunno its just keeps saying

    cannot sepcify -o with -c and multiple compilations

    now wtf is that
    then it says

    there were some errors

  6. #6
    Registered User
    Join Date
    Jul 2003
    Posts
    1
    There are more errors (missing semicolons, missing brackets, missing quotes) than I can possibly point out.

    Go back and get the syntax right.

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>cannot sepcify -o with -c and multiple compilations
    Try something like:

    >gcc mysource.c -omyprog.exe
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  8. #8
    Registered User Joe100's Avatar
    Join Date
    Jul 2003
    Posts
    63
    but what do u mean by that do u want me to actualy put it in my code if so were and were all the missing brackets and semi colons can some plz help me fix this cuz if its true what ur saying then i messed up big time

  9. #9
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    I am presuming you saw this error from your compiler:
    >>cannot sepcify -o with -c and multiple compilations

    Depending on your compiler, that could mean:
    The -o flag denotes the output filename for the .exe file.
    The -c flag denotes a compile only (where no .exe file is created).
    Meaning that the two options are not allowed to be used together, especially when compiling multiple source files.

    So, are you able to compile or not?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  10. #10
    Registered User Joe100's Avatar
    Join Date
    Jul 2003
    Posts
    63
    i dont know anymore ive been able to make tiny little programs but i just dunno anyways my friend will help me if he gets over here he said that ment there were to many erros for it to show and im running on DJGPP

  11. #11
    ‡ †hë Ö†hÈr sîÐè ‡ Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    you need a better compiler. having to enter comand lines can make it hard for someone new.

    try dev-c++
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

  12. #12
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    it's not a command line compiler. I'm the "friend" that's helping him (notice the names). I pm'ed him the code, so all is well. Though I do have to say that his code was one of the worst I've ever seen
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  13. #13
    Registered User Ace Bowers's Avatar
    Join Date
    Jul 2003
    Posts
    23
    Sorry if this is too completely off topic, and the fact that I'm bringing up a 5 day old post; but, Stan, isn't your avatar the same as the bomb used in Zelda- a link to the past for SNES (I have the game from like 5 years ago), just thinking (now I need an asprin ).
    "I have read about a hill in a book, so the hill must exist." -a Christian quote
    "I have not seen this hill, so it must not exist." -an Athiest quote
    "Well, I've heard of this hill, so lets bomb it." -a George Bush quote

  14. #14
    Registered User
    Join Date
    Jul 2003
    Posts
    17
    I went through your buggy and messy code and corrected it.
    I also noticed that the player classes looked similar to Hexen. If you are trying to do a remake, it was cleric not archer.

    Here is the redone code.

    Code:
    #include <iostream>
    #include <stdlib.h>
    #include <windows.h>
    using namespace std;
    
    void drawmenu()
    
    {
    
        cout <<"\t\t /************Start Menu***********\\ \n";
        cout <<"\t\t * * \n";
        cout <<"\t\t * 1.start game * \n";
        cout <<"\t\t * 2.save game * \n";
        cout <<"\t\t * 3.load game * \n";
        cout <<"\t\t * * \n";
        cout <<"\t\t * * \n";
        cout <<"\t\t \\*******************************/ \n";
    
    }
    
    int main()
    
    {
    
        int num;
    
        char name[100];
    
        cout<<"Please enter your name.\n";
    
        cin.get(name,100);
    
        drawmenu();
    
        int choice;
    
        cin>>choice;
    
        switch(choice)
    
        {
    
             case 1: cout <<"you chose start game! \n";
    
             break;
    
             case 2: cout <<"you chose save game! \n";
    
             break;
    
             case 3: cout <<"you chose load game! \n";
    
             break;
    
             default: exit(0);
    
             break;
    
        }
    
        cout <<"Please enter you character name \n";
    
        cout <<"Welcome to hades "<<name<<"\n";
               
        cout <<"Please choose a character class \n";
    
        cout<< "This is case sensitive.\n";
    
        cout <<" \t\t /***********Character classes***********\\ \n";
        cout <<" \t\t * * \n";
        cout <<" \t\t * 1. archer * \n";
        cout <<" \t\t * 2. fighter * \n";
        cout <<" \t\t * 3. magician * \n";
        cout <<" \t\t * * \n";
        cout <<" \t\t \\************************************/ \n";
    
        cin>>num;
           
        switch(num)
    
        {
    
             case 1:
    
             cout<<"You chose the archer class.\n";
    
             break;
    
             case 2:
    
             cout<<"You chose the fighter class.\n";
    
             break;
    
             case 3:
    
             cout<<"You chose the magician class.\n";
    
             break;
    
             default: exit(0);
    
        }
    
        Sleep(5000);
    
        system("pause");
    
        return 0;
    
    }
    Edit::This can only be compiled on Windows compilers.
    Last edited by Eric08; 07-21-2003 at 02:34 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  2. lol need some help :D
    By lolol in forum C Programming
    Replies: 28
    Last Post: 03-28-2008, 07:46 AM
  3. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 10:20 AM
  4. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM