473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Please help me with blackjack program!!

3
Hello everybody,
I know I'm really new to the site, but I really need your help. I've been developing a blackjack game over the last few days and I'm a bit stuck know.

If you guys could help me with a few things:
1. For some reason, the game never allows you to win. I've checked my program multiple times, but I can't figure out why.
2. Whenever I try to print the sum functions, I always get this odd message. Something like, "Instance of function at x93483".
3. If you could help me make a running chip count through the program that also would be amazing.

I've really worked very hard so far and I really just need this last bit of help!!

Thank you!!

Expand|Select|Wrap|Line Numbers
  1. import random
  2. class Card:
  3.     def __init__(self, suit, rank, value):
  4.         self.rank = rank
  5.         self.suit = suit
  6.         self.value= value
  7.         if self.rank == 1:
  8.             self.rank = "Ace"
  9.             self.value = 11
  10.         elif self.rank == 11:
  11.             self.rank = "Jack"
  12.             self.value = 10
  13.         elif self.rank == 12:
  14.             self.rank = "Queen"
  15.             self.value = 10
  16.         elif self.rank == 13:
  17.             self.rank = "King"
  18.             self.value = 10
  19.         elif 2 <= self.rank <= 10:
  20.             self.value = self.rank
  21.             self.rank = str(self.rank)
  22.         if self.suit == 1:
  23.             self.suit = "Clubs"
  24.         if self.suit == 2:
  25.             self.suit = "Spades"
  26.         if self.suit == 3:
  27.             self.suit = "Diamonds"
  28.         if self.suit == 4:
  29.             self.suit = "Hearts"
  30.         self.cardname = self.rank + " of " + self.suit
  31.  
  32. deck = []
  33. for suit in range(1,5):
  34.     for rank in range(1,14):
  35.         for value in range(2,12):
  36.  
  37.             deck.append(Card(suit,rank,value))
  38.  
  39. class Player:
  40.     def total(self):
  41.         total = 100
  42.         print "You have 100 chips"
  43.         bet=raw_input("How many chips would you like to bet?")
  44.         total= int(total)-int(bet)
  45.         return total
  46.  
  47.     def bet(self):
  48.         print "You have ", total, "chips. How many would you like to bet?"
  49.         bet = raw_input()
  50.         return bet
  51.  
  52.     def player_turn(self):
  53.         hand = []
  54.         for cards in range(0,2):
  55.             a = random.choice(deck)
  56.             hand.append(a)
  57.             deck.remove(a)
  58.  
  59.         print "This is your hand:"
  60.         for card in hand:
  61.             print card.cardname
  62.  
  63.         print "Would you like to hit or stay?"
  64.         response= raw_input("Type either 'hit' or 'stay'")
  65.  
  66.         while response =="hit":
  67.             card=random.choice(deck)
  68.             hand.append(card)
  69.             deck.remove(card)
  70.             print "Your next card is", card.cardname
  71.             psum=0
  72.             for i in hand:
  73.                 psum=int(i.value) + psum
  74.             if psum > 21:
  75.                 break
  76.             print "Would you like to hit or stay?"
  77.             response = raw_input("Type either 'hit' or stay'")
  78.  
  79.             return psum
  80.  
  81.     def sum(self):
  82.         sum=0
  83.         for i in hand:
  84.             sum= int(i.value)+sum
  85.         return sum
  86.  
  87.  
  88.  
  89.  
  90.  
  91. class Dealer:
  92.  
  93.     def computer_turn(self):
  94.         dealerhand = []
  95.         for cards in range(0,2):
  96.             a = random.choice(deck)
  97.             dealerhand.append(a)
  98.             deck.remove(a)
  99.         dsum = 0
  100.         for i in dealerhand:
  101.             dsum = int(i.value)+dsum
  102.         while dsum < 17:
  103.             card = random.choice(deck)
  104.             dealerhand.append(card)
  105.             deck.remove(card)
  106.             dsum = int(card.value)+dsum
  107.  
  108.         return dsum
  109.  
  110.     def sum(self):
  111.         sum=0
  112.         for i in dealerhand:
  113.             sum= int(i.value)+sum
  114.         return sum
  115.  
  116.  
  117.  
  118. print "Would you like to play?"
  119. answer = raw_input("'Yes' or 'No'")
  120. while answer == "Yes":
  121.     p = Player()
  122.     d = Dealer()
  123.     p.total()
  124.     p.player_turn()
  125.     d.computer_turn()
  126.  
  127.  
  128.     if p.sum > d.sum and p.sum <= 21:
  129.         print "You won! Here is the dealer's score."
  130.         print d.sum
  131.     else:
  132.         print "You lost. Here is the computer's score.", d.sum
  133.  
  134.     print "Would you like to play again?"
  135.     answer = raw_input("'Yes' or 'No'")
  136.  
Feb 14 '10 #1
6 4971
bvdet
2,851 Expert Mod 2GB
One thing I noticed - In Player.player_turn() the indentation is incorrect at return psum.

Expand|Select|Wrap|Line Numbers
  1.              if psum > 21:
  2.                  break
If True, the while loop will end and None will be returned by the method.

You have a method named sum and you have an attribute named sum. They should be different. I would advise you to stay away from the names of built-in functions like sum. If you want to print the score, define it as an instance attribute something like this:
Expand|Select|Wrap|Line Numbers
  1.     def sum_score(self):
  2.         self.score = sum([int(i.value) for i in hand])
  3.         # this next line is not necessary since you have defined an instance attribute
  4.         return self.score
  5.  
  6. p = Player()
  7. p.player_turn()
  8. p.sum_score()
  9. print p.score
Make use of print statements embedded at strategic locations in your code for debugging. A lot of times you can immediately see a problem that was overlooked.
Feb 14 '10 #2
kfansi
3
Ok I am ALMOST DONE with the blackjack program, but there are these two bugs that I dont understand at all!

BUG #1:
For some reason, the program will only let you hit twice. I think I set up the while statement right, and I've checked it and I think it makes sense, so what is the problem?

Bug#2:
Even if you bust, if the computer busts as well, it will always say you won. In real blackjack it shouldn't be like that. How can I fix that?


Expand|Select|Wrap|Line Numbers
  1. #We use this module to pick a random card from the deck.
  2. import random
  3. #We use this module to close the program once the player goes bankrupt.
  4. import sys
  5.  
  6. #Makes a card and assigns suit. rank, and value.
  7. class Card:
  8.     def __init__(self, suit, rank, value):
  9.         self.rank = rank
  10.         self.suit = suit
  11.         self.value= value
  12.         if self.rank == 1:
  13.             self.rank = "Ace"
  14.             self.value = 11
  15.         elif self.rank == 11:
  16.             self.rank = "Jack"
  17.             self.value = 10
  18.         elif self.rank == 12:
  19.             self.rank = "Queen"
  20.             self.value = 10
  21.         elif self.rank == 13:
  22.             self.rank = "King"
  23.             self.value = 10
  24.         elif 2 <= self.rank <= 10:
  25.             self.value = self.rank
  26.             self.rank = str(self.rank)
  27.         if self.suit == 1:
  28.             self.suit = "Clubs"
  29.         if self.suit == 2:
  30.             self.suit = "Spades"
  31.         if self.suit == 3:
  32.             self.suit = "Diamonds"
  33.         if self.suit == 4:
  34.             self.suit = "Hearts"
  35.         self.cardname = self.rank + " of " + self.suit
  36. #Makes a deck of cards
  37. deck = []
  38. for suit in range(1,5):
  39.     for rank in range(1,14):
  40.         for value in range(2,12):
  41.             deck.append(Card(suit,rank,value))
  42. #Creates a Player
  43. class Player:
  44.  
  45. #Makes a function so the player can play the game.  
  46.     def player_turn(self):
  47. #Gives player two cards from the deck.
  48.         self.hand = []
  49.         for cards in range(0,2):
  50.             a = random.choice(deck)
  51.             self.hand.append(a)
  52.             deck.remove(a)
  53. #Prints the cards in hand.
  54.         print "Here's your hand bud:"
  55.         for card in self.hand:
  56.             print card.cardname
  57.  
  58.         print "Would you like to hit or stay?"
  59.         response= raw_input("Type either 'hit' or 'stay'")
  60.         while response.lower()!= "hit" and response.lower()!="stay":
  61.             response=raw_input("Type either 'hit' or 'stay'")
  62. #Gives the player another card if he/she decides to hit.      
  63.         while response =="hit" or response == "Hit":
  64.             card=random.choice(deck)
  65.             self.hand.append(card)
  66.             deck.remove(card)
  67.             print "Here's your next card:", card.cardname
  68.             psum=0
  69.  
  70. #Adds up the value of each card in the player's hand.
  71.             for i in self.hand:
  72.                 psum=int(i.value) + psum
  73. #Makes the Ace have a value of 1, if the sum of the player's cards are greater than 21.
  74.             for i in self.hand:
  75.                 if i.rank == 1 and p.Sum() > 21:
  76.                     i.value = 1
  77.  
  78.             if psum > 21:
  79.                 break
  80.             print "Would you like to hit or stay?"
  81.             response = raw_input("Type either 'hit' or 'stay'")
  82.             while response.lower()!="hit" and response.lower()!="stay":
  83.                 response = raw_input("Type either 'hit' or 'stay'")
  84.             return psum
  85.  
  86.  
  87. #Adds the values of each card in the player's hand.  
  88.     def Sum(self):
  89.         self.sum=0
  90.         for i in self.hand:
  91.             self.sum= int(i.value)+self.sum
  92.         return self.sum
  93.  
  94.  
  95.  
  96.  
  97. #Makes a dealer class.
  98. class Dealer:
  99. #(Same as the Player)
  100.     def computer_turn(self):
  101.         self.dealerhand = []
  102.         for cards in range(0,2):
  103.             a = random.choice(deck)
  104.             self.dealerhand.append(a)
  105.             deck.remove(a)
  106.         dsum = 0
  107.         for i in self.dealerhand:
  108.             dsum = int(i.value)+dsum
  109. #Tells the dealer to hit if the dealer's score is less than 17.
  110.         while dsum < 17:
  111.             card = random.choice(deck)
  112.             self.dealerhand.append(card)
  113.             deck.remove(card)
  114.             dsum = int(card.value)+dsum
  115.  
  116.         return dsum
  117.  
  118.     def Sum(self):
  119.         self.sum=0
  120.         for i in self.dealerhand:
  121.             self.sum= int(i.value)+self.sum
  122.         return self.sum
  123.  
  124.  
  125.  
  126.  
  127. #Actual game      
  128. print "Would you like to play Blackjack, the best game in the whole wide world!"
  129. answer = raw_input("'Yes' or 'No'")
  130.  
  131. #Makes sure the player types in either yes or no.(It can be typed in either capital or lowercase letters.)
  132. while answer.lower()!="yes" and answer.lower()!="no":
  133.     answer = raw_input("'Yes' or 'No'")
  134. #Quits out of the game if the player doesn't want to play.
  135. if answer == 'No' or answer == 'no':
  136.     sys.exit()
  137. #Gives the player a starting amount of 100 chips to bet with.
  138. total=100
  139. while answer == "Yes" or answer == "yes":
  140. #Creates a player and dealer object.
  141.     p = Player()
  142.     d = Dealer()
  143.     print "You have", total, "chips"
  144. #Allows the player to place a bet.
  145.     betting=raw_input("How many chips would you like to bet?")
  146. #Runs through both functions
  147.     p.player_turn()
  148.     d.computer_turn()
  149.  
  150. #The conditions under which the player can win or lose.   
  151.     if p.Sum() > d.Sum() and p.Sum() <= 21:
  152.         print "Awww shucks! You beat me. This was my score: "
  153.         print d.Sum()
  154. #Increases chip count by amount placed in bet.
  155.         total=int(total)+int(betting)
  156.         print "You now have", total, "chips"
  157.  
  158.     elif p.Sum()>21:
  159.         print "You busted! Hahaha!"
  160.         print d.Sum()
  161. #Decreases chip count by amount placed in bet.
  162.         total=int(total)-int(betting)
  163.         print "You now have", total, "chips"
  164.  
  165.     elif d.Sum()>21:
  166.         print "Shoot! Shoot! Shoot! I busted! Damn it, you won."
  167.         print "This was my score: "
  168.         print d.Sum()
  169.         total=int(total)+int(betting)
  170.         print "You now have", total, "chips"
  171.  
  172.     elif p.Sum() == d.Sum():
  173.         print "A draw."
  174.  
  175.     else:
  176.         print "Ahahaha! Feel the wrath. I just beat you, you lil punk. Your score was", p.Sum(), "My score was:"
  177.         print d.Sum()
  178.         total=int(total)-int(betting)
  179.         print "You now have", total, "chips"
  180.  
  181. #Tells the player he/she is bankrupt and ends the game.      
  182.     if total==0:
  183.         print "YOU ARE BROKE! LOLOLOLOL!!!"
  184.         sys.exit()
  185. #Restarts the  game      
  186.     print "Let's play again, so I can win all of your chips!...Would you like to play again?"
  187.     answer = raw_input("'Yes' or 'No'")
  188.     while answer.lower()!="yes" and answer.lower()!="no":
  189.         answer = raw_input("'Yes' or 'No'")
  190.  
  191.     if answer == 'No' or answer == 'no':
  192.         sys.exit()
Feb 17 '10 #3
bvdet
2,851 Expert Mod 2GB
kfansi,

I played around with your blackjack game for several minutes, but I could not see anything wrong without adding some additional print statements. I will try to play with it some more later when I have time. It looks good. You must have spent considerable time on it. One suggestion - instead of encapsulating card "hits" in a while loop, encapsulate the play of the game in a "while True" loop and take action to the responses in an if/elif block.

In the mean time, I have been playing around with a blackjack game of my own. I used an if/elif block to encapsulate card play.
Expand|Select|Wrap|Line Numbers
  1. import random
  2.  
  3. class Card(object):
  4.  
  5.     suitList = ["Hearts", "Diamonds", "Clubs", "Spades"]
  6.     rankList = ["Invalid", "Ace", "2", "3", "4", "5", "6",
  7.                 "7", "8", "9", "10", "Jack", "Queen", "King"]
  8.     scoreList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
  9.  
  10.     def __init__ (self, suit=0, rank=1):
  11.         if suit < 0 or suit > 3:
  12.             raise AttributeError, "Suit out of range"
  13.         if rank < 1 or rank > 13:
  14.             raise AttributeError, "Rank out of range"
  15.         self.suit = suit
  16.         self.rank = rank
  17.         self.score = self.scoreList[self.rank]
  18.         self.cname = self.rankList[self.rank]
  19.         self.sname = self.suitList[self.suit]
  20.  
  21.     def __str__(self):
  22.         return self.rankList[self.rank] + " of " + self.suitList[self.suit]
  23.  
  24.     def __repr__(self):
  25.         return self.rankList[self.rank] + " of " + self.suitList[self.suit]
  26.  
  27.     def __cmp__(self, other):
  28.         i = cmp(self.rank, other.rank)
  29.         if i == 0:
  30.             return cmp(self.suit, other.suit)
  31.         return i
  32.  
  33. class Deck(object):
  34.     def __init__(self):
  35.         self.cards = []
  36.         for suit in range(5):
  37.             for rank in range(1,14):
  38.                 self.cards.append(Card(suit, rank))
  39.  
  40.     def __getitem__(self, i):
  41.         return self.cards[i]
  42.  
  43.     def __iter__(self):
  44.         for card in self.cards:
  45.             yield card
  46.  
  47.     def __len__(self):
  48.         return len(self.cards)
  49.  
  50.     def __str__(self):
  51.         return '\n'.join([str(c) for c in self])
  52.  
  53.     def __repr__(self):
  54.         return str(self.cards)
  55.  
  56. class BJ(object):
  57.  
  58.     dealer_hit_threshold = 16
  59.  
  60.     def __init__(self):
  61.         '''
  62.         Designed for 2 players. Player 2 is the dealer. Dealer wins a tie.
  63.         There is a tie if both Player and Dealer are dealt a 'natural' or
  64.         blackjack.
  65.  
  66.         Results are appended to self.results:
  67.         [[winner, playerhand, dealerhand], [winner, playerhand, dealerhand]]
  68.         Results are formatted for output.
  69.         '''
  70.         self.results = []
  71.         self.deck = Deck()
  72.  
  73.     def deal_hand(self, n, deck):
  74.         '''
  75.         Randomly deal and remove n cards from a Deck object.
  76.         '''
  77.         hand = []
  78.         if len(deck) >= n:
  79.             for i in range(n):
  80.                 hand.append(deck.cards.pop(random.choice(range(len(deck)))))
  81.         else:
  82.             print "There are not enough cards in the deck to deal %d cards." % n
  83.         return hand
  84.  
  85.     def hit_hand(self, hand, deck):
  86.         '''
  87.         Append a card to hand from deck, removing the card from deck.
  88.         '''
  89.         if len(deck):
  90.             hand.append(deck.cards.pop(random.choice(range(len(deck)))))
  91.             return True
  92.         else: return False
  93.  
  94.     def score_hand_BJ(self, hand):
  95.         '''
  96.         Tabulate the Blackjack score for hand.
  97.         Adjust score automatically for an Ace.
  98.         '''
  99.         score = sum([card.score for card in hand])
  100.         if 'Ace' in [card.cname for card in hand]:
  101.             if score <= 11:
  102.                 score += 10
  103.         return score
  104.  
  105.     def play(self):
  106.         '''
  107.         Play the game.
  108.         '''
  109.         playing = False
  110.         while True:
  111.             option = raw_input("(D)eal, (H)it Me, (S)tand, (Q)uit")
  112.             if option.upper() == "D":
  113.                 if playing:
  114.                     print "You are already playing a hand!"
  115.                 else:
  116.                     if len(self.deck) < 4:
  117.                         print
  118.                         print "Appending new deck."
  119.                         self.deck.cards.extend(Deck())
  120.                     playing = True
  121.                     hand1 = self.deal_hand(2, self.deck)
  122.                     hand2 = self.deal_hand(2, self.deck)
  123.                     print "Player 1 Hand: %s\nPlayer 2 Hand: %s" % \
  124.                           (','.join([str(c) for c in hand1]),
  125.                            ','.join(["**face down**",]+[str(c) for c in hand2[1:]]))
  126.                     print "Player 1 Score: %s\nPlayer 2 Score: %s" % \
  127.                           (self.score_hand_BJ(hand1), '****')
  128.                     # check for blackjack
  129.                     if self.score_hand_BJ(hand1) == 21 and \
  130.                        self.score_hand_BJ(hand2) == 21:
  131.                         print "Player and Dealer were both dealt 'Blackjack' (tie)."
  132.                         playing = False
  133.                     elif self.score_hand_BJ(hand1) == 21:
  134.                         print "Player was dealt 'Blackjack'. Player wins."
  135.                         self.results.append(["Player", hand1, hand2])
  136.                         playing = False
  137.  
  138.             elif option.upper() == "H":
  139.                 if playing:
  140.                     if not self.deck:
  141.                         print "New deck."
  142.                         self.deck = Deck()
  143.                     self.hit_hand(hand1, self.deck)
  144.                     print "Player took a HIT. Current HAND: %s Score: %s" % \
  145.                           (hand1, self.score_hand_BJ(hand1))
  146.                     if self.score_hand_BJ(hand1) > 21:
  147.                         print "Player BUSTS. Dealer wins."
  148.                         self.results.append(["Dealer", hand1, hand2])
  149.                         playing = False
  150.                         print
  151.                 else:
  152.                     print "You must DEAL before taking a HIT"
  153.  
  154.             elif option.upper() == "S":
  155.                 if playing:
  156.                     print
  157.                     print "Dealer HAND: %s SCORE: %s" % (hand2, self.score_hand_BJ(hand2))
  158.                     while self.score_hand_BJ(hand2) <= BJ.dealer_hit_threshold and \
  159.                           self.score_hand_BJ(hand2) < self.score_hand_BJ(hand1):
  160.                         if not self.deck:
  161.                             print "New deck."
  162.                             self.deck = Deck()
  163.                         else:
  164.                             self.hit_hand(hand2, self.deck)
  165.                             print "Dealer took a HIT. Current HAND: %s Score: %s" % \
  166.                                   (hand2, self.score_hand_BJ(hand2))
  167.                             if self.score_hand_BJ(hand2) > 21:
  168.                                 print "Dealer BUSTS. Player wins."
  169.                                 self.results.append(["Player", hand1, hand2])
  170.                                 playing = False
  171.                                 print
  172.                     if playing:
  173.                         if self.score_hand_BJ(hand1) > self.score_hand_BJ(hand2):
  174.                             print "PLAYER wins this hand.",
  175.                             print "Score: %s to %s" % (self.score_hand_BJ(hand1),
  176.                                                        self.score_hand_BJ(hand2))
  177.                             self.results.append(["Player", hand1, hand2])
  178.                         else:
  179.                             print "DEALER wins this hand.",
  180.                             print "Score: %s to %s" % (self.score_hand_BJ(hand1),
  181.                                                        self.score_hand_BJ(hand2))
  182.                             self.results.append(["Dealer", hand1, hand2])
  183.                 else:
  184.                     print "You must DEAL before selecting option to STAND."
  185.                 playing = False
  186.                 print
  187.  
  188.             elif option.upper() == "Q":
  189.                 self.play_over()
  190.                 return
  191.  
  192.     def play_over(self):
  193.         '''
  194.         Summarize the game results and display.
  195.         '''
  196.         dd = dict.fromkeys(["Player", "Dealer"], 0)
  197.         for hand in self.results:
  198.             dd[hand[0]] += 1
  199.         playerwins = dd["Player"]
  200.         dealerwins = dd["Dealer"]
  201.         if playerwins > dealerwins:
  202.             resultList = ["", "Player won %d hand%s to %d." % \
  203.                           (playerwins, ["", "s"][playerwins>1 or 0], dealerwins)]
  204.         elif playerwins == dealerwins:
  205.             resultList = ["There was a tie %d hand%s to %d." % \
  206.                           (playerwins, ["", "s"][playerwins>1 or 0], dealerwins)]
  207.         else:
  208.             resultList = ["Dealer won %d hand%s to %d." % \
  209.                           (dealerwins, ["", "s"][dealerwins>1 or 0], playerwins)]
  210.         resultList.append("Hands Played:")
  211.         if self.results:
  212.             for i, hand in enumerate(self.results):
  213.                 resultList.append("Hand %d:\n  Player %d: %s\n  Dealer %d: %s\n" % \
  214.                                   (i+1, self.score_hand_BJ(hand[1]),
  215.                                    ", ".join([str(c) for c in hand[1]]),
  216.                                    self.score_hand_BJ(hand[2]),
  217.                                    ", ".join([str(c) for c in hand[2]])))
  218.         else:
  219.             resultList.append("No hands were played")
  220.         print '\n'.join(resultList)
  221.  
  222. if __name__ == "__main__":
  223.     g = BJ()
  224.     g.play()
Feb 18 '10 #4
Glenton
391 Expert 256MB
So totally random point but here is how to get the suit symbols in unicode!

♠ ♡ ♢ ♣ just seems classy somehow...

(unless you can't read it of course...)
Feb 18 '10 #5
kfansi
3
Your program looks really good bvdet. Interesting way to go about it. I realized what the last real bug in the program is. The ace never equals one. I have an if statement inside a for statement which I thought fixed the problem, but it didn't. If you have a line of code that would fix it that'd be great.
Feb 19 '10 #6
bvdet
2,851 Expert Mod 2GB
My code considers the value of an Ace to be 1. When I tabulate the score of a hand, the code automatically adds 10 to the score if the current score is 11 or less.

Expand|Select|Wrap|Line Numbers
  1.     def score_hand_BJ(self, hand):
  2.         '''
  3.         Tabulate the Blackjack score for hand.
  4.         Adjust score automatically for an Ace.
  5.         '''
  6.         score = sum([card.score for card in hand])
  7.         if 'Ace' in [card.cname for card in hand]:
  8.             if score <= 11:
  9.                 score += 10
  10.         return score
Feb 19 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: swtstrawberry | last post by:
This program is supposed to present the buyer with an inventory list and ask if they would like to make a purchase, then enter the item number for purchase, then the amount of that item they would...
4
by: baroon | last post by:
i need help please this program in c and ineed someone to change it in to c++ (change the format).please i need it as soon as u can before tuesday:) ...
10
by: james121285 | last post by:
I am having a problem with this program, I have been trying to do it all week and am stuck. I am writing a program that will take ten values from an input file, find the max and min then print them...
1
by: radskate360 | last post by:
Hi I am newer to programming and need a bit of help with this program. OK, heres the directions. The distance between two places on earth can be calculated by using their latitudes and...
3
by: devilinthebox | last post by:
I am not really familar with Java and I need help with creating this simple Blackjack program. Here is a layout of how the program should output: If the computer has more than 16 it wins,...
1
by: 14jacobf | last post by:
My Windows XP computer keeps asking me what program to open my external usb drives. I know to open them with "explorer" in the WINDOWS file on my hard-drive. How do I set it so that it will use the...
1
by: jfeldman | last post by:
I am a little confused with how to get this method to determine what the best choice is for the number of aces that should be counted as 1 or 11. I will post the method and the code so you can run...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.