954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Trouble with pointers in card game.

I'm writing a blackjack program for class and I am having a problem with Aces, jack, queens, kings, my random number generator generates a 1, 11, 12, 13 for those cards, respectively... but Aces should be worth 11, jacks, queens, and kings, as 10, I have attatched my current code, this thing is due in a few hours, if anybody can be of any help I would appreciate it, the code is kinda messy, but not in bad shape.

Attachments blackjack.c (6.66KB)
DarkrShadeOfBlu
Newbie Poster
1 post since Mar 2005
Reputation Points: 11
Solved Threads: 0
 

What exact problem are you having at the moment with it? If you generate random numbers 1 - 13 to generate random cards all you need to do is have a seperate fields to store the value and the ID in. Initially set ID to the random number to identify the card then modify the value to whatever you like. It seems faily black-and-white to me...

with regards to your code the value calculations seem to satisfy the above so where is the problem?

1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You