#๐Ÿ”’ Making a blackjack game

36 messages ยท Page 1 of 1 (latest)

simple merlinBOT
#

@pine vault

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.

fluid magnet
#

@pine vault Do you still require assistance? If not, you can close this post by typing !close.

pine vault
#

yes i do but my post did not save

#

i had my code posted and a description but it was deleted

fluid magnet
#

A theme for you, it would seem.

pine vault
#

not sure what you mean

fluid magnet
#

Your other help thread.

pine vault
#

yeah

#

should i make it a txt file?

fluid magnet
#

If it is your intent to post your code, if it fits, use the discord code block formatting.

#

!code

simple merlinBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

fluid magnet
#

If it does not, the pastebin link is at your disposal.

pine vault
#

i went to pastebin and download it now i can post that download?

fluid magnet
#

The idea is to post the url.

pine vault
#

oh okay

#

ill try a new post and close this one

#

thank you

#

well that didnt worl

#

can i post the link in here and the the think i need help with?

fluid magnet
#

That seems reasonable.

pine vault
#

My issue is with the game logic and the flow of my loops when my choice is 's' the game continues to loop as if i have continued to input s

fluid magnet
#

One of the ways you're making it difficult for yourself is the way your main function is written.

#

You have a lot of code.

#

It needs to be broken up.

#

Each function should have exactly one purpose.

#

(Most generally)

#

Once you farm out code to the functions (or methods, when you get into class based stuff), you start to be able to manage your flow a lot easier, you start to be able to debug things a lot easier, because it's all less cluttered.

#
a
b
c
d
e
f```
```py
def alpha():
    a
    b
    c

def beta():
    d
    e
    f

alpha()
beta()```
#

You don't need to focus on a before b before c if d while f, etc.

#

You only have to think alpha() beta()

pine vault
#

okay ill try and break it up thank you

#

i just know how i should write the functions to hanldle the logic for the choice being made to hit,stand,splt.double

simple merlinBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.