math.randomseed(os.time())
local number = math.random(1, 100)
print("Guess the number from 1-100")
local Ans = tonumber(io.read("*line"))

if Ans == nil then
  print('Please input a number.')
elseif Ans == number then
    print('You are correct! The number was ' .. number)
else
    print('Sorry, you are not correct. The number was ' .. number)
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: