Set puzzle: Difference between revisions

Content added Content deleted
(Add Rust implementation)
(→‎{{header|Tailspin}}: use cartesian product syntax)
Line 3,940: Line 3,940:
Dealing cards at random to the size of the desired hand, then trying again if the desired set count is not achieved.
Dealing cards at random to the size of the desired hand, then trying again if the desired set count is not achieved.
<lang tailspin>
<lang tailspin>
def deck: [ 1..3 -> \(def colour: $;
def deck: [ { by 1..3 -> (colour: $),
1..3 -> \(def symbol: $;
by 1..3 -> (symbol: $),
1..3 -> \(def number: $;
by 1..3 -> (number: $),
1..3 -> {colour: $colour, symbol: $symbol, number: $number, shading: $} !
by 1..3 -> (shading: $)}
\) !
\) !
\)
];
];