
Share Your Code
Browse Code
- All (902)
-
(94)
-
(84)
-
(44)
-
(4)
-
(42)
-
(135)
-
(21)
-
(41)
-
(13)
-
(65)
-
(150)
-
(209)
Random generator engine cross-platform
Hello!
We have created this function for use on the daily challenge of our game MathCatch, because the random number generation on Android is different than IOS.
Use:
1 2 3 4 5 6 7 8 9 10 11 12 13 | --declare the module: urandom=require ("urandom") --Call the random seed with: urandom.RandomSeed( seed ) --seed = a number between 0 and 99999 --Obtain a random number with: urandom.URandom (from, to) --from = a number between 0 and 999999 --to = a number between 0 and 999999 |
Download from:
http://dl.dropbox.com/u/8768831/code/urandom.7z
If you use CPM, remember to manually add the file "rand" to assets.