File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -147,4 +147,25 @@ Same as C<.join(' ')>.
147
147
148
148
Same as C < .elems > .
149
149
150
+ = head3 pick
151
+
152
+ multi method pick(List:D:, $count = 1)
153
+
154
+ Returns a list of random, non-repeating list elements of C < $count >
155
+ elements (or a single element if C < $count > is 1).
156
+
157
+ If a C < * > is passed to C < $count > , all elements are returned in a random
158
+ order.
159
+
160
+ = head3 roll
161
+
162
+ multi method roll(List:D:, $count = 1)
163
+
164
+ Returns a lazy list of C < $count > elements, each randomly selected from the
165
+ list. Each random choice is made indepently, like a separate die roll
166
+ where each die face is a list element.
167
+
168
+ If C < * > is passed to C < $count > , a lazy, infinite list of randomly chosen
169
+ elements from the original list.
170
+
150
171
= end pod
You can’t perform that action at this time.
0 commit comments