'math.randomseed()' returns the seeds it used
A call to 'math.randomseed()' returns the two components of the seed it set, so that they can be used to set that same seed again.
This commit is contained in:
@@ -37,8 +37,6 @@ end
|
||||
-- tests should require debug when needed
|
||||
debug = nil
|
||||
|
||||
require"bwcoercion"
|
||||
|
||||
|
||||
if usertests then
|
||||
T = nil -- no "internal" tests for user tests
|
||||
@@ -46,7 +44,6 @@ else
|
||||
T = rawget(_G, "T") -- avoid problems with 'strict' module
|
||||
end
|
||||
|
||||
math.randomseed(0)
|
||||
|
||||
--[=[
|
||||
example of a long [comment],
|
||||
@@ -54,6 +51,14 @@ math.randomseed(0)
|
||||
|
||||
]=]
|
||||
|
||||
print("\n\tStarting Tests")
|
||||
|
||||
do
|
||||
-- set random seed
|
||||
local random_x, random_y = math.randomseed()
|
||||
print(string.format("random seeds: %d, %d", random_x, random_y))
|
||||
end
|
||||
|
||||
print("current path:\n****" .. package.path .. "****\n")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user