User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 426,907 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,327 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 1618 | Replies: 1
Reply
Join Date: Mar 2005
Location: US
Posts: 1
Reputation: DarkrShadeOfBlu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
DarkrShadeOfBlu DarkrShadeOfBlu is offline Offline
Newbie Poster

Trouble with pointers in card game.

  #1  
Mar 20th, 2005
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, 14 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: Devon - UK
Posts: 420
Reputation: 1o0oBhP is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
1o0oBhP's Avatar
1o0oBhP 1o0oBhP is offline Offline
Posting Pro in Training

Re: Trouble with pointers in card game.

  #2  
Mar 20th, 2005
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?
http://sales.carina-e.com

no www
no nonsense

coming soon to a pc near you! :cool:
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 11:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC