Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OOP Interview Question
Message
De
26/01/2006 16:04:07
 
 
À
26/01/2006 12:34:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01090521
Message ID:
01090683
Vues:
12
I'd never get hired because I hate card games hence I'd never have come up with the suit classes or the shuffle and deal methods... :o)


>>>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.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform