#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Tallahassee
    Posts
    55
    Rep Power
    14

    Post Someone experienced to debug blackjack game code


    Hey all,
    I need someone quick and experienced to debug my code for me. I need to make a couple of more improvements on my code. This is a typical blackjackgame code and I am extending its functionality so that it shows the new and shuffled deck. The improvements that I want to make are as follows,

    Improvements:
    - The dealer's first card is hidden on the first hand until player's turn is over.
    Ex: The dealer's first card should be hidden as such
    [X X] [6 S]<-- any random card shown.

    - I need to be able to display the current hand of both dealer as well as player for up to ten cards.
    Please play around with my code and see what you can come up with.
    The code is attached in a .zip file and I warn you it is long. I've narrowed it down to either the process or init functions however if that'll help. I owe you my future career as a computer scientist if anyone can get this.
    Attached Files
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    how much are you paying?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Tallahassee
    Posts
    55
    Rep Power
    14
    You'll have my gratitude, isn't that enough?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    not for "owe you my future career as a computer scientist". ;)

    if you want to be a computer scientist, find your own way! Thatīs what science is about, no? Learn how it works (or should work)!

    honestly, if you canīt debug a blackjack game to show the deck...
    maybe in 5-10yrs you can call yourself a "computer scientist" (i bet it would take me less than 1hr right now, but i donīt consider myself being a "computer scientist" either!)

    sorry for the flaming, i wonīt bother you again.

    bye,
    M
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Tallahassee
    Posts
    55
    Rep Power
    14

    Plea


    If not as a future computer scientist, please help out a student in a cs course. I only had to take two days to do this and this is the last day to turn it in.
    I personally am proud of this achievement no matter what anyone says. But even the 'best programmers' run out of ideas every once in awhile. I urge you again to please help.
    It's not that I cannot solve this problem, my brain just cannot go on like this. Remember how much you struggled back in your programming classes and think of me. So as a personal favor to me.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    ok, you got me!

    i used to be a beginner too ;)

    do you want a modification to
    void display(int *player_player_total, int *player_dealer_total) //display players and dealers current hand

    or a completely new function?
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Tallahassee
    Posts
    55
    Rep Power
    14

    Thank you


    I want to build on my existing functions. Once again:
    - I need to mask the first card that the dealer has by saying [X X] [number suit] where number, suit is just the second card that the dealer got. I want to unmask it only after the player's turn is over.
    - I also need to store the current hand of both dealer and player up to ten cards(I know to place an array of player_card[10] and dealer_card[10]) but where?
    Thank you for your response M. Hirsch. I really do appreciate this.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    sorry that i canīt get into your code right now... (alc...)

    for the general approach:
    - use a variable, set it to "0" in your main function
    - set it to "1" after the player did his first move.
    - if it is after the first move (variable==1), display the first card of the deck.

    Code:
    void display(int *player_player_total, int *player_dealer_total) //display players and dealers current hand
    {// switch these variables on purpose
      cout<< "dealer shows " << names2[1] << " " << names2[2] << " value = "<< *player_player_total << endl;
      cout<< "player shows " << names2[3] << " " << names2[4] << " value = " << *player_dealer_total<<endl;
    }
    whatīs wrong with this?

    [comment]
    if this is actually to be solved till tomorrow, i probably canīt help... but if you have time till the "day after", iīll be gladly be back tomorrow.
    need to leave now for some action...
    [/comment]
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Tallahassee
    Posts
    55
    Rep Power
    14

    Unhappy Would someone please help


    This project is due today. Please would someone help me?? I know its something I am missing.

IMN logo majestic logo threadwatch logo seochat tools logo