Cout...invisible to the user

This is a discussion on Cout...invisible to the user within the C++ Programming forums, part of the General Programming Boards category; I'm programming BlackJack. I'm using srand(time(0)) to generate numbers from 2-52....one number for each card in the deck. I want ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    12

    Lightbulb Cout...invisible to the user

    I'm programming BlackJack. I'm using srand(time(0)) to generate numbers from 2-52....one number for each card in the deck. I want to change the output that the user sees from #'s 2-52... to 1-10, Jack, Queen, King, and Ace. Is there an easier way of doing this rather than assigning as such 11=Jack .... 12=Queen, etc. Thanks for any help.

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    Code:
    char picturecards[4][] = { "Jack","Queen","King","Ace" };
    printf("Card: %s",picturecards[cardNumber-11]);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie Help: Currency Converter
    By Ashfury in forum C Programming
    Replies: 10
    Last Post: 11-06-2005, 01:21 PM
  2. Homework due tonight! help please!!
    By Andy717 in forum C++ Programming
    Replies: 41
    Last Post: 04-07-2005, 02:18 PM
  3. calculating user time and time elapsed
    By Neildadon in forum C++ Programming
    Replies: 0
    Last Post: 02-10-2003, 06:00 PM
  4. How to let the user input values for an array...
    By TerranAce007 in forum C++ Programming
    Replies: 2
    Last Post: 08-24-2002, 04:54 AM

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