Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How can I get the card symbols like Hearts and Clubs?

FazFaz Posts: 75Member
I have made a card game in C++ and I stumbled across a set of symbols at run-time. I realised why, I had an array of 5 integers and the program was trying to retrieve the data from the 6th variable, which it shouldn't have done! I've fixed the problem now, but it was pointing to a set of symbols, which came from the location directly after the array, which could have been anything!

Anyway, these symbols that were appearing were conveniently exactly what I was after. I need the 4 symbols in a pack of cards, Clubs, Spades, Diamonds, and Hearts.

I was rather hoping it would be something simple like "s" for spades perhaps, like new line is "
".

Can someone please help me find these symbols?

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    [b][red]This message was edited by stober at 2006-5-31 6:7:8[/red][/b][hr]
    you might search these web pages

    http://www.google.com/search?hl=en&lr=&q=playing+card+graphics&btnG=Search

    or you might install a new font that has them as replacement for some characters in the normal ascii character set.



  • LundinLundin Posts: 3,711Member
    : I have made a card game in C++ and I stumbled across a set of symbols at run-time. I realised why, I had an array of 5 integers and the program was trying to retrieve the data from the 6th variable, which it shouldn't have done! I've fixed the problem now, but it was pointing to a set of symbols, which came from the location directly after the array, which could have been anything!
    :
    : Anyway, these symbols that were appearing were conveniently exactly what I was after. I need the 4 symbols in a pack of cards, Clubs, Spades, Diamonds, and Hearts.
    :
    : I was rather hoping it would be something simple like "s" for spades perhaps, like new line is "
    ".
    :
    : Can someone please help me find these symbols?
    :


    They usually place them on top of the ASCII table, 0 to 32, which is reserved for non-printable symbols. However, the symbols are not standard, so they may vary on different systems. Here is a simple program to check what symbols are stored there on your system:

    [code]
    #include

    int main()
    {
    int i;
    for(i=0; i<32; i++)
    printf("%d: %c
    ", i, i);
    getchar();
    return 0;
    }
    [/code]

    Expect a beep at 7 and a linefeed at 10 :)

    The symbols you are looking for are most likely:

    3 hearts
    4 diamonds
    5 clubs
    6 spades

    meaning you could print them in strings as

    'x03'
    'x04'
    'x05'
    'x06'

    (note that these are hex values, not decimal)
  • FazFaz Posts: 75Member
    : : I have made a card game in C++ and I stumbled across a set of symbols at run-time. I realised why, I had an array of 5 integers and the program was trying to retrieve the data from the 6th variable, which it shouldn't have done! I've fixed the problem now, but it was pointing to a set of symbols, which came from the location directly after the array, which could have been anything!
    : :
    : : Anyway, these symbols that were appearing were conveniently exactly what I was after. I need the 4 symbols in a pack of cards, Clubs, Spades, Diamonds, and Hearts.
    : :
    : : I was rather hoping it would be something simple like "s" for spades perhaps, like new line is "
    ".
    : :
    : : Can someone please help me find these symbols?
    : :
    :
    :
    : They usually place them on top of the ASCII table, 0 to 32, which is reserved for non-printable symbols. However, the symbols are not standard, so they may vary on different systems. Here is a simple program to check what symbols are stored there on your system:
    :
    : [code]
    : #include
    :
    : int main()
    : {
    : int i;
    : for(i=0; i<32; i++)
    : printf("%d: %c
    ", i, i);
    : getchar();
    : return 0;
    : }
    : [/code]
    :
    : Expect a beep at 7 and a linefeed at 10 :)
    :
    : The symbols you are looking for are most likely:
    :
    : 3 hearts
    : 4 diamonds
    : 5 clubs
    : 6 spades
    :
    : meaning you could print them in strings as
    :
    : 'x03'
    : 'x04'
    : 'x05'
    : 'x06'
    :
    : (note that these are hex values, not decimal)
    :

    Excellent, thanks.
Sign In or Register to comment.