![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: May 2008
Posts: 1
OS: vista
|
Need getting started with program
Hello and thankyou in advance for any help you provide. I have been sitting figuring out how to start with what functions to write this program. I know it will probably be easy for a lot of you, so any help will greatly be apperciated. Im using microsoft visual c++6, the program dosent have to include any gui just plain old dos window programming.
Here are the specs You are the programmer at a casino in Atlantic City. You have been tasked to develop a computer program that can play Ace-High, a card game similar to, but simpler than, Blackjack. The rules and procedures are as follows: 1. Cards have their standard values (a numerical card has its numerical value in the range of two to ten and face cards all have a value of ten), except that aces always have a value of eleven. 2. The deck of cards will be implemented as a Boolean array of 52 "cards," where an individual card will be considered true if it is in the deck and false if it has already been drawn. The program will start with a "full deck." Each time a card is drawn, that location will be marked false. 3. The program begins by printing a suitable welcome message. 4. The player always draws first and always draws two cards initially. If the player "busts," that is, if the combined value of the player's two cards exceeds 21, then the player loses, the dealer does not draw, and the game is over. 5. The dealer (computer) draws second. The dealer draws two cards initially. If the total of the two cards is less than 17, the dealer then "hits" (draws another card) until the total of her or his cards is greater than or equal to 17. If the dealer "busts," then the player wins and the game is over. 6. If no one has busted at this point, whoever has the higher total wins, and the game is over. However, if at this point the dealer and player are tied, this forces a playoff in which both the dealer and player each draw a single card. If the dealer's card is higher, the dealer wins; if the player's card is higher, the player wins; and if the dealer's and player's cards are equal, then the playoff is repeated (i.e., each draws another card) until either the dealer or player wins. 7. The program displays as much of this information as is pertinent to the hand: a. The value of each of the player's initial two cards and their total value; b. The value of each of the dealer's initial two cards and their total value; c. The value of the player's card(s) during a playoff; d. The value of the dealer's card(s) during a playoff; e. A statement declaring whether the player or dealer is the winner. 8. After the winner has been determined, the program asks if another game should be played. An answer of "y" or "Y" starts another game; any other answer terminates the game. If the user wants to play again, the deck is reset to a "full" deck. Number |Card Number |Card Number |Card Number |Card 0 2S 13 2H 26 2C 39 2D 1 3S 14 3H 27 3C 40 3D 2 4S 15 4H 28 4C 41 4D 3 5S 16 5H 29 5C 42 5D 4 6S 17 6H 30 6C 43 6D 5 7S 18 7H 31 7C 44 7D 6 8S 19 8H 32 8C 45 8D 7 9S 20 9H 33 9C 46 9D 8 10S 21 10H 34 10C 47 10D 9 JS 22 JH 35 JC 48 JD 10 QS 23 QH 36 QC 49 QD 11 KS 24 KH 37 KC 50 KD 12 AS 25 AH 38 AC 51 AD Sample Executions: WELCOME TO THE ACE-HIGH GAME Player draws AC and AH, total 22. Dealer wins. Play again (y or n)? y WELCOME TO THE ACE-HIGH GAME Player draws 8S and JC, total 18. Dealer draws 9D and AS, total 20. Dealer wins. Play again (y or n)? y WELCOME TO THE ACE-HIGH GAME Player draws 88 and 9C, total 17. Dealer draws JD and 7H, total 17. TIE -- PLAYOFF ROUND Player draws 98. Dealer draws 7D. Player wins. Play again (y or n)? y WELCOME TO THE ACE-HIGH GAME Player draws KD and QH, total 20. Dealer draws 5H and 6D, total 11. Dealer draws 58, total 16. Dealer draws 9H, total 25. Player wins. Play again (y or n)? y WELCOME TO THE ACE-HIGH GAME Player draws 9C and KH, total 19. Dealer draws A8 and 2D, total 13. Dealer draws 2H, total 15. Dealer draws 4C, total 19. TIE -- PLAYOFF ROUND Player draws 5H. Dealer draws 5C. TIE -- PLAYOFF ROUND Player draws 98. Dealer draws QH. Dealer wins. Play again (y or n)? x WELCOME TO THE ACE-HIGH GAME Player draws 7C and 4H, total 11. Dealer draws 5D and 9C, total 16. Dealer draws 2H, total 18. Dealer wins. Play again (y or n)? y |
|
|
|
|
|
#2 (permalink) |
|
TSF Enthusiast
Join Date: Jul 2007
Location: Northampton, UK
Posts: 914
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)
|
Re: Need getting started with program
hey i don't understand what the question is?
we need some code or we cant help you... Oh and you wont find someone writing a program for you... i'm pretty sure it's in the forum rules... and it's an effort... post some codeee... Cheers, Jamey |
|
|
|
![]() |
| Thread Tools | |
|
|