How to put invisible characters

This is a discussion on How to put invisible characters within the C++ Programming forums, part of the General Programming Boards category; Hello ! im making my scissor,paper and rock game on c++ program . I need to replace scanf to enter ...

  1. #1
    Registered User
    Join Date
    Sep 2011
    Location
    Muntinlupa City
    Posts
    15

    How to put invisible characters

    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();
    }

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    • This is C, you have posted in the C++ forum. You should learn how to read.
    • I am willing to bet you are using Turbo C, get a new compiler; one that is standard and still supported
    • Look at: How to get input without hitting 'ENTER'-FAQ
    • You should also read all the other FAQs as your code is extremely poor.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    Registered User
    Join Date
    Sep 2011
    Location
    Muntinlupa City
    Posts
    15
    im sorry i dont know it is a turbo c , because in our class we are using turbo c++

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    1,625
    It's amusing how this compiler hangs in there even though it's dinosaur-old . I guess lack of options and brains make your teachers choose it. ( But don't tell them that )
    Since you're using TC++ in your class, and assuming that there's no way of making them see the light and dump it, get a new compiler and compile your code in both.
    Try to observe the differenses between the two. Remember that Turbo C/C++ outputs 16-bit programs, giving you 1MByte of RAM at most, which will not be supported in future OSs.
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Invisible Console
    By gavra in forum C Programming
    Replies: 6
    Last Post: 08-26-2008, 08:39 AM
  2. an invisible partition?
    By Queatrix in forum Tech Board
    Replies: 11
    Last Post: 12-11-2006, 04:10 PM
  3. invisible
    By achy1729 in forum Windows Programming
    Replies: 8
    Last Post: 09-19-2006, 05:18 AM
  4. Invisible window
    By krappykoder in forum Windows Programming
    Replies: 7
    Last Post: 10-16-2003, 08:52 PM
  5. Mr Invisible
    By Fordy in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 08-13-2001, 10:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21