CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Help: TurboC++

  1. #1
    Join Date
    Aug 2009
    Posts
    2

    Help: TurboC++

    Hello people,

    I am doing a school assignment on LED memory game. Example:

    Led 1 light up, the person has to enter A for the answer.

    The part that I don't know how to make is this.

    When Led1 follow by Led3 follow by Led3 light up, the person has to type in A follow by C then C. I don't know how to make the program telling the person is incorrect if the person press A then B and finally C which is wrong for the second answer.

    Can someone enlighten me with guide site? Or anything?

    thank you.

  2. #2
    Join Date
    Aug 2009
    Posts
    2

    Re: Help: TurboC++

    for the game part is something like this. The Led blinks follow by the person entering the key then the program telling the person right/wrong. Sorry for the late reply. And thank for the reply.

    Note: frequency of sound is not properly set yet.


    Game2:
    {
    putc((char)8,stdprn); //display LEDs 00100000
    delay(300);//300ms
    putc((char)0,stdprn); //all LEDs off 00000000
    delay(300);//300ms
    putc((char)4,stdprn); //display LEDs 00000001
    delay(300);//300ms
    putc((char)0,stdprn); //all LEDs off 00000000
    delay(300);//300ms
    putc((char)8,stdprn); //display LEDs 00010000
    delay(300);//300ms
    putc((char)0,stdprn); //all LEDs off 00000000
    delay(300);//300ms

    printf("\nWhich 3 Leds light up? in sequence:");
    scanf("%s",&data);
    if (data=='C'||data=='c') <--- first key right, how about telling the person second key and third is right?
    {
    printf("\n you are so smart");
    {
    sound(500);
    delay(500);
    sound(500);
    delay(500);
    sound(500);
    delay(500);
    sound(500);
    delay(500);
    nosound();

    }
    }
    else if (data!='C' || data!='c'); <-- first key wrong. how about telling the person second and third key wrong?
    {
    printf("\nYour memory fail!");
    {
    sound(500);
    delay(500);
    sound(500);
    delay(500);
    sound(500);
    delay(500);
    sound(500);
    delay(500);
    nosound();
    }
    }

    printf("\nPress Y to go next level, N to play again");
    printf("\nTo quit press Q");
    scanf("%s",&data);

  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Help: TurboC++

    1) You will not get answers on Turbo C++ in a Visual C++ forum. Your code is proprietary to Turbo C++. It is neither compatible with Visual C++, and I bet none of those calls are compatible with the Windows OS.

    2) Why are you using such an outdated, old compiler such as Turbo C++? The compiler is almost 20 years old, therefore does not reflect the current C++ language.

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured