diff options
Diffstat (limited to 'bin/rndi.awk')
-rw-r--r-- | bin/rndi.awk | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/rndi.awk b/bin/rndi.awk index 337498cb..49df4398 100644 --- a/bin/rndi.awk +++ b/bin/rndi.awk @@ -5,17 +5,15 @@ BEGIN { # Seed with the third argument if given - if (ARGV[3]) { + if (ARGV[3]) srand(ARGV[3]) - } # If not, just seed with what is probably a date/time-derived value - else { + else srand() - } # Print a random integer bounded by the first and second arguments - print int(ARGV[1]+rand()*(ARGV[2]-ARGV[1]+1)) + print int(ARGV[1] + rand() * (ARGV[2] - ARGV[1] + 1)) # Bail before processing any lines exit |