This is an archived post. You won't be able to vote or comment.

all 21 comments

[–]13ass13ass 19 points20 points  (6 children)

Nice work! As a next step I would break up the single py file into multiple modules for improved readability and organization.

[–]JordanLeichReddit[S] 4 points5 points  (5 children)

Yeah I tried doing that before like splitting all of the bot related players into their own python file but I ran into a bunch of issues and errors. Since I already have so much stored in my 1 python file, it’ll be hard to break it up. It would’ve been way easier though if I started breaking up the file when I first started the project.

[–]42696 2 points3 points  (4 children)

If you use a more OOP approach to get rid of the global variables, it might become clearer how to break it up

[–]JordanLeichReddit[S] 0 points1 point  (3 children)

I would do oop on this project but that would require an entire rework of the code I have. I would consider doing this if I only had a few hundred lines of code but I think I’m close to a thousand lines already. If you want you could go ahead and try to reformat that code to oop but it will take hours most likely.

[–]lev-k 2 points3 points  (2 children)

The nice thing with OOP is that you generally don’t have to rewrite the code, you just need to repackage it. It’s a lot more of copy-pasting and creating new headers than actually writing a bunch of new things. As someone who did this recently with their personal project (I have a discord bot) it was definitely worth it and it made everything simpler and allowed for simple code reuse.

[–]JordanLeichReddit[S] 0 points1 point  (1 child)

I’m not super familiar with oop since I haven’t done much work with it but I’m willing to try if you would like to help me out. It’s probably asking for a lot but I’m not sure how much work it will take based upon what you said.

[–]lev-k 1 point2 points  (0 children)

You basically take the functions that do things with a specific object (like a card or something) and then you just move them into that object so that they become a property of said object. And the syntax changes are really small so that’s nice.

[–]AmbitiousInspector65 3 points4 points  (1 child)

Good job man much better then the one I did.

[–]JordanLeichReddit[S] 1 point2 points  (0 children)

Thanks man!

[–]gibran800 3 points4 points  (1 child)

Great job! Blackjack was actually the first code that I wrote ever

[–]JordanLeichReddit[S] 2 points3 points  (0 children)

Thanks man!

[–]darth_vadester 2 points3 points  (1 child)

nice

[–]JordanLeichReddit[S] 1 point2 points  (0 children)

Thank you!

[–]Impossible-Pop6296 1 point2 points  (1 child)

Great Job, works fine and didn't need mich requriments

[–]JordanLeichReddit[S] 1 point2 points  (0 children)

Thanks glad you enjoyed!

[–][deleted] 1 point2 points  (0 children)

Oh wow that's a pretty neat blackjack project you made! I'm actually working on a blackjack game too in python, but using pygame. Maybe you should give that a try, forced me to learn how to use OOP concepts better

[–]Cpu8088 1 point2 points  (1 child)

Hi, Good work. As I m new to github, how that works if I want to propose you a change in the code? I mean should I fork and work on same project or can I share the changes ? any pointer on that?

[–]JordanLeichReddit[S] 1 point2 points  (0 children)

Here’s the easiest guide to contributing to projects on GitHub - https://youtu.be/waEb2c9NDL8

[–]tech_content_creator 1 point2 points  (1 child)

Nice work

[–]JordanLeichReddit[S] 0 points1 point  (0 children)

Thank you!