Edit seems to happen for all custom Roblox tables as buildthomas pointed out
The methods in Random have different memory addresses but behave the exact same way?
Old, faulty test
local max = 2^53 local r1 = Random.new(1) local get1 = r1.NextIntegerlocal r2 = Random.new(2)
local get2 = r2.NextInteger
print((get1 == get2 and “same memory address for functions”) or “different memory address for functions”) – false
local flag
for i = 1,1000 do
if get1(r1,-max,max) ~= get2(r1,-max,max) then
flag = true
end
end
print((flag and “different behavior for functions”) or “functions behave the same”)
local max = 2^53
local count = 1000
local r1 = Random.new(1)
local get1 = r1.NextInteger
local order = {}
for i = 1,count do
order[i] = get1(r1,-max,max)
end
r1 = Random.new(1)
get1 = r1.NextInteger
local r2 = Random.new(2)
local get2 = r2.NextInteger
print((get1 == get2 and "same memory address for functions") or "different memory address for functions") -- false
local flag
for i = 1,count do
if order[i] ~= get2(r1,-max,max) then
flag = true
break
end
end
print((flag and "different behavior for functions") or "functions behave the same")