Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:RemiLib
(view source)
Revision as of 04:56, 25 October 2015
153 bytes removed
,
9 years ago
no edit summary
Line 30:
Line 30:
function p.timeHash(seed)
function p.timeHash(seed)
local randomizer = 0
local randomizer = 0
−
−
mw.log("Aaaaaaa")
−
mw.log(type(seed))
−
mw.log(seed)
if seed == nil then
if seed == nil then
−
mw.log("asdf")
randomizer = math.random(0,9999999)
randomizer = math.random(0,9999999)
elseif type(seed) == "table" then
elseif type(seed) == "table" then
Line 42:
Line 37:
randomizer = math.random(0,9999999)
randomizer = math.random(0,9999999)
else
else
−
mw.log("fdsa")
for k,v in pairs(seed) do
for k,v in pairs(seed) do
randomizer = randomizer + p.hashString(k)
randomizer = randomizer + p.hashString(k)
Line 60:
Line 54:
local time = os.time()
local time = os.time()
local rand = math.random(-1,1)
local rand = math.random(-1,1)
−
mw.log(randomizer)
+
−
mw.log(rand)
−
mw.log(time)
−
mw.log("fdsa")
return (math.floor(time*265314426625821*rand)-randomizer) % 2^32+math.floor(math.random(-1,1)*1381242451)
return (math.floor(time*265314426625821*rand)-randomizer) % 2^32+math.floor(math.random(-1,1)*1381242451)
end
end
Remi Scarlet
2,922
edits