Anonymous user
Set puzzle: Difference between revisions
Updated D entry
(Updated D entry) |
|||
Line 551:
}
static immutable Card[81] deck;
}
immutable colors = [EnumMembers!Color];
immutable numbers = [EnumMembers!Number];
Line 577:
// of 3.
bool validSet(in ref Card c1, in ref Card c2, in ref Card c3)
const pure nothrow @safe @nogc {
return !((c1.c + c2.c + c3.c) % 3 ||
(c1.n + c2.n + c3.n) % 3 ||
Line 585:
immutable(Card)[3][] findSets(in Card[] cards, in uint target = 0)
const pure nothrow @safe {
immutable len = cards.length;
if (len < 3)
|