Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question coding a card game in python

    I am currently trying to code a card game in python for a class I am taking. I am coming across a error that I have no idea why I am getting. Could anyone see what is wrong?



    Code:
    from enum import Enum
    from enum import IntEnum
    color = red
    color(self,red)
    	 
    full_deck = []
    class Card(IntEnum):
    	TWO = 2
    	THREE = 3
    	FOUR = 4
    	FIVE = 5
    	SIX = 6
    	SEVEN = 7
    	EIGHT = 8
    	NINE = 9
    	TEN = 10
    	JACK = 11
    	QUEEN = 12
    	KING = 13
    	ACE  = 1
        
    SPADES = 'spades'
    CLUBS = 'clubs'
    HEARTS='hearts'
    DIAMONDS = 'diamonds'
    suit = 'diamonds' 
    suit = 'clubs'
    suit = 'hearts'
    suit = 'spades'
    	
    
    class playingcard:
    		def rank(self, val):
    			self.rank  > card_rank
    			self.suit = card_suit
    
    
    		def clone(self):
    		 return card(self.rank, self.get_value())
    Last edited by vinyl-junkie; Mar 7th, 2019 at 09:22 PM. Reason: added code tags

  2. #2
    New to the CF scene
    Join Date
    Apr 2019
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could you post the error?
    The error I encountered is on line 3 red is not defined.
    To fix it change 'colour = red' to 'colour = "red" ' I believe.
    Line 3 and 4 are a bit confusing.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •