aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-10-08 18:29:59 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-10-08 18:29:59 -0700
commit87e4777aee530fa3bd6ce6fe1d7a206819247660 (patch)
tree83e832a06277f21e1beb2d0dbb90e7bf81656692 /lib
parent5b28823d6be71422f6a3280ddb3d10431a58f6c9 (diff)
Added random seed.
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.nom3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils.nom b/lib/utils.nom
index 55503e1..6fbf57a 100644
--- a/lib/utils.nom
+++ b/lib/utils.nom
@@ -31,6 +31,9 @@ compile [%start to %stop by %step, %start to %stop via %step] to: ".."
parse [%start to %stop] as: %start to %stop by 1
# Random functions
+lua code ".." # Seed
+ |math.randomseed(os.time());
+ |for i=1,20 do; math.random(); end;
compile [random number, random, rand] to: "math.random()"
compile [random int %n, random integer %n, randint %n] to: "math.random(\(%n as lua))"
compile [random from %low to %high, random number from %low to %high, rand %low %high] to: