Lottonumeroitten arvontaa

[ICO]NameLast modifiedSize

[PARENTDIR]Parent Directory  -
[DIR]2001/2002-06-07 00:00 -
[DIR]2002/2003-07-08 00:00 -
[DIR]2016/2017-08-09 00:00 -
[TXT]Lotto.java2003-05-08 00:00 733
[TXT]lotto.bash2003-01-05 00:00 472
[TXT]lotto.c2004-01-05 00:00 529
[TXT]lotto.cs2024-02-18 22:38 365
[TXT]lotto.gawk2012-11-07 00:00 497
[TXT]lotto.pl2003-07-07 00:00 145
[TXT]lotto.praat2002-07-07 00:00 312
[TXT]lotto.py2024-02-11 14:43 139
[TXT]lotto.r2002-06-07 00:00 364
[TXT]lotto.sqlite2021-10-14 00:00 175

Vastaavana Perl-oneliner -komentona shellistä:

perl -e '@a=1..39; print splice(@a, rand @a, 1), "\n" for 1..7'

Käy yksirivisenä 134-merkkisenä shell-komentonakin jos Bash on tältä vuosituhannelta.

Gnu utils?

seq 1 39 | shuf | head -7

Ks. myös vähän vastaava mutta käyttäjiä profiloiva Hello World! -ohjelmakokoelma :-)

sama asia eri kieli -vertailuja enemmänkin, http://rosettacode.org ja Programming Language and compiler Benchmarks

Count words!