[Jprogramming] Picking lottery tickets
Sherlock, Ric
R.G.Sherlock at massey.ac.nz
Sun Aug 2 13:48:31 HKT 2009
> From: John Randall
> The Mega Millions lottery requires picking 5 distinct numbers in the
> range 1-56 and one number in the range 1-46.
pick=: (5 1 (<@:>:@?) 56 46"_)"0
pick i.4
+-------------+--+
|55 16 8 15 50|33|
+-------------+--+
|9 4 1 18 20 |30|
+-------------+--+
|15 26 48 11 1|20|
+-------------+--+
|15 8 56 31 43|17|
+-------------+--+
More information about the Programming
mailing list