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. #6
    Time Lord Member The_Doctor's Avatar
    Join Date
    Oct 2004
    Location
    The TARDIS
    Posts
    2,040

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

    I changed around some of it, and now it does not work. When you enter something and press enter it ends the program.

    #include <iostream.h>

    void main()
    {
    #define Easy_Level 1
    #define Medium_Level 2
    #define Hard_Level 3
    int Option;
    bool Word_Complete;

    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";
    std::cin>> Option;

    if (Option == Easy_Level) {
    do
    {cout<< "Display scambled word\n";
    Word_Complete = true;
    }
    while(Word_Complete = false);
    }

    if (Option == Medium_Level) {
    do
    {cout<< "Display scambled word\n";
    Word_Complete = true;
    }
    while(Word_Complete = false);
    }

    if (Option == Hard_Level) {
    do
    {cout<< "Display scambled word\n";
    Word_Complete = true;
    }
    while(Word_Complete = false);
    }

    return 0;
    }
    Last edited by The_Doctor; 11-22-2006 at 21:10.

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