r/shittyprogramming • • Nov 11 '18

My first game I have ever written...

So I am new to programming (about 5 months or so of HTML/CSS and 2 months of Python), and I made a life simulation (text-based). You really don't do anything except run it over and over again to see different scenarios, but I counted, and after about 10 hours of making it, it has... drum roll please...

30 GAME BREAKING BUGS!!!!

Yeah, I have a lot to learn...

Edit: Here is a pastebin with the code: https://pastebin.com/zkJ8a170

50 Upvotes

24 comments sorted by

33

u/Mackmack469 Nov 11 '18

30 game breaking bugs that you know of...

6

u/DrChicken2424 Nov 11 '18

Lol I pretty much just ran it over and over again to find out the different errors because I knew there were gonna be tons.

6

u/damnburglar Nov 11 '18

At least 10 of those bugs are holding shit together.

31

u/joeytman Nov 11 '18 edited Sep 09 '26

Party stocking bells resolute upbeat fluorine breezy basket run

This post was anonymized with Redact

1

u/DrChicken2424 Nov 11 '18

🙏

What would you recommend? The course I took on OOP was really messy compared to everything else and just didn’t make any sense to me at all...

3

u/joeytman Nov 11 '18 edited Sep 09 '26

Enter oxygen serious existence imminent wild coated entertain chlorine

This post was anonymized with Redact

2

u/CodenameLambda Nov 11 '18

Your advice is pretty interesting for me: I haven't written anything big in Python for quite a long time, and it just shows the difference in tackling a problem in different languages, which is why my first thought reading it was "dictionaries!":

In Python, having a superclass and deriving from it is certainly the way to go, while you'd use enums and methods on those in, for example, Rust or C(++) (which are roughly equivalent to how I'd use dictionaries there). To be honest, I don't miss OOP at all when writing in Rust, since most OOP patterns are just either (basically) slower enums or interfaces anyway; but it's nice to "get back to the roots" a bit, since Python was my first language, which I will always hold dearly.

13

u/IIAOPSW Nov 11 '18

30 game breaking bugs

number 24 will make you stack overflow!

3

u/rmrfbenis Nov 11 '18

Wow, another great list! Thank you so much, Bufferfeed team!

13

u/great_site_not Nov 11 '18

Please post the game and/or code? This thread isn't very entertaining if we can't see anything. :( I can't speak for anyone else here, but I promise I'll be nice. Everyone starts out shitty at programming. Pretty much all programmers at every experience level write shitty code sometimes. It's just part of the fun of being a programmer and/or learning to be one. I'd like to think that everyone here would laugh with you, not at you.

1

u/DrChicken2424 Nov 11 '18

Thanks for the encouragement 😁

I added a pastebin with the code: https://pastebin.com/zkJ8a170

3

u/great_site_not Nov 11 '18

Looking at this code, I see what must have been a painful amount of repetition. If you study Python's string formatting (f-strings were added in 3.6 and they're the simplest way) and perhaps some OOP basics, you'll be able to figure out some ways to majorly cut down the repetition and write more fluently. For example, you could write something like this:

print( f"{random.choice(['Nice', 'Awesome'])}! You are a {player.gender} {player.species}." )

to replace those if-elif blocks confirming the player's gender and species.

You clearly are making progress in learning to translate your ideas into Python and have fun doing it. I wish you the best. :)

1

u/DrChicken2424 Nov 11 '18

Thanks! Do you have any place you would recommend to learn that?

4

u/Dnguyen2204 Nov 11 '18

Yup! Tons of shitty codes

17

u/[deleted] Nov 11 '18

But are those programming related or game design related?

3

u/[deleted] Nov 11 '18

html/css doesn't count as programming

1

u/DrChicken2424 Nov 11 '18

Umm.... I know...?

1

u/[deleted] Nov 11 '18

So I am new to programming (about 5 months or so of HTML/CSS [...]

3

u/DrChicken2424 Nov 11 '18

Ok that was targeted more towards the python

2

u/[deleted] Nov 11 '18

Yeah I figured but Just for the future, mentioning HTML and programming in the same sentence is rarely a good idea, haha

1

u/[deleted] Nov 13 '18

what are classes