How do I clear the console in a Lua Program

前端 未结 4 963
梦如初夏
梦如初夏 2021-02-06 03:11

I\'m making my first Lua program with the console, and I need to find out how to remove all the text in the console without just appending a ton of \\n\'s.

4条回答
  •  悲哀的现实
    2021-02-06 03:46

    As mentioned in the other reply, you can use os.execute() to clear the console. However, if you do not have access to this function, then you might be forced to spam the console with new lines, so it seems "empty" to the user.

    However, if you are able to use os.execute, then you should definitely use it.

    for i = 1, 255 do
        print()
    end
    

提交回复
热议问题