Results 1 to 30 of 35

Thread: What is wrong with this code (C++)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Dragonslayer Emeritus Senior Member Sigurd's Avatar
    Join Date
    Nov 2002
    Location
    Norge
    Posts
    6,877

    Default Re: What is wrong with this code (C++)

    I am not sure what you are trying to do here doc...
    but if you want a hotfix:

    {

    #define EASY_LEVEL 1
    #define MEDIUM_LEVEL 2
    #define HARD_LEVEL 3
    #define END 4

    int Option;
    bool Word_Complete = false;

    std::cout<< "Game intructions\n";
    std::cout<< "Please select a difficulty level\n";
    std::cout<< "1=Easy\n";
    std::cout<< "2=Medium\n";
    std::cout<< "3=Hard\n";


    do
    {
    std::cin>> Option;

    if (Option == EASY_LEVEL)
    {
    std::cout<< "Display scambled word Easy\n";
    Word_Complete = true;
    }

    else if (Option == MEDIUM_LEVEL)
    {
    std::cout<< "Display scambled word Medium\n";
    Word_Complete = true;
    }

    else if (Option == HARD_LEVEL)
    {
    std::cout<< "Display scambled word Hard\n";
    Word_Complete = true;
    }

    else
    {
    return 0;
    }
    }
    while (Option != END);
    }
    Last edited by Sigurd; 11-22-2006 at 22:58.
    Status Emeritus

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO