Hello ! im making my scissor,paper and rock game on c++ program . I need to replace scanf to enter a invisible characters when other user is typing , can you say what
code it is ? thanks
my code:
Code:#include<stdio.h> #include<conio.h> main() { int a,b; clrscr(); printf("NOTE:s(scissor),p(paper),r(rock)"); printf("\nPLAYER 1 BEGINS:"); scanf("%s",&a); printf("\nPLAYER 2 turns:"); scanf("%s",&b); if (a=='s' && b=='p') printf("P1 WINS!"); else if (a=='p' && b=='r') printf("P1 WINS!"); else if (a=='r' && b=='s') printf("P1 WINS!"); else if (a=='p' && b=='s') printf("P2 WINS!"); else if (a=='s' && b=='r') printf("P2 WINS!"); else if (a=='s' && b=='r') printf("P2 WINS!"); else if (a=='s' && b=='s') printf("DRAW!"); else if (a=='p' && b=='p') printf("DRAW!"); else if (a=='r' && b=='r') printf("DRAW!"); else printf("YOU'RE OUT OF WORLD!"); } getch(); }



LinkBack URL
About LinkBacks





)