#!/pro/bin/perl use strict; use warnings; # usage: dobbelsteen [ n [ s ]] # n : aantal stenen (1) # s : zijden per steen (6) my $n = shift (@ARGV) // 1; my $s = shift (@ARGV) // 6; $, = " "; srand time; while (<>) { print "worp: ", (map { 1 + int rand $s } 1 .. $n), "\n"; }