mardi 7 septembre 2021

How to write file for save a random number by Lua languages

This is my function I would like to know how to write file for save a random number. The output from this function is nil.

function randomNum2(num)
    f = io.open("result.csv", "a+")
    num = math.randomseed(os.clock()*100000000000)
    f:write(string.format("%s\n", num))
    f:close()
    return "TETB"..(math.random(1000000000))
end

Any ideas on what the problem is and how to fix it? Thanks.




Aucun commentaire:

Enregistrer un commentaire