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?
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.
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);
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.
Bookmarks