Playing cards: Difference between revisions
Content added Content deleted
m (→version 2: added more whitespace to the output. -- ~~~~) |
m (→{{header|PHP}}: Removed redundant Deck::__toString() and added convenience method CardCollection::toString()) |
||
Line 2,162: | Line 2,162: | ||
} |
} |
||
// use this method to iterate cards |
|||
public function toArray() |
public function toArray() |
||
{ |
{ |
||
Line 2,167: | Line 2,168: | ||
} |
} |
||
public function |
public function toString() |
||
{ |
{ |
||
return implode( ' ', $this->cards ); |
return implode( ' ', $this->cards ); |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
Line 2,211: | Line 2,217: | ||
{ |
{ |
||
shuffle( $this->cards ); |
shuffle( $this->cards ); |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
}</lang> |
}</lang> |