473,382 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Playing card suits, vb.net?

Another newbie question. I'm writing a program that reviews a text
file history of an online poker hand.

I'm using VB compact framework, for a pocket pc.

I'm trying to find a simple way to represent the suits of cards,
clubs, diamonds, spades, hearts, in a string. I thought for sure there
would be some sort of ASCII symbol that I could just use in a string,
but I haven't found anything.

Is there a simple way to do this that I am missing?

Thanks for any help.

eejit
Apr 7 '06 #1
4 5471
Hi,

Maybe there is something the card game starter kit to help.

http://msdn.microsoft.com/vbasic/dow...s/default.aspx

Ken
----------------
"eejit" <ee***@canada.com> wrote in message
news:7g********************************@4ax.com...
Another newbie question. I'm writing a program that reviews a text
file history of an online poker hand.

I'm using VB compact framework, for a pocket pc.

I'm trying to find a simple way to represent the suits of cards,
clubs, diamonds, spades, hearts, in a string. I thought for sure there
would be some sort of ASCII symbol that I could just use in a string,
but I haven't found anything.

Is there a simple way to do this that I am missing?

Thanks for any help.

eejit

Apr 7 '06 #2
eejit wrote:
Another newbie question. I'm writing a program that reviews a text
file history of an online poker hand.

I'm using VB compact framework, for a pocket pc.

I'm trying to find a simple way to represent the suits of cards,
clubs, diamonds, spades, hearts, in a string. I thought for sure there
would be some sort of ASCII symbol that I could just use in a string,
but I haven't found anything.

Is there a simple way to do this that I am missing?

Thanks for any help.

eejit


The suits are in the Arial font. Open up charmap (start->run->charmap)
and you'll see them if you scroll down (U+2660 it tells me in the status
line of charmap).
--
Rinze van Huizen
C-Services Holland b.v
Apr 7 '06 #3
> > I'm trying to find a simple way to represent the suits of cards,
clubs, diamonds, spades, hearts, in a string. I thought for sure there
would be some sort of ASCII symbol that I could just use in a string,
but I haven't found anything.


Public Const chSpade As Char = ChrW(9824)
Public Const chHeart As Char = ChrW(9829)
Public Const chDiamond As Char = ChrW(9830)
Public Const chClub As Char = ChrW(9827)

Use these just like any other string, eg "A" & chSpade gives "Aâ™*". These
are the correct values, but not all fonts cooperate.

This is unicode, not ascii, where a character in a string is 16 bits (not
8). Unicode is the default for basic, so you don't have to do anything
special to call ChrW() with big numbers.

If you need to print, your printer may not be capable of representing these
characters, so you may need a fallback, maybe s,h,d,c. '8s 8c As Jd 2h'
doesn't look too bad.
Apr 7 '06 #4
On Fri, 7 Apr 2006 06:39:01 -0700, AMercer
<AM*****@discussions.microsoft.com> wrote:
> I'm trying to find a simple way to represent the suits of cards,
> clubs, diamonds, spades, hearts, in a string. I thought for sure there
> would be some sort of ASCII symbol that I could just use in a string,
> but I haven't found anything.


Public Const chSpade As Char = ChrW(9824)
Public Const chHeart As Char = ChrW(9829)
Public Const chDiamond As Char = ChrW(9830)
Public Const chClub As Char = ChrW(9827)

Use these just like any other string, eg "A" & chSpade gives "A?". These
are the correct values, but not all fonts cooperate.

This is unicode, not ascii, where a character in a string is 16 bits (not
8). Unicode is the default for basic, so you don't have to do anything
special to call ChrW() with big numbers.

If you need to print, your printer may not be capable of representing these
characters, so you may need a fallback, maybe s,h,d,c. '8s 8c As Jd 2h'
doesn't look too bad.

Thanks to everyone for taking the time to reply.

I decided to go with the arial font chrw(9824) method. I tested it out
in vb and it works, but for some reason when I try it using the
compact framework, arial font, instead of the playing card suit, I get
a square. So I'm not quite sure what is going on here.

thanks again for the help.

eejit
Apr 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian Basquille | last post by:
Hello all, What is the syntax for simply playing a WAV file in your program? Am learning VB and have two VB books but don't wanna root through them to find the code. Any help would be much...
23
by: JC | last post by:
I am very new to programming and learning on my own. Why do I keep getting duplicate values using this code? I want to shuffle a deck of 52 cards. The logic seems right to me. Randomize For...
0
by: pdorn | last post by:
Hi: I have been trying to create an eight deck card "shoe" (as used in casino games such as Blackjack and Baccarat), but have run into some problems. I do not have much programming experience, and so...
1
by: prince99 | last post by:
Implement a class that represents a playing card. The class should implement the following methods: __init__ ( self, rank, suit ) Creates a card. rank is an integer in the range of 1 to 13 (Ace:1,...
3
by: prince99 | last post by:
Write a program that creates a list of card objects and prints out the cards grouped by suit and in rank order within each suit. The program should read the values for the list of cards from a file,...
6
by: JNeko | last post by:
Hello all, awesome site! I guess I am technically not a beginner in JAVA, but from my code you would not realize it! I don’t expect anyone to help me with this, but I figure I might as well as try...
3
by: noob2008 | last post by:
this code works but theres a problem wif it. wen it generates for 4 players, it has repeated values i.e 2 of diamond appear twice. how do i avoid this? and i hav no idea how to program the...
8
mia023
by: mia023 | last post by:
hello there i have trouble understanding this assignment so can any one explain it to me. Joe Optimist makes the following claim “If we draw three cards randomly from a standard 52-card deck,...
5
by: slither101 | last post by:
Hi, I have been working on this project for about three days now, and seem to be stuck on my conditional statements that specify the face and suit of the card when it is a Jack, Queen, King and Ace....
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.