#🔒 O.O.P help

4 messages · Page 1 of 1 (latest)

austere cairn
#

I am struggling with O.O.P and understanding it as a whole, I know what encapsulation , inheritance , classes, objects and etc is but I am still struggling with coding a whole system that O.O.P makes it simple, for example if I want to create a cards game, I am struggling with understanding how to link each other classes methods to each other and how to invoke correctly whenever is needed. I would like some help because chatGPT is too robust for me and doesn't help me with my issue and if it does it will be way too long to come to a close for something bitter that didn't really progress me anywhere by alot. Let's say as a example I want to make a BJ game but I have no idea how to make a turn start and while it started I can do other methods like place card or proceed...
class Game is part of a bigger code with classes like hand,deck..

class Game:
def init(self, players=1):
self.players = players
def start_turn(self):
current_hand = []
for p in range(players):
current_hand = self.cards
while flag == False:
interface() #???

def interface(self):
    user = print("Press P to end turn")
    if user.lower() == 'p':
        flag == True
    else:
        interface()
amber groveBOT
#

@austere cairn

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

amber groveBOT
#

@austere cairn

Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.