| | |
Trouble with pointers in card game.
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2005
Posts: 1
Reputation:
Solved Threads: 0
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.
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?
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:
no www
no nonsense
coming soon to a pc near you! :cool:
![]() |
Similar Threads
- PythonFC card game max 4 packs? (Python)
- C++ card game war (C++)
- card game: just need to know why its not compiling... (C++)
- Making War card game (C)
- card game (Java)
- Card Game (Java)
Other Threads in the C Forum
- Previous Thread: help me(PIPES)
- Next Thread: Program security (When Launched)
Views: 2157 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o inches infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape socketprograming spoonfeeding stack standard strchr string strings structures student suggestions system systemcall test testautomation unix user voidmain() wab win32 win32api windows.h





