12 Réponses
+ 3
JSON - dictionary containing arrays of dictionaries.
https://code.sololearn.com/cQQJW1163yWO/?ref=app
+ 2
Since everything is object in Python, storing objects in one object's attributes would work.
What framework or modules are you using for your game purposes?
+ 2
Okay then how are you planning to create your game? Are you just planning for a command line one?
+ 2
If you've an android device, try searching for Pydroid3 on play store and you're good to go
+ 2
I appreciate the help, thanks
+ 2
An object that stores objects, very simply you can use a list or a dictionary in Python for this.
With a dictionary you could keep the count or the state of the object in the dict value. The dict value can also be a tuple or another list.
Alternatively you can also create your own custom objects with OOP, or you can customize the standard list / dict by inheriting your own class from them.
+ 1
What do you mean by framework? Also, I'm not using any modules besides random because I can't figure out how to make modules and import them
+ 1
Essentially yeah. It's not the best way to do it, I know.
+ 1
Got it. I thought it'd be a graphics based game so I asked about the modules.
+ 1
Ah I wish, my computer's out of service right now so I can't really add graphics besides like ASCII
+ 1
Not a problem. Btw, you could do it right from your phone now 📱😅
+ 1
Nani?!? How so?