FANDOM


local p = {}
 
function prime(n)
    for i = 2, n^(1/2) do
        if (n % i) == 0 then
            return i
        end
    end
    return true
end
 
function ternary ( cond , T , F )
    if cond then return T else return F end
end
 
function p.n( frame )
    math.randomseed(os.time())
    local rng = math.random(1,666)
    local isprime = prime(rng)
    local iseven = rng % 2 == 0
    return [[
    <center><big><big>Your lucky number is  ]] .. rng .. [[!</big></big></center>
----
    <center><big><big>Is it even?</big></big></center>
----
    <center><big><big>]] .. ternary(iseven, 'Yes!', 'No!') .. [[</big></big></center>
----
<center><big><big>Is it a prime number?</big></big></center>
----
<center><big><big>]] .. ternary(isprime == true, "Yes!", "No! It is divisible by " .. tostring(isprime)) .. [[</big></big></center>
    ]]
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.