For a very simple dice game I intend to create a class with attributes of name and score. It is straight forward to create this and also to create objects of player1, player2 and so on. However if I don't know how many player objects I need as the number of players is dynamic, can I make a function which will create and name these player objects?
How to create a varying qty of instances of a Class and name them?
How to create a varying qty of instances of a Class and name them?
|
|
Messages In This Thread |
How to create a varying qty of instances of a Class and name them? - by KM007 - May-29-2020, 12:15 PM
RE: How to create Objects in Classes - by Yoriz - May-29-2020, 12:20 PM
RE: How to create a varying qty of instances of a Class and name them? - by KM007 - May-29-2020, 12:30 PM
|
Users browsing this thread: 2 Guest(s)