944,116 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 2741
  • C RSS
Mar 20th, 2005
1

Trouble with pointers in card game.

Expand Post »
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.
Attached Files
File Type: c blackjack.c (6.7 KB, 73 views)
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
DarkrShadeOfBlu is offline Offline
1 posts
since Mar 2005
Mar 20th, 2005
0

Re: Trouble with pointers in card game.

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?
Reputation Points: 16
Solved Threads: 6
Posting Pro in Training
1o0oBhP is offline Offline
445 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: help me(PIPES)
Next Thread in C Forum Timeline: Program security (When Launched)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC