Anonymous user
Playing cards: Difference between revisions
Updated D entry
(→{{header|Go}}: Redo the Go solution as a reusable package with a slightly different API.) |
(Updated D entry) |
||
Line 739:
alias Card = Tuple!(Pip, Suit);
return cartesianProduct([EnumMembers!Pip], [EnumMembers!Suit]);
}
alias shuffleDeck = randomShuffle;
Card dealCard(ref Card[] deck) pure nothrow @safe @nogc {
immutable card = deck.back;
deck.popBack;
Line 757 ⟶ 756:
void main() {
auto d = newDeck.array;
d.show;
d.shuffleDeck;
|