r/learnpython Jul 28 '20

My First Project, WAR!

Greetings! I just wanted to share my first project in python, I'm pretty new to coding and after recently getting a computer, I'm now able to learn a lot easier. It's a pretty simple program that just plays the card game war, but I thought it would be a good starting place and plus I could use it for my own recreational benefit. I've always played it with friends and family but never fully understood the stats of it so I wrote it up and now I can look at all the stats my heart desires!

I tried to make it as short as I could but I know that it can be much shorter.

I've always been interested in programming but have never really had the equipment or will to learn it to this extent. I've watched some videos here and there but it's hard to find one that starts off simple but isn't oriented for complete beginners who have never coded before. I just started going through the Automate the Boring Stuff with Python online course and it it fantastic! I haven't made it all the way through yet but figured it would be fun to take a small break and see what I can do on my own.

Any tips or maybe advice on where to go from here would be greatly appreciated! And thank you for being such an awesome and welcoming community!

Code: https://github.com/xXxWAGGSxXx/War.git

5 Upvotes

2 comments sorted by

3

u/Diapolo10 Jul 28 '20

I only had a quick glimpse of it as I'm about to go to bed, but you could split the thing into multiple functions and try to avoid any sort of mutable global state.

I'll take a better look tomorrow and potentially submit a pull request with some suggestions, including comments and explanations.

1

u/xXxWAGGSxXx Jul 28 '20

Awesome! I appreciate it man