सामग्रीमा जानुहोस्

मोड्युल:Random didyouknow

विकिपिडिया, एक स्वतन्त्र विश्वकोशबाट
local p = {}
local q = {}
local r = {}
local s = {}
local t = {}
local u = {}
local v = {}
local x = {}
local multiplier = {}
local multiplier = 296
local minnumber = 30
local maxnumber = 60

local idp = 3

function p.round(p, idp)
math.randomseed(os.time())
p = (math.random()*multiplier*8/8)
if p <=maxnumber then p = (maxnumber - p) + p + 14 end
  local mult = 10^(idp or 0)
  return math.floor(p * mult + 0.5) / mult
  end

function p.round1(q, idp)
math.randomseed(os.time())
q = (math.random()*multiplier*7/8)
if q <=maxnumber then q = (maxnumber - q) + q + 12 end
  local mult = 10^(idp or 0)
  return math.floor(q * mult + 0.5) / mult
  end

function p.round2(r, idp)
math.randomseed(os.time())
r = (math.random()*multiplier*6/8)
if r <=minnumber then r = (minnumber - r) + r + 10 end
if r == q then q = q + 1 end
  local mult = 10^(idp or 0)
  return math.floor(r * mult + 0.5) / mult
end

function p.round3(s, idp)
math.randomseed(os.time())
s = (math.random()*multiplier*5/8)
if s <=minnumber then s = (minnumber - s) + s + 8 end
if s == r then r = r + 1 end
  local mult = 10^(idp or 0)
  return math.floor(s * mult + 0.5) / mult
end

function p.round4(t, idp)
math.randomseed(os.time())
t = (math.random()*multiplier*4/8)
if t <=minnumber then t = (minnumber - t) + t + 6 end
if t == s  then s = s + 1 end
  local mult = 10^(idp or 0)
  return math.floor(t * mult + 0.5) / mult
end

function p.round5(u, idp)
math.randomseed(os.time())
u = (math.random()*multiplier*3/8)
if u <=minnumber then u = (minnumber - u) + u + 4 end
if u == t  then t = t + (minnumber/2) end
  local mult = 10^(idp or 0)
  return math.floor(u * mult + 0.5) / mult
end

function p.round6(v, idp)
math.randomseed(os.time())
v = (math.random()*multiplier*2/8)
if v <=minnumber then v = (minnumber - v) + v + 2 end
if v == u  then u = u + (minnumber/2) end
  local mult = 10^(idp or 0)
  return math.floor(v * mult + 0.5) / mult
end

function p.round7(x, idp)
math.randomseed(os.time())
x = (math.random()*multiplier*1/8)
if x <=1 or x >=minnumber then x = 2 or 4 or 6 or 8 or 10 or 12 or 14 or 16 or 18 or 20 or 22 or 24 or 26 or 28 or 30 end
  local mult = 10^(idp or 0)
  return math.floor(x * mult + 0.5) / mult
end




return p, q, r, s, t, u, v, x, multiplier