Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I tried -_-"
#1
Reply
#2
The problem is that you didn't use a new deck of card each time during the new game.

so your takeCard function will repeatly generate the numbers that's already taken (control=0)
Reply
#3
Reply
#4
Reply
#5
Horusmaster Wrote:and after that cards[iRandomNum]=0 meaning you mark that number=0, after a few rounds all 52 cards are taken. So your program will go through an infinite loop of trying to generate a number that's not taken, but it never will.

and also, the player will never lose because this will never happen:
if(dealerHand <= 21 && dealerHand> 21)

WOOPS LMAO. I mean to make it
if(dealerHand <= 21 && dealerHand> hand)

I'm glad you caught that XD

Edit- It's actually just C, not C++
Reply
#6
Reply
#7
we never got to learning about object
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)