C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 23rd, 2002, 01:53 PM
supaben34 supaben34 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Tallahassee
Posts: 55 supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 57 m 51 sec
Reputation Power: 8
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
File Type: zip blackjack.zip (4.3 KB, 531 views)

Reply With Quote
  #2  
Old November 23rd, 2002, 03:56 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
how much are you paying?
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old November 23rd, 2002, 03:59 PM
supaben34 supaben34 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Tallahassee
Posts: 55 supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 57 m 51 sec
Reputation Power: 8
You'll have my gratitude, isn't that enough?

Reply With Quote
  #4  
Old November 23rd, 2002, 04:07 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
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

Reply With Quote
  #5  
Old November 23rd, 2002, 04:41 PM
supaben34 supaben34 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Tallahassee
Posts: 55 supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 57 m 51 sec
Reputation Power: 8
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.

Reply With Quote
  #6  
Old November 23rd, 2002, 04:48 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
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?

Reply With Quote
  #7  
Old November 23rd, 2002, 05:09 PM
supaben34 supaben34 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Tallahassee
Posts: 55 supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 57 m 51 sec
Reputation Power: 8
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.

Reply With Quote
  #8  
Old November 23rd, 2002, 05:16 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
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]

Reply With Quote
  #9  
Old November 23rd, 2002, 05:33 PM
supaben34 supaben34 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Tallahassee
Posts: 55 supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level)supaben34 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 57 m 51 sec
Reputation Power: 8
Unhappy Would someone please help

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Someone experienced to debug blackjack game code


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway