Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I've been learning LUA and want to clear console

I’ve been tiring to clear my console to make it neater, I’ve tried os.execute("clear") (which is similar to what I use in python)
this is the whole program:

    while( true )
    do
        local opacity
        print("What do you want the opacity to be? (invisible is 1, solid is 0)")
        opacity = io.read()
        opacity = tonumber(opacity)
        if opacity >1 then
            print("Thats not correct, try again")
            os.execute("clear")
            elseif opacity <=1 then
            print(opacity)
        end
    end

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

On Windows:

os.execute("cls")

On Unix:

os.execute("clear")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading