|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm writing a program that deals out a poker hand for my C++ programming class at school. It's not required that we use symbols; we can just use the words "spade," "heart," "diamond," and "club," but I want to display the actual symbols for these in the unix terminal, if that's possible. I know how to do it for a Windows machine, but is it possible in the Unix terminal? For a Windows command shell, you just have
char symbol = 0x03 for a heart, or char symbol = 0x04 for a diamond, etc... then cout << symbol. When I try to cout << symbol in my Linux console, it doesn't display anything. If anyone could help, I'd appreciate that. I don't expect an exact answer, maybe someone could just point me in the right direction... |
|
|||
|
You have to find the Unicode codes for those symbols and print the corresponding codes. Assuming your terminal is Unicode capable.
|
|
|||
|
Well I did find out that a simple copy and paste into emacs works. I have:
cout << ♠ ♣ ♥ ♦; I didn't find out about the unicode yet, but I'll get to that. |
|
|||
|
You are probably already using the Unicode in there. Cut and paste is perfectly valid way to solve this problem since you only need to output those symbols, not know the exact value of the codes.
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|