MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / problem_23

Function problem_23

examples/99_problems.cpp:187–190  ·  view source on GitHub ↗

P23 (**) Extract a given number of randomly selected elements from a list.

Source from the content-addressed store, hash-verified

185
186// P23 (**) Extract a given number of randomly selected elements from a list.
187void problem_23()
188{
189 print_result(sample(std::random_device()(), 3, xs));
190}
191
192// P24 (*) Lotto: Draw N different random numbers from the set 1..M.
193void problem_24()

Callers 1

mainFunction · 0.85

Calls 2

print_resultFunction · 0.85
sampleFunction · 0.50

Tested by

no test coverage detected