Re: Deck of Cards Question...

new topic     » goto parent     » topic index » view thread      » older message » newer message

This is as non-standard a deck you can get... It's not actually a "poker"
deck. blink

Right now it has over 80 cards, composed of 7 types of cards, but that will
be customizable, depending on what type of game the players want, and how
playtesting plays out.

If I were to implement it in OOP, can you (or any OOP guru) provide a
template for a deck of cards?

My initial brainwork in pseudo-OOP-speak:

first, define the 'card' object
second, create the types of cards using the 'card' template
third, create a deck composed of card types
fourth, create functions that operate on the deck

Objects have methods and procedures, right? Fun fun fun!

-ck

> -----Original Message-----
> From: Euphoria Programming for MS-DOS
> [mailto:EUPHORIA at LISTSERV.MUOHIO.EDU]On Behalf Of Derek Parnell
> Sent: Sunday, November 19, 2000 7:17 PM
> To: EUPHORIA at LISTSERV.MUOHIO.EDU
> Subject: Re: Deck of Cards Question...
>
>
> I like OOP so I'd tend towards that, but the second suggestion,...
>
>   shuffled_deck = shuffle(deck)
>
> is okay too. Global variables, like GOTO, can easily be misused and cause
> weird bugs. Its a bit unfortunate that Euphoria encourages them, but until
> namespace and forward referencing issues are finalized, we have
> to live with
> this little "devil".
>
> Also, the function method makes it easier to implement non-standard decks
> (short or enlarged ones, for example.).
>
>    shuffled_deck = shuffle(deck & deck)
>
>    shuffled_deck = shuffle(deck[Spade04 .. SpadeAce] & deck[Club04 ..
> ClubAce])
>
> -----
> cheers,
> Derek Parnell
>
> >When "using a deck of cards," what's the best way to manipulate the deck?
> >
> >Should I go OOP?
> >
> > deck.shuffle

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu