Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OOP Interview Question
Message
From
26/01/2006 12:34:05
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01090521
Message ID:
01090556
Views:
14
>>I'm a big believer that if your a good coder in a different language you'll be a good coder in any language - because it's about the logic and the rest is just syntax. So I was looking for an OOP question that didn't rely on FoxPro knowledge and came up with. Can you describe a deck of cards as objects? Telling me what classes you would create and what properties and methods you would put in each class. To this date only 1 person has ever given me a good response on this question. Is it too tuff of a question or is it a bad question?
>
>Chuck,
>
>I don't play cards, so I can not answer your question. For me I may try with a chess set. But do you want to be able to define chess figures (how they are called?) as static objects or try to come up with the model for the whole Game?
>
>Thanks.

I'm not asking for anyone to create a game. I was looking for something like

I would create a base card class that the rest of the cards would inhertant from. In the base class I would add a property to hold the value of the card 1 to 13, height and width of the card. Then create a subclass of that baseclass for each suit. That suit class could contain it's picture, color of that suit. Then create a container object for the deck that would hold references to the suit class that would have methods like shuffle, deal.

Something along that lines.
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform