Re: playing card classes in php...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Master_Insanity wrote:
 >
 >
 > This is my first time trying to use php to do Object Oriented
 > programming (not that my OO experience is very extensive as it is)..
 > I'm trying to write a card game, but I'm running into trouble in
 > places I thought OO languages would work..

You just have to correct those little bugs in your code:
...
 > class deck
 > {
 >   function draw()
 >   {

       return new card('a', 's');

 >    }
 > }
 >
 > I would have thought from the documentation I've read that these two
 > classes would allow me to do:

$mine = new card('5','c');

 > $mine->display();

$mine2 = deck::draw();

 > $mine2->display();
 >

-- 
Regards,

Nezar Nielsen
http://fez.dk



PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux