mirror of
https://github.com/FraMecca/Buridans_donkey.git
synced 2024-03-20 11:20:15 +01:00
D version
This commit is contained in:
parent
71b8d4234e
commit
92ffd123e3
1 changed files with 23 additions and 0 deletions
23
asino.d
Normal file
23
asino.d
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import std.stdio;
|
||||||
|
import std.random;
|
||||||
|
import std.getopt;
|
||||||
|
|
||||||
|
void
|
||||||
|
main (string[] args)
|
||||||
|
{
|
||||||
|
bool num;
|
||||||
|
auto cliOpts = getopt (
|
||||||
|
args,
|
||||||
|
"no-numbers|n", "disable number output on screen", &num);
|
||||||
|
|
||||||
|
args = args[1 .. $];
|
||||||
|
Mt19937 gen;
|
||||||
|
gen.seed (unpredictableSeed);
|
||||||
|
randomShuffle (args);
|
||||||
|
|
||||||
|
foreach (i, arg; args) {
|
||||||
|
if (num) writeln (arg);
|
||||||
|
else writefln ("%s: %s", i, arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue