Choose The Powerball Numbers!
Dyalog APL, 10 bytes
(5?69),?26
Dyadic ?
is ⍺ distinct random numbers in [1,⍵], and monadic ?
is a single random number.
Try it here.
CJam, 16 bytes
69,mr5<26mr+:)S*
69, range(69)
mr shuffle the generated array
5< first 5 elements
26mr random number 0..25
+ concat to array
:) increment each array element
S* join with spaces
Try it online.
MATL, 10 bytes
69 5Zr26Yr
Uses current version (9.2.0) of the language/compiler.
Example
With compiler run on Matlab:
>> matl
> 69 5Zr26Yr
>
66
59
64
56
29
12
With compiler run on Octave:
>> matl
> 69 5Zr26Yr
>
2 69 41 44 23
22
The first five numbers are separated by space, not by newline. This is due to Octave's underlying randsample
function behaving differently from Matlab's (and has been corrected in a new version of the compiler). Anyway, newline and space are both allowed by the challenge.
Edit (April 4, 2016): Try it online!
Explanation
69 5Zr % randsample(69,5), without replacement by default. Gives a 5x1 column vector
26Yr % randi(26). Gives single number
% implicit display
See relevant Matlab functions: randsample
and randi
.