User Profile

Collapse

Profile Sidebar

Collapse
prince99
prince99
Last Activity: Nov 1 '06, 02:49 AM
Joined: Oct 22 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Interesting question...well i am trying to solve your problem but it seems a bit of clever stuff. I worked out the psudo code but i am not getting the starting point. will get you back soon..mean while try someone else may he can help you.

    GOOD LUCK!
    See more | Go to post

    Leave a comment:


  • OK, i worked it out but it is giving me an error here

    Code:
    Traceback (most recent call last):
      File "D:\pythonassign2\52cards.py", line 80, in ?
        myCard = myDeck.DealCard()
      File "D:\pythonassign2\52cards.py", line 50, in DealCard
        return self.deck.pop(0) # pop the first card off the deck
    IndexError: pop from empty list
    should i place 52 in the...
    See more | Go to post

    Leave a comment:


  • i am sorry if i am bothering anyone of you but i am learning the language, so thats y i want help if i didnot see your style of programming then how i will learn, i want to see how people program and how different it is from the book. As you people know all people have thier own way and style of programming. Please don't bother if you don't wanna answer.

    thanx
    See more | Go to post

    Leave a comment:


  • yeah i can do this but it is said that we have to write it in the new window or we have to print out the cards.
    See more | Go to post

    Leave a comment:


  • Code:
    #card.py
    import string
        n = input("Enter the value: ")
    rank_desc = (None, "Ace", "Two", "Three", "Four") # describe each rank in a tuple
    suit_desc = {"s":"Spades", "h":"Hearts", "c": "Clubs", "d": "Diamonds"} # describe each suit in a dictionary
       class PlayingCard:
    ...
    See more | Go to post

    Leave a comment:


  • Cards in python (classes PlayingCard & DeckOfCards) [solved]

    i am worlking on the cards class so it can do several things.

    My code is as before but need to change the things to solve given problem

    Create a new class Deck that represents a pack of 52 cards. The class should support the following methods:
    __init__ ( self ) Creates a deck of cards in standard order.
    shuffle(self) Randomizes the order of the cards.
    dealCard(self) Returns a single card from the...
    See more | Go to post

  • yes that's right but i dunno some how its not working correctly, but anyway guys thanx for your help and time. I really appreciate you guys help

    i got a better idea now and will try to solve it out

    thanx a lot
    See more | Go to post

    Leave a comment:


  • if(teamA >= 15 or teamB >=15):
    if(abs(teamA - teamB) >=2):
    break;

    this code is not working, because the qestion says that the teams should be loss by only 2 points, but result goes other way. The program wins the game for team A but it wins by many points

    i want to get something like if the winning team scored 15 and win the other team should atleast score 13. it will make 2 points different...
    See more | Go to post

    Leave a comment:


  • This is not a class work or university assignment..it is my own work..actually i am learning python by my own..these questions are taken from a book, i solved all but these questions are giving me trouble..thank you that you help me on other questions but u atleast can give me some idea

    thank you...
    See more | Go to post

    Leave a comment:


  • Create a list of playing card specs and store in a file [solved]

    Write a program that creates a list of card objects and prints out the cards grouped by suit and in rank order within each suit. The program should read the values for the list of cards from a file, where each line in the file specifies a single card with the rank and then the suit separated by a space. Hint: sort the list first by rank, and then by suit.


    thanx
    See more | Go to post

  • prince99
    started a topic Using class to hold playing card data [solved]

    Using class to hold playing card data [solved]

    Implement a class that represents a playing card. The class should implement the following methods:
    __init__ ( self, rank, suit ) Creates a card.
    rank is an integer in the range of 1 to 13 (Ace:1, King:13), suit is a character in the set { 'h', 'd', 'c', 's' }.
    getRank(self) Returns the rank of the card.
    getSuit(self) Returns the suit of the card.
    BJValue(self) Returns the 'Blackjack value' of the card (Ace;1, Face...
    See more | Go to post

  • prince99
    started a topic Creating VolleyBall game in python [solved]

    Creating VolleyBall game in python [solved]

    Q) Design and implement a volleyball simulation. In volleyball, only the serving team can score, and if the receiving team win the rally, they gain the serve. Games are played to a score of 15, but must be won by at least 2 points. If the scores are closer, the game can continue indefinitely.

    Code given below plz correct it
    Code:
    #volleyball.py
    
    def main ():
        print Intro ()
        probA, probB,
    ...
    See more | Go to post
    Last edited by bartonc; May 18 '07, 05:39 AM. Reason: added [code][/code] tags
No activity results to display
Show More
Working...