Hey guys.
How may I implement a high/low card game using inheritance, any ideas out there? Sorry I am a bit of a newbie to all this stuff.
Help very much appreciated !
cloud21 0 Newbie Poster
Recommended Answers
Jump to Post>Then, you could define 4 derived classes, "SpadeCard",
>"HeartCard", "DiamondCard" and "ClubCard".
You really think a class for each suit is necessary? Do you suggest making a separate class for each value too? :icon_rolleyes: There's not enough complexity in a standard deck of cards to justify inheritance, so perhaps the …
Jump to PostAdding inheritance for the sake of inheritance is silly. I'd argue that just throwing inheritance in wherever you can because the assignment requires it teaches you nothing about how to design good software.
Jump to PostHere's one possible scenario. All players need to play a card, have a hand, keep a score, whatever, whether it is a computer or an enduser. Maybe you overload that you overload that so the computer outputs snide remarks like "Ha Ha, I won that one", or "Drat" or whatever. …
Jump to PostThanks for the help guys, so I need a player base class with an AI and human derived classes which both deal with the present card (rank and suit), the next guess,next card, the output result. So if the three card guesses are correct the human player wins but if …
All 16 Replies
jack1978 0 Newbie Poster
jack1978 0 Newbie Poster
cloud21 0 Newbie Poster
mcriscolo 47 Posting Whiz in Training
Narue 5,707 Bad Cop Team Colleague
mcriscolo 47 Posting Whiz in Training
Narue 5,707 Bad Cop Team Colleague
tux4life 2,072 Postaholic
tux4life 2,072 Postaholic
cloud21 0 Newbie Poster
Lerner 582 Nearly a Posting Maven
cloud21 0 Newbie Poster
jack1978 0 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
cloud21 0 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.