DEV Community

Discussion on: Tackling a Problem From a Beginner's Perspective

 
deciduously profile image
Ben Lovy

Definitely! I think that's a good idea. You can have an overarching Game class that maintains a list of players and the list of cards, and ask for how many players to create in the constructor. Then, each player can be a Player instance, you can have a CardDeck, and a Card...I think classes and objects are really useful for organizing your code as it gets bigger. You can keep most of the same actual logic, it just provides a convenient, readable structure.