name = "caleb"
question = "Do you read books frequently?"
function magicBallFunction()
math.randomseed(os.time()*1000)
dice = math.random(1, 11)
if dice == 1 then
return("Absolutely.")
elseif dice == 2 then
return("yup!")
elseif dice == 3 then
return("You will find out soon.")
elseif dice == 4 then
return("I forgot.")
elseif dice == 5 then
return("Absolutely not.")
elseif dice == 6 then
return("nah!")
elseif dice == 7 then
return("sure")
elseif dice == 8 then
return("probably")
elseif dice == 9 then
return("probably not")
elseif dice == 10 then
return("i think so")
elseif dice == 11 then
return("i don't think so")
else
return("I cannot answer that...")
end
end
print(name, "asks", question)
eightBallCall = magicBallFunction()
print(eightBallCall)
To embed this program on your website, copy the following code and paste it into your website's HTML: